summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source')
-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
490 files changed, 14342 insertions, 14831 deletions
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 lngeren Eingaben)
- // mglichst 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 fr 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);