summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/accessibility/accessibledialogcontrolshape.cxx2
-rw-r--r--basctl/source/accessibility/accessibledialogwindow.cxx2
-rw-r--r--basctl/source/basicide/basicrenderable.cxx2
-rw-r--r--basctl/source/basicide/baside2.cxx2
-rw-r--r--basctl/source/basicide/baside2b.cxx4
-rw-r--r--basctl/source/basicide/moduldl2.cxx4
-rw-r--r--basctl/source/basicide/moduldlg.cxx2
-rw-r--r--basctl/source/basicide/objdlg.cxx6
-rw-r--r--basctl/source/dlged/dlged.cxx10
-rw-r--r--basctl/source/dlged/dlgedobj.cxx36
-rw-r--r--basic/source/runtime/inputbox.cxx4
-rw-r--r--basic/source/runtime/iosys.cxx2
-rw-r--r--basic/source/runtime/methods1.cxx8
-rw-r--r--basic/source/runtime/stdobj1.cxx4
-rw-r--r--canvas/source/cairo/cairo_devicehelper.cxx4
-rw-r--r--canvas/source/opengl/ogl_spritedevicehelper.cxx4
-rw-r--r--canvas/source/vcl/devicehelper.cxx4
-rw-r--r--chart2/source/controller/accessibility/AccessibleViewForwarder.cxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx2
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx14
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard.cxx4
-rw-r--r--chart2/source/controller/dialogs/dlg_DataEditor.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_ChartType.cxx2
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx4
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx4
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx2
-rw-r--r--chart2/source/controller/main/ElementSelector.cxx2
-rw-r--r--chart2/source/controller/sidebar/ChartLinePanel.cxx2
-rw-r--r--chart2/source/view/main/ChartItemPool.cxx2
-rw-r--r--chart2/source/view/main/ChartView.cxx2
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx6
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx2
-rw-r--r--cui/source/customize/acccfg.cxx10
-rw-r--r--cui/source/customize/cfg.cxx6
-rw-r--r--cui/source/customize/eventdlg.cxx2
-rw-r--r--cui/source/customize/macropg.cxx8
-rw-r--r--cui/source/dialogs/SpellDialog.cxx2
-rw-r--r--cui/source/dialogs/colorpicker.cxx2
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx2
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx4
-rw-r--r--cui/source/dialogs/hlmarkwn.cxx2
-rw-r--r--cui/source/dialogs/linkdlg.cxx8
-rw-r--r--cui/source/dialogs/multipat.cxx4
-rw-r--r--cui/source/options/certpath.cxx2
-rw-r--r--cui/source/options/connpooloptions.cxx8
-rw-r--r--cui/source/options/dbregister.cxx8
-rw-r--r--cui/source/options/fontsubs.cxx6
-rw-r--r--cui/source/options/optaboutconfig.cxx6
-rw-r--r--cui/source/options/optfltr.cxx2
-rw-r--r--cui/source/options/optjava.cxx6
-rw-r--r--cui/source/options/optlingu.cxx2
-rw-r--r--cui/source/options/optpath.cxx8
-rw-r--r--cui/source/options/treeopt.cxx2
-rw-r--r--cui/source/options/webconninfo.cxx2
-rw-r--r--cui/source/tabpages/autocdlg.cxx10
-rw-r--r--cui/source/tabpages/border.cxx10
-rw-r--r--cui/source/tabpages/chardlg.cxx16
-rw-r--r--cui/source/tabpages/grfpage.cxx10
-rw-r--r--cui/source/tabpages/labdlg.cxx2
-rw-r--r--cui/source/tabpages/macroass.cxx4
-rw-r--r--cui/source/tabpages/measure.cxx2
-rw-r--r--cui/source/tabpages/numpages.cxx12
-rw-r--r--cui/source/tabpages/page.cxx70
-rw-r--r--cui/source/tabpages/paragrph.cxx6
-rw-r--r--cui/source/tabpages/tabstpge.cxx14
-rw-r--r--cui/source/tabpages/tparea.cxx4
-rw-r--r--cui/source/tabpages/tpbitmap.cxx16
-rw-r--r--cui/source/tabpages/tpcolor.cxx4
-rw-r--r--cui/source/tabpages/tpline.cxx18
-rw-r--r--cui/source/tabpages/transfrm.cxx14
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationdialog.cxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailView.cxx4
-rw-r--r--dbaccess/source/ui/app/AppSwapWindow.cxx2
-rw-r--r--dbaccess/source/ui/app/AppTitleWindow.cxx4
-rw-r--r--dbaccess/source/ui/app/AppView.cxx4
-rw-r--r--dbaccess/source/ui/browser/brwview.cxx2
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx4
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx8
-rw-r--r--dbaccess/source/ui/control/RelationControl.cxx2
-rw-r--r--dbaccess/source/ui/control/VertSplitView.cxx2
-rw-r--r--dbaccess/source/ui/dlg/adminpages.cxx2
-rw-r--r--dbaccess/source/ui/dlg/adtabdlg.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbwiz.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx2
-rw-r--r--dbaccess/source/ui/dlg/indexdialog.cxx4
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx12
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx8
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx10
-rw-r--r--dbaccess/source/ui/querydesign/querycontainerwindow.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/querydlg.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx4
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx4
-rw-r--r--desktop/source/deployment/gui/license_dialog.cxx2
-rw-r--r--drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx2
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx20
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx2
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx10
-rw-r--r--drawinglayer/source/tools/converters.cxx2
-rw-r--r--editeng/source/editeng/editdbg.cxx4
-rw-r--r--editeng/source/editeng/editview.cxx4
-rw-r--r--editeng/source/editeng/eehtml.cxx10
-rw-r--r--editeng/source/editeng/eertfpar.cxx6
-rw-r--r--editeng/source/editeng/impedit.cxx26
-rw-r--r--editeng/source/editeng/impedit2.cxx4
-rw-r--r--editeng/source/editeng/impedit4.cxx6
-rw-r--r--editeng/source/items/itemtype.cxx62
-rw-r--r--editeng/source/items/numitem.cxx4
-rw-r--r--editeng/source/items/paperinf.cxx12
-rw-r--r--editeng/source/items/textitem.cxx73
-rw-r--r--editeng/source/outliner/outliner.cxx2
-rw-r--r--editeng/source/uno/unoipset.cxx20
-rw-r--r--extensions/source/abpilot/abspilot.cxx2
-rw-r--r--extensions/source/bibliography/general.cxx2
-rw-r--r--extensions/source/dbpilots/controlwizard.cxx2
-rw-r--r--extensions/source/propctrlr/browserline.cxx2
-rw-r--r--extensions/source/propctrlr/browserlistbox.cxx4
-rw-r--r--extensions/source/propctrlr/fontdialog.cxx4
-rw-r--r--extensions/source/propctrlr/inspectorhelpwindow.cxx8
-rw-r--r--extensions/source/propctrlr/listselectiondlg.cxx2
-rw-r--r--extensions/source/scanner/grid.cxx4
-rw-r--r--extensions/source/scanner/sanedlg.cxx16
-rw-r--r--filter/source/flash/swfwriter.cxx4
-rw-r--r--filter/source/flash/swfwriter1.cxx4
-rw-r--r--filter/source/graphicfilter/egif/egif.cxx4
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx2
-rw-r--r--filter/source/graphicfilter/etiff/etiff.cxx4
-rw-r--r--filter/source/graphicfilter/idxf/dxf2mtf.cxx4
-rw-r--r--filter/source/graphicfilter/ieps/ieps.cxx16
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx4
-rw-r--r--filter/source/graphicfilter/ipcx/ipcx.cxx2
-rw-r--r--filter/source/graphicfilter/ipict/ipict.cxx2
-rw-r--r--filter/source/graphicfilter/ipsd/ipsd.cxx6
-rw-r--r--filter/source/graphicfilter/itiff/itiff.cxx2
-rw-r--r--filter/source/msfilter/escherex.cxx10
-rw-r--r--filter/source/msfilter/eschesdo.cxx4
-rw-r--r--filter/source/msfilter/msdffimp.cxx30
-rw-r--r--filter/source/msfilter/svdfppt.cxx2
-rw-r--r--filter/source/pdf/impdialog.cxx2
-rw-r--r--filter/source/pdf/pdfexport.cxx10
-rw-r--r--filter/source/svg/svgexport.cxx12
-rw-r--r--filter/source/svg/svgfontexport.cxx2
-rw-r--r--filter/source/svg/svgwriter.cxx6
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx8
-rw-r--r--forms/source/richtext/richtextcontrol.cxx4
-rw-r--r--forms/source/richtext/richtextengine.cxx2
-rw-r--r--forms/source/richtext/richtextimplcontrol.cxx2
-rw-r--r--forms/source/richtext/rtattributehandler.cxx8
-rw-r--r--formula/source/ui/dlg/formula.cxx2
-rw-r--r--formula/source/ui/dlg/funcpage.cxx2
-rw-r--r--formula/source/ui/dlg/structpg.cxx2
-rw-r--r--fpicker/source/office/PlacesListBox.cxx2
-rw-r--r--fpicker/source/office/iodlg.cxx4
-rw-r--r--fpicker/source/office/iodlgimp.cxx2
-rw-r--r--framework/source/uielement/comboboxtoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/complextoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/dropdownboxtoolbarcontroller.cxx2
-rw-r--r--include/editeng/fhgtitem.hxx2
-rw-r--r--include/editeng/paperinf.hxx4
-rw-r--r--include/svtools/simptabl.hxx2
-rw-r--r--include/svtools/svtabbx.hxx4
-rw-r--r--include/svx/nbdtmg.hxx2
-rw-r--r--include/svx/svdetc.hxx6
-rw-r--r--include/svx/svdmodel.hxx16
-rw-r--r--include/svx/svdtrans.hxx6
-rw-r--r--include/tools/mapunit.hxx15
-rw-r--r--include/tools/rc.h5
-rw-r--r--include/vcl/gdimtf.hxx2
-rw-r--r--include/vcl/outdev.hxx4
-rw-r--r--include/vcl/pdfwriter.hxx2
-rw-r--r--lotuswordpro/source/filter/lwppagelayout.cxx2
-rw-r--r--oox/source/drawingml/shape.cxx2
-rw-r--r--oox/source/export/drawingml.cxx4
-rw-r--r--oox/source/export/shapes.cxx4
-rw-r--r--oox/source/helper/graphichelper.cxx2
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx4
-rw-r--r--reportdesign/source/ui/dlg/Condition.cxx2
-rw-r--r--reportdesign/source/ui/dlg/DateTime.cxx4
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx2
-rw-r--r--reportdesign/source/ui/dlg/Navigator.cxx2
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx6
-rw-r--r--reportdesign/source/ui/report/DesignView.cxx4
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx4
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx2
-rw-r--r--reportdesign/source/ui/report/ReportWindow.cxx8
-rw-r--r--reportdesign/source/ui/report/ScrollHelper.cxx6
-rw-r--r--reportdesign/source/ui/report/SectionWindow.cxx2
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx2
-rw-r--r--rsc/inc/rscdb.hxx2
-rw-r--r--rsc/source/parser/rscibas.cxx27
-rw-r--r--sc/source/core/data/column2.cxx2
-rw-r--r--sc/source/core/data/docpool.cxx4
-rw-r--r--sc/source/core/data/documen2.cxx4
-rw-r--r--sc/source/core/data/documen8.cxx8
-rw-r--r--sc/source/core/data/documen9.cxx2
-rw-r--r--sc/source/core/data/drwlayer.cxx8
-rw-r--r--sc/source/core/data/global.cxx6
-rw-r--r--sc/source/core/data/patattr.cxx4
-rw-r--r--sc/source/core/data/poolhelp.cxx4
-rw-r--r--sc/source/core/data/table1.cxx2
-rw-r--r--sc/source/core/tool/editutil.cxx4
-rw-r--r--sc/source/core/tool/interpr1.cxx2
-rw-r--r--sc/source/filter/excel/xechart.cxx2
-rw-r--r--sc/source/filter/excel/xeescher.cxx6
-rw-r--r--sc/source/filter/excel/xiescher.cxx6
-rw-r--r--sc/source/filter/excel/xlescher.cxx10
-rw-r--r--sc/source/filter/excel/xlroot.cxx6
-rw-r--r--sc/source/filter/html/htmlexp.cxx4
-rw-r--r--sc/source/filter/html/htmlimp.cxx4
-rw-r--r--sc/source/filter/html/htmlpars.cxx2
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx2
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx4
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx6
-rw-r--r--sc/source/filter/rtf/rtfparse.cxx2
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx8
-rw-r--r--sc/source/ui/app/client.cxx2
-rw-r--r--sc/source/ui/app/inputhdl.cxx4
-rw-r--r--sc/source/ui/app/inputwin.cxx4
-rw-r--r--sc/source/ui/app/msgpool.cxx4
-rw-r--r--sc/source/ui/app/transobj.cxx4
-rw-r--r--sc/source/ui/cctrl/cbuttonw.cxx2
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx2
-rw-r--r--sc/source/ui/condformat/condformatdlg.cxx2
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx2
-rw-r--r--sc/source/ui/condformat/condformatmgr.cxx4
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx2
-rw-r--r--sc/source/ui/dbgui/csvtablebox.cxx2
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx2
-rw-r--r--sc/source/ui/dbgui/validate.cxx2
-rw-r--r--sc/source/ui/dialogs/searchresults.cxx2
-rw-r--r--sc/source/ui/docshell/docsh3.cxx6
-rw-r--r--sc/source/ui/docshell/docsh6.cxx2
-rw-r--r--sc/source/ui/docshell/sizedev.cxx4
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx8
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx10
-rw-r--r--sc/source/ui/drawfunc/futext2.cxx2
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx2
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/sharedocdlg.cxx2
-rw-r--r--sc/source/ui/namedlg/namemgrtable.cxx8
-rw-r--r--sc/source/ui/namedlg/namepast.cxx2
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx2
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx2
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.cxx4
-rw-r--r--sc/source/ui/undo/undostyl.cxx2
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx2
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx8
-rw-r--r--sc/source/ui/unoobj/textuno.cxx6
-rw-r--r--sc/source/ui/view/drawutil.cxx2
-rw-r--r--sc/source/ui/view/drawvie4.cxx8
-rw-r--r--sc/source/ui/view/drawview.cxx6
-rw-r--r--sc/source/ui/view/gridmerg.cxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx10
-rw-r--r--sc/source/ui/view/gridwin4.cxx26
-rw-r--r--sc/source/ui/view/gridwin_dbgutil.cxx4
-rw-r--r--sc/source/ui/view/hintwin.cxx4
-rw-r--r--sc/source/ui/view/notemark.cxx4
-rw-r--r--sc/source/ui/view/output.cxx2
-rw-r--r--sc/source/ui/view/output3.cxx6
-rw-r--r--sc/source/ui/view/preview.cxx20
-rw-r--r--sc/source/ui/view/printfun.cxx26
-rw-r--r--sc/source/ui/view/tabview.cxx2
-rw-r--r--sc/source/ui/view/tabview3.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx4
-rw-r--r--sc/source/ui/view/tabvwshb.cxx4
-rw-r--r--sc/source/ui/view/viewdata.cxx6
-rw-r--r--sc/source/ui/view/viewfun7.cxx10
-rw-r--r--sc/source/ui/view/viewfunc.cxx4
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx2
-rw-r--r--sd/source/core/drawdoc.cxx4
-rw-r--r--sd/source/core/drawdoc2.cxx8
-rw-r--r--sd/source/core/sdpage.cxx2
-rw-r--r--sd/source/filter/eppt/eppt.cxx4
-rw-r--r--sd/source/filter/eppt/pptx-epptbase.cxx8
-rw-r--r--sd/source/filter/grf/sdgrffilter.cxx2
-rw-r--r--sd/source/filter/html/buttonset.cxx2
-rw-r--r--sd/source/filter/html/pubdlg.cxx2
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx4
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx2
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx2
-rw-r--r--sd/source/ui/app/sdmod.cxx2
-rw-r--r--sd/source/ui/app/sdmod2.cxx2
-rw-r--r--sd/source/ui/dlg/PaneDockingWindow.cxx2
-rw-r--r--sd/source/ui/dlg/RemoteDialogClientBox.cxx6
-rw-r--r--sd/source/ui/dlg/animobjs.cxx10
-rw-r--r--sd/source/ui/dlg/copydlg.cxx28
-rw-r--r--sd/source/ui/dlg/dlgsnap.cxx8
-rw-r--r--sd/source/ui/dlg/docprev.cxx2
-rw-r--r--sd/source/ui/dlg/headerfooterdlg.cxx2
-rw-r--r--sd/source/ui/dlg/sdpreslt.cxx2
-rw-r--r--sd/source/ui/dlg/vectdlg.cxx2
-rw-r--r--sd/source/ui/docshell/docshel2.cxx8
-rw-r--r--sd/source/ui/docshell/docshel4.cxx2
-rw-r--r--sd/source/ui/docshell/sdclient.cxx2
-rw-r--r--sd/source/ui/func/fuinsert.cxx28
-rw-r--r--sd/source/ui/presenter/PresenterHelper.cxx2
-rw-r--r--sd/source/ui/presenter/PresenterTextView.cxx8
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx2
-rw-r--r--sd/source/ui/slideshow/showwin.cxx10
-rw-r--r--sd/source/ui/slidesorter/controller/SlideSorterController.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlsTheme.cxx2
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx6
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx2
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx4
-rw-r--r--sd/source/ui/unoidl/unopage.cxx2
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx4
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx8
-rw-r--r--sd/source/ui/view/drviews8.cxx4
-rw-r--r--sd/source/ui/view/drviews9.cxx2
-rw-r--r--sd/source/ui/view/sdview.cxx8
-rw-r--r--sd/source/ui/view/sdview3.cxx20
-rw-r--r--sd/source/ui/view/sdview4.cxx10
-rw-r--r--sd/source/ui/view/sdwindow.cxx6
-rw-r--r--sfx2/source/appl/appuno.cxx8
-rw-r--r--sfx2/source/appl/newhelp.cxx12
-rw-r--r--sfx2/source/control/ctrlitem.cxx2
-rw-r--r--sfx2/source/control/dispatch.cxx2
-rw-r--r--sfx2/source/control/unoctitm.cxx8
-rw-r--r--sfx2/source/dialog/dialoghelper.cxx8
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx10
-rw-r--r--sfx2/source/dialog/mgetempl.cxx10
-rw-r--r--sfx2/source/dialog/versdlg.cxx6
-rw-r--r--sfx2/source/doc/graphhelp.cxx2
-rw-r--r--sfx2/source/doc/new.cxx4
-rw-r--r--sfx2/source/doc/objembed.cxx4
-rw-r--r--sfx2/source/doc/objxtor.cxx2
-rw-r--r--sfx2/source/doc/printhelper.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx6
-rw-r--r--sfx2/source/sidebar/SidebarChildWindow.cxx2
-rw-r--r--sfx2/source/view/classificationcontroller.cxx2
-rw-r--r--slideshow/source/engine/rehearsetimingsactivity.cxx4
-rw-r--r--starmath/source/ElementsDockingWindow.cxx6
-rw-r--r--starmath/source/accessibility.cxx2
-rw-r--r--starmath/source/dialog.cxx6
-rw-r--r--starmath/source/document.cxx28
-rw-r--r--starmath/source/edit.cxx2
-rw-r--r--starmath/source/tmpdevice.cxx4
-rw-r--r--starmath/source/unomodel.cxx2
-rw-r--r--starmath/source/view.cxx30
-rw-r--r--svl/source/inc/poolio.hxx2
-rw-r--r--svl/source/items/itempool.cxx2
-rw-r--r--svl/source/items/poolitem.cxx2
-rw-r--r--svtools/source/brwbox/brwbox2.cxx16
-rw-r--r--svtools/source/contnr/fileview.cxx8
-rw-r--r--svtools/source/contnr/simptabl.cxx2
-rw-r--r--svtools/source/contnr/svtabbx.cxx4
-rw-r--r--svtools/source/control/ctrlbox.cxx4
-rw-r--r--svtools/source/control/ctrltool.cxx2
-rw-r--r--svtools/source/control/roadmap.cxx8
-rw-r--r--svtools/source/control/ruler.cxx26
-rw-r--r--svtools/source/control/scrwin.cxx2
-rw-r--r--svtools/source/dialogs/roadmapwizard.cxx2
-rw-r--r--svtools/source/dialogs/wizardmachine.cxx10
-rw-r--r--svtools/source/dialogs/wizdlg.cxx2
-rw-r--r--svtools/source/filter/DocumentToGraphicRenderer.cxx2
-rw-r--r--svtools/source/filter/GraphicExportOptionsDialog.cxx4
-rw-r--r--svtools/source/filter/exportdialog.cxx50
-rw-r--r--svtools/source/graphic/descriptor.cxx4
-rw-r--r--svtools/source/graphic/grfmgr.cxx20
-rw-r--r--svtools/source/graphic/provider.cxx12
-rw-r--r--svtools/source/misc/embedhlp.cxx4
-rw-r--r--svtools/source/misc/embedtransfer.cxx4
-rw-r--r--svtools/source/misc/imap.cxx14
-rw-r--r--svtools/source/misc/imap2.cxx4
-rw-r--r--svtools/source/misc/transfer.cxx8
-rw-r--r--svtools/source/misc/unitconv.cxx96
-rw-r--r--svtools/source/table/tablecontrol_impl.cxx10
-rw-r--r--svtools/source/uno/svtxgridcontrol.cxx4
-rw-r--r--svtools/source/uno/wizard/wizardshell.cxx2
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx12
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx4
-rw-r--r--svx/source/dialog/_bmpmask.cxx4
-rw-r--r--svx/source/dialog/_contdlg.cxx12
-rw-r--r--svx/source/dialog/compressgraphicdialog.cxx6
-rw-r--r--svx/source/dialog/connctrl.cxx6
-rw-r--r--svx/source/dialog/contwnd.cxx2
-rw-r--r--svx/source/dialog/ctredlin.cxx2
-rw-r--r--svx/source/dialog/dialcontrol.cxx2
-rw-r--r--svx/source/dialog/dlgctl3d.cxx6
-rw-r--r--svx/source/dialog/dlgctrl.cxx8
-rw-r--r--svx/source/dialog/dlgunit.hxx2
-rw-r--r--svx/source/dialog/docrecovery.cxx2
-rw-r--r--svx/source/dialog/fntctrl.cxx8
-rw-r--r--svx/source/dialog/fontwork.cxx24
-rw-r--r--svx/source/dialog/frmsel.cxx2
-rw-r--r--svx/source/dialog/graphctl.cxx4
-rw-r--r--svx/source/dialog/hdft.cxx20
-rw-r--r--svx/source/dialog/imapwnd.cxx2
-rw-r--r--svx/source/dialog/measctrl.cxx2
-rw-r--r--svx/source/dialog/pagectrl.cxx4
-rw-r--r--svx/source/dialog/paraprev.cxx2
-rw-r--r--svx/source/dialog/rubydialog.cxx4
-rw-r--r--svx/source/dialog/srchdlg.cxx14
-rw-r--r--svx/source/dialog/swframeexample.cxx4
-rw-r--r--svx/source/engine3d/float3d.cxx4
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx8
-rw-r--r--svx/source/fmcomp/fmgridif.cxx10
-rw-r--r--svx/source/fmcomp/gridctrl.cxx4
-rw-r--r--svx/source/form/datanavi.cxx14
-rw-r--r--svx/source/form/filtnav.cxx6
-rw-r--r--svx/source/form/fmexpl.cxx6
-rw-r--r--svx/source/form/fmvwimp.cxx4
-rw-r--r--svx/source/gallery2/GalleryControl.cxx2
-rw-r--r--svx/source/gallery2/galbrws1.cxx2
-rw-r--r--svx/source/gallery2/galctrl.cxx2
-rw-r--r--svx/source/gallery2/galmisc.cxx2
-rw-r--r--svx/source/gallery2/galobj.cxx4
-rw-r--r--svx/source/gallery2/galtheme.cxx2
-rw-r--r--svx/source/items/grfitem.cxx8
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx12
-rw-r--r--svx/source/sdr/overlay/overlayobjectlist.cxx4
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx6
-rw-r--r--svx/source/sidebar/area/AreaTransparencyGradientControl.cxx40
-rw-r--r--svx/source/sidebar/line/LinePropertyPanelBase.cxx4
-rw-r--r--svx/source/sidebar/line/LineWidthPopup.cxx10
-rw-r--r--svx/source/sidebar/line/LineWidthValueSet.cxx2
-rw-r--r--svx/source/sidebar/nbdtmg.cxx6
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx6
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx40
-rw-r--r--svx/source/sidebar/paragraph/ParaSpacingWindow.cxx4
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx10
-rw-r--r--svx/source/sidebar/possize/SidebarDialControl.cxx2
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.cxx4
-rw-r--r--svx/source/svdraw/svddrgmt.cxx4
-rw-r--r--svx/source/svdraw/svdedxv.cxx2
-rw-r--r--svx/source/svdraw/svdibrow.cxx2
-rw-r--r--svx/source/svdraw/svdmodel.cxx28
-rw-r--r--svx/source/svdraw/svdmrkv.cxx8
-rw-r--r--svx/source/svdraw/svdoashp.cxx8
-rw-r--r--svx/source/svdraw/svdobj.cxx8
-rw-r--r--svx/source/svdraw/svdocapt.cxx4
-rw-r--r--svx/source/svdraw/svdograf.cxx8
-rw-r--r--svx/source/svdraw/svdomeas.cxx8
-rw-r--r--svx/source/svdraw/svdomedia.cxx2
-rw-r--r--svx/source/svdraw/svdoole2.cxx6
-rw-r--r--svx/source/svdraw/svdopath.cxx8
-rw-r--r--svx/source/svdraw/svdotext.cxx8
-rw-r--r--svx/source/svdraw/svdtrans.cxx84
-rw-r--r--svx/source/table/tablecontroller.cxx8
-rw-r--r--svx/source/table/tablertfexporter.cxx2
-rw-r--r--svx/source/table/tablertfimporter.cxx2
-rw-r--r--svx/source/tbxctrls/bulletsnumbering.cxx2
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx6
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx2
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx2
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx6
-rw-r--r--svx/source/tbxctrls/itemwin.cxx14
-rw-r--r--svx/source/tbxctrls/layctrl.cxx2
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx2
-rw-r--r--svx/source/tbxctrls/linectrl.cxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx6
-rw-r--r--svx/source/tbxctrls/tbunocontroller.cxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx4
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx6
-rw-r--r--svx/source/unodraw/unopool.cxx8
-rw-r--r--svx/source/unodraw/unoprov.cxx44
-rw-r--r--svx/source/unodraw/unoshap4.cxx4
-rw-r--r--svx/source/unodraw/unoshape.cxx24
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx4
-rw-r--r--svx/source/xoutdev/xattr.cxx2
-rw-r--r--svx/source/xoutdev/xtabdash.cxx2
-rw-r--r--svx/source/xoutdev/xtabhtch.cxx2
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx2
-rw-r--r--sw/source/core/access/accmap.cxx12
-rw-r--r--sw/source/core/bastyp/swtypes.cxx4
-rw-r--r--sw/source/core/crsr/crstrvl.cxx2
-rw-r--r--sw/source/core/doc/DocumentDeviceManager.cxx4
-rw-r--r--sw/source/core/doc/fmtcol.cxx2
-rw-r--r--sw/source/core/docnode/ndnotxt.cxx18
-rw-r--r--sw/source/core/draw/dflyobj.cxx4
-rw-r--r--sw/source/core/draw/dpage.cxx2
-rw-r--r--sw/source/core/draw/drawdoc.cxx2
-rw-r--r--sw/source/core/frmedt/fecopy.cxx2
-rw-r--r--sw/source/core/frmedt/fefly1.cxx6
-rw-r--r--sw/source/core/layout/atrfrm.cxx8
-rw-r--r--sw/source/core/layout/fly.cxx6
-rw-r--r--sw/source/core/ole/ndole.cxx6
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx2
-rw-r--r--sw/source/core/text/itratr.cxx4
-rw-r--r--sw/source/core/text/noteurl.cxx2
-rw-r--r--sw/source/core/text/porrst.cxx2
-rw-r--r--sw/source/core/text/txtdrop.cxx4
-rw-r--r--sw/source/core/txtnode/fntcache.cxx2
-rw-r--r--sw/source/core/unocore/unoframe.cxx10
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx2
-rw-r--r--sw/source/core/unocore/unostyle.cxx8
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx2
-rw-r--r--sw/source/core/view/viewpg.cxx2
-rw-r--r--sw/source/core/view/viewsh.cxx2
-rw-r--r--sw/source/core/view/vprint.cxx2
-rw-r--r--sw/source/filter/html/css1atr.cxx2
-rw-r--r--sw/source/filter/html/htmlatr.cxx2
-rw-r--r--sw/source/filter/html/htmldrawreader.cxx4
-rw-r--r--sw/source/filter/html/htmldrawwriter.cxx4
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx16
-rw-r--r--sw/source/filter/html/htmlform.cxx8
-rw-r--r--sw/source/filter/html/htmlforw.cxx2
-rw-r--r--sw/source/filter/html/htmlgrin.cxx2
-rw-r--r--sw/source/filter/html/htmlnumreader.cxx2
-rw-r--r--sw/source/filter/html/htmlplug.cxx4
-rw-r--r--sw/source/filter/html/htmlsect.cxx4
-rw-r--r--sw/source/filter/html/htmltab.cxx4
-rw-r--r--sw/source/filter/html/htmltabw.cxx10
-rw-r--r--sw/source/filter/html/svxcss1.cxx2
-rw-r--r--sw/source/filter/html/swhtml.cxx6
-rw-r--r--sw/source/filter/html/wrthtml.cxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx4
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx16
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx10
-rw-r--r--sw/source/filter/xml/xmlexp.cxx2
-rw-r--r--sw/source/filter/xml/xmlimp.cxx4
-rw-r--r--sw/source/filter/xml/xmltexte.cxx2
-rw-r--r--sw/source/filter/xml/xmltexti.cxx10
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx2
-rw-r--r--sw/source/ui/config/optload.cxx2
-rw-r--r--sw/source/ui/config/optpage.cxx36
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx4
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx16
-rw-r--r--sw/source/ui/dbui/dbtablepreviewdialog.cxx2
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx12
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx2
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.cxx4
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx2
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx4
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx4
-rw-r--r--sw/source/ui/envelp/envfmt.cxx4
-rw-r--r--sw/source/ui/envelp/envlop1.cxx4
-rw-r--r--sw/source/ui/envelp/labfmt.cxx4
-rw-r--r--sw/source/ui/fldui/flddb.cxx2
-rw-r--r--sw/source/ui/fldui/flddinf.cxx2
-rw-r--r--sw/source/ui/fldui/flddok.cxx2
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx2
-rw-r--r--sw/source/ui/fldui/fldref.cxx2
-rw-r--r--sw/source/ui/fldui/fldvar.cxx2
-rw-r--r--sw/source/ui/frmdlg/column.cxx4
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx2
-rw-r--r--sw/source/ui/index/cnttab.cxx8
-rw-r--r--sw/source/ui/misc/bookmark.cxx2
-rw-r--r--sw/source/ui/misc/glosbib.cxx2
-rw-r--r--sw/source/ui/misc/glossary.cxx2
-rw-r--r--sw/source/ui/misc/pgfnote.cxx6
-rw-r--r--sw/source/uibase/app/appenv.cxx2
-rw-r--r--sw/source/uibase/app/docshini.cxx4
-rw-r--r--sw/source/uibase/dbui/dbtree.cxx2
-rw-r--r--sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx2
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx14
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx2
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx2
-rw-r--r--sw/source/uibase/docvw/SidebarScrollBar.cxx2
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx2
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx2
-rw-r--r--sw/source/uibase/docvw/srcedtw.cxx2
-rw-r--r--sw/source/uibase/frmdlg/colex.cxx4
-rw-r--r--sw/source/uibase/lingu/sdrhhcwrap.cxx2
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx2
-rw-r--r--sw/source/uibase/shells/grfshex.cxx4
-rw-r--r--sw/source/uibase/shells/textsh.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageFormatPanel.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.cxx4
-rw-r--r--sw/source/uibase/table/chartins.cxx2
-rw-r--r--sw/source/uibase/uiview/pview.cxx2
-rw-r--r--sw/source/uibase/uiview/srcview.cxx4
-rw-r--r--sw/source/uibase/uiview/swcli.cxx2
-rw-r--r--sw/source/uibase/uiview/view2.cxx2
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx4
-rw-r--r--sw/source/uibase/uiview/viewmdi.cxx2
-rw-r--r--sw/source/uibase/uiview/viewport.cxx2
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx4
-rw-r--r--sw/source/uibase/utlui/attrdesc.cxx2
-rw-r--r--sw/source/uibase/utlui/shdwcrsr.cxx2
-rw-r--r--sw/source/uibase/utlui/unotools.cxx2
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx8
-rw-r--r--toolkit/source/awt/vclxcontainer.cxx2
-rw-r--r--toolkit/source/awt/vclxdevice.cxx2
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx2
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx6
-rw-r--r--toolkit/source/controls/tabpagemodel.cxx6
-rw-r--r--toolkit/source/helper/vclunohelper.cxx72
-rw-r--r--uui/source/fltdlg.cxx2
-rw-r--r--vcl/README.GDIMetaFile2
-rw-r--r--vcl/osx/salprn.cxx2
-rw-r--r--vcl/qa/cppunit/mapmode.cxx50
-rw-r--r--vcl/source/app/settings.cxx2
-rw-r--r--vcl/source/app/svapp.cxx2
-rw-r--r--vcl/source/control/button.cxx10
-rw-r--r--vcl/source/control/field.cxx36
-rw-r--r--vcl/source/control/morebtn.cxx2
-rw-r--r--vcl/source/control/scrbar.cxx8
-rw-r--r--vcl/source/control/tabctrl.cxx2
-rw-r--r--vcl/source/filter/graphicfilter.cxx16
-rw-r--r--vcl/source/filter/graphicfilter2.cxx12
-rw-r--r--vcl/source/filter/igif/gifread.cxx2
-rw-r--r--vcl/source/filter/jpeg/JpegReader.cxx6
-rw-r--r--vcl/source/filter/sgfbram.cxx2
-rw-r--r--vcl/source/filter/sgvmain.cxx2
-rw-r--r--vcl/source/filter/sgvtext.cxx2
-rw-r--r--vcl/source/filter/wmf/emfwr.cxx4
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx8
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx4
-rw-r--r--vcl/source/filter/wmf/wmfwr.cxx6
-rw-r--r--vcl/source/gdi/bitmap.cxx4
-rw-r--r--vcl/source/gdi/bitmap3.cxx2
-rw-r--r--vcl/source/gdi/dibtools.cxx6
-rw-r--r--vcl/source/gdi/gdimetafiletools.cxx6
-rw-r--r--vcl/source/gdi/gdimtf.cxx4
-rw-r--r--vcl/source/gdi/graph.cxx2
-rw-r--r--vcl/source/gdi/impgraph.cxx4
-rw-r--r--vcl/source/gdi/impvect.cxx2
-rw-r--r--vcl/source/gdi/mapmod.cxx30
-rw-r--r--vcl/source/gdi/oldprintadaptor.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx22
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx4
-rw-r--r--vcl/source/gdi/pngread.cxx6
-rw-r--r--vcl/source/gdi/pngwrite.cxx2
-rw-r--r--vcl/source/gdi/print.cxx6
-rw-r--r--vcl/source/gdi/print2.cxx2
-rw-r--r--vcl/source/gdi/print3.cxx26
-rw-r--r--vcl/source/gdi/svgdata.cxx2
-rw-r--r--vcl/source/gdi/svmconverter.cxx2
-rw-r--r--vcl/source/gdi/textlayout.cxx8
-rw-r--r--vcl/source/outdev/bitmap.cxx6
-rw-r--r--vcl/source/outdev/font.cxx2
-rw-r--r--vcl/source/outdev/map.cxx92
-rw-r--r--vcl/source/outdev/text.cxx2
-rw-r--r--vcl/source/window/decoview.cxx2
-rw-r--r--vcl/source/window/dockwin.cxx2
-rw-r--r--vcl/source/window/menubarwindow.cxx2
-rw-r--r--vcl/source/window/paint.cxx6
-rw-r--r--vcl/source/window/printdlg.cxx28
-rw-r--r--vcl/source/window/resource.cxx4
-rw-r--r--vcl/source/window/window.cxx2
-rw-r--r--vcl/source/window/window2.cxx4
-rw-r--r--vcl/unx/generic/print/genprnpsp.cxx2
-rw-r--r--vcl/workben/svptest.cxx2
-rw-r--r--writerfilter/source/dmapper/SdtHelper.cxx2
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx4
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx2
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx2
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx2
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.cxx2
648 files changed, 2090 insertions, 2080 deletions
diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
index b4f8ac0971ca..05e16b6e3d17 100644
--- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx
+++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
@@ -146,7 +146,7 @@ awt::Rectangle AccessibleDialogControlShape::GetBounds()
aRect.Move( aOrg.X(), aOrg.Y() );
// convert logic units to pixel
- aRect = m_pDialogWindow->LogicToPixel( aRect, MapMode(MAP_100TH_MM) );
+ aRect = m_pDialogWindow->LogicToPixel( aRect, MapMode(MapUnit::Map100thMM) );
// clip the shape's bounding box with the bounding box of its parent
Rectangle aParentRect( Point( 0, 0 ), m_pDialogWindow->GetSizePixel() );
diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx
index 830d885373b7..653625857043 100644
--- a/basctl/source/accessibility/accessibledialogwindow.cxx
+++ b/basctl/source/accessibility/accessibledialogwindow.cxx
@@ -222,7 +222,7 @@ bool AccessibleDialogWindow::IsChildVisible( const ChildDescriptor& rDesc )
aRect.Move( aOrg.X(), aOrg.Y() );
// convert logic units to pixel
- aRect = m_pDialogWindow->LogicToPixel( aRect, MapMode(MAP_100TH_MM) );
+ aRect = m_pDialogWindow->LogicToPixel( aRect, MapMode(MapUnit::Map100thMM) );
// check, if the shape's bounding box intersects with the bounding box of its parent
Rectangle aParentRect( Point( 0, 0 ), m_pDialogWindow->GetSizePixel() );
diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx
index d30171c78a6e..4e5a9675b2c3 100644
--- a/basctl/source/basicide/basicrenderable.cxx
+++ b/basctl/source/basicide/basicrenderable.cxx
@@ -128,7 +128,7 @@ Sequence<beans::PropertyValue> SAL_CALL Renderable::getRenderer (
// no renderdevice is legal; the first call is to get our print ui options
if( pPrinter )
{
- Size aPageSize( pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
+ Size aPageSize( pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), MapMode( MapUnit::Map100thMM ) ) );
awt::Size aSize;
aSize.Width = aPageSize.Width();
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index c994910dbd9c..11872eb4e3f6 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -804,7 +804,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
aFont.SetTransparent( true );
aFont.SetFontSize( Size( 0, 360 ) );
pPrinter->SetFont( aFont );
- pPrinter->SetMapMode( MAP_100TH_MM );
+ pPrinter->SetMapMode( MapUnit::Map100thMM );
OUString aTitle( CreateQualifiedName() );
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 9b8eb6fc53e6..57f04b0f1492 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1617,7 +1617,7 @@ WatchWindow::WatchWindow (Layout* pParent) :
tabs[ 1 ] = 0;
tabs[ 2 ] = nVarTabWidth;
tabs[ 3 ] = nVarTabWidth + nValueTabWidth;
- aTreeListBox->SvHeaderTabListBox::SetTabs( tabs, MAP_PIXEL );
+ aTreeListBox->SvHeaderTabListBox::SetTabs( tabs, MapUnit::MapPixel );
aTreeListBox->InitHeaderBar( aHeaderBar.get() );
aTreeListBox->SetNodeDefaultImages( );
@@ -1802,7 +1802,7 @@ IMPL_LINK_NOARG( WatchWindow, implEndDragHdl, HeaderBar *, void )
for( sal_uInt16 i = 1 ; i < nTabs ; ++i )
{
nPos += aHeaderBar->GetItemSize( i );
- aTreeListBox->SetTab( i, nPos, MAP_PIXEL );
+ aTreeListBox->SetTab( i, nPos, MapUnit::MapPixel );
}
}
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index b4933cdb1c56..1b661a8c9d7d 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -483,7 +483,7 @@ LibPage::LibPage(vcl::Window * pParent)
{
get(m_pBasicsBox, "location");
get(m_pLibBox, "library");
- Size aSize(m_pLibBox->LogicToPixel(Size(130, 87), MAP_APPFONT));
+ Size aSize(m_pLibBox->LogicToPixel(Size(130, 87), MapUnit::MapAppFont));
m_pLibBox->set_height_request(aSize.Height());
m_pLibBox->set_width_request(aSize.Width());
get(m_pEditButton, "edit");
@@ -510,7 +510,7 @@ LibPage::LibPage(vcl::Window * pParent)
m_pLibBox->SetStyle( WB_HSCROLL | WB_BORDER | WB_TABSTOP );
long aTabs[] = { 2, 30, 120 };
- m_pLibBox->SetTabs( aTabs, MAP_PIXEL );
+ m_pLibBox->SetTabs( aTabs, MapUnit::MapPixel );
FillListBox();
m_pBasicsBox->SelectEntryPos( 0 );
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 5a7ce994f70c..386069ed73e0 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -553,7 +553,7 @@ ObjectPage::ObjectPage(vcl::Window *pParent, const OString &rName, sal_uInt16 nM
".ui")
{
get(m_pBasicBox, "library");
- Size aSize(m_pBasicBox->LogicToPixel(Size(130, 117), MAP_APPFONT));
+ Size aSize(m_pBasicBox->LogicToPixel(Size(130, 117), MapUnit::MapAppFont));
m_pBasicBox->set_height_request(aSize.Height());
m_pBasicBox->set_width_request(aSize.Width());
get(m_pEditButton, "edit");
diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index 2371c3facad3..240b7e15212f 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -112,15 +112,15 @@ void ObjectCatalog::ArrangeWindows()
aTitle->Hide();
else
{
- Size aTitleSize = LogicToPixel(Size(3, 10), MAP_APPFONT);
+ Size aTitleSize = LogicToPixel(Size(3, 10), MapUnit::MapAppFont);
aTitleSize.Width() = aSize.Width() - 2*aTitleSize.Width();
- aTitle->SetPosPixel(LogicToPixel(Point(3, 3), MAP_APPFONT));
+ aTitle->SetPosPixel(LogicToPixel(Point(3, 3), MapUnit::MapAppFont));
aTitle->SetSizePixel(aTitleSize);
aTitle->Show();
}
// tree
- Point const aTreePos = LogicToPixel(Point(3, bFloating ? 3 : 16), MAP_APPFONT);
+ Point const aTreePos = LogicToPixel(Point(3, bFloating ? 3 : 16), MapUnit::MapAppFont);
long const nMargin = aTreePos.X();
Size const aTreeSize(
aSize.Width() - 2*nMargin,
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 363f043465b9..09fb33607a25 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -200,7 +200,7 @@ DlgEditor::DlgEditor (
{
pDlgEdModel->GetItemPool().FreezeIdRanges();
pDlgEdView.reset(new DlgEdView(*pDlgEdModel, rWindow_, *this));
- pDlgEdModel->SetScaleUnit( MAP_100TH_MM );
+ pDlgEdModel->SetScaleUnit( MapUnit::Map100thMM );
SdrLayerAdmin& rAdmin = pDlgEdModel->GetLayerAdmin();
rAdmin.NewLayer( rAdmin.GetControlLayerName() );
@@ -221,7 +221,7 @@ DlgEditor::DlgEditor (
aMarkIdle.SetPriority(SchedulerPriority::LOW);
aMarkIdle.SetIdleHdl( LINK( this, DlgEditor, MarkTimeout ) );
- rWindow.SetMapMode( MapMode( MAP_100TH_MM ) );
+ rWindow.SetMapMode( MapMode( MapUnit::Map100thMM ) );
pDlgEdPage->SetSize( rWindow.PixelToLogic( Size(DLGED_PAGE_WIDTH_MIN, DLGED_PAGE_HEIGHT_MIN) ) );
pDlgEdView->ShowSdrPage(pDlgEdView->GetModel()->GetPage(0));
@@ -1150,7 +1150,7 @@ void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not wor
MapMode aOldMap( pPrinter->GetMapMode());
vcl::Font aOldFont( pPrinter->GetFont() );
- MapMode aMap( MAP_100TH_MM );
+ MapMode aMap( MapUnit::Map100thMM );
pPrinter->SetMapMode( aMap );
vcl::Font aFont;
aFont.SetAlignment( ALIGN_BOTTOM );
@@ -1215,13 +1215,13 @@ bool DlgEditor::AdjustPageSize()
if ( pDlgEdForm && pDlgEdForm->TransformFormToSdrCoordinates( nFormXIn, nFormYIn, nFormWidthIn, nFormHeightIn, nFormX, nFormY, nFormWidth, nFormHeight ) )
{
Size aPageSizeDelta( 400, 300 );
- aPageSizeDelta = rWindow.PixelToLogic( aPageSizeDelta, MapMode( MAP_100TH_MM ) );
+ aPageSizeDelta = rWindow.PixelToLogic( aPageSizeDelta, MapMode( MapUnit::Map100thMM ) );
sal_Int32 nNewPageWidth = nFormX + nFormWidth + aPageSizeDelta.Width();
sal_Int32 nNewPageHeight = nFormY + nFormHeight + aPageSizeDelta.Height();
Size aPageSizeMin( DLGED_PAGE_WIDTH_MIN, DLGED_PAGE_HEIGHT_MIN );
- aPageSizeMin = rWindow.PixelToLogic( aPageSizeMin, MapMode( MAP_100TH_MM ) );
+ aPageSizeMin = rWindow.PixelToLogic( aPageSizeMin, MapMode( MapUnit::Map100thMM ) );
sal_Int32 nPageWidthMin = aPageSizeMin.Width();
sal_Int32 nPageHeightMin = aPageSizeMin.Height();
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index 0f8edbe22d6f..e57f329e88d4 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -137,9 +137,9 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
DBG_ASSERT( pDevice, "DlgEdObj::TransformSdrToControlCoordinates: missing default device!" );
if ( !pDevice )
return false;
- aPos = pDevice->LogicToPixel( aPos, MapMode( MAP_100TH_MM ) );
- aSize = pDevice->LogicToPixel( aSize, MapMode( MAP_100TH_MM ) );
- aFormPos = pDevice->LogicToPixel( aFormPos, MapMode( MAP_100TH_MM ) );
+ aPos = pDevice->LogicToPixel( aPos, MapMode( MapUnit::Map100thMM ) );
+ aSize = pDevice->LogicToPixel( aSize, MapMode( MapUnit::Map100thMM ) );
+ aFormPos = pDevice->LogicToPixel( aFormPos, MapMode( MapUnit::Map100thMM ) );
// subtract form position
aPos.Width() -= aFormPos.Width();
@@ -160,8 +160,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
}
// convert pixel to logic units
- aPos = pDevice->PixelToLogic( aPos, MAP_APPFONT );
- aSize = pDevice->PixelToLogic( aSize, MAP_APPFONT );
+ aPos = pDevice->PixelToLogic( aPos, MapUnit::MapAppFont );
+ aSize = pDevice->PixelToLogic( aSize, MapUnit::MapAppFont );
// set out parameters
nXOut = aPos.Width();
@@ -185,8 +185,8 @@ bool DlgEdObj::TransformSdrToFormCoordinates(
DBG_ASSERT( pDevice, "DlgEdObj::TransformSdrToFormCoordinates: missing default device!" );
if ( !pDevice )
return false;
- aPos = pDevice->LogicToPixel( aPos, MapMode( MAP_100TH_MM ) );
- aSize = pDevice->LogicToPixel( aSize, MapMode( MAP_100TH_MM ) );
+ aPos = pDevice->LogicToPixel( aPos, MapMode( MapUnit::Map100thMM ) );
+ aSize = pDevice->LogicToPixel( aSize, MapMode( MapUnit::Map100thMM ) );
// take window borders into account
DlgEdForm* pForm = nullptr;
@@ -207,8 +207,8 @@ bool DlgEdObj::TransformSdrToFormCoordinates(
aSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
}
// convert pixel to logic units
- aPos = pDevice->PixelToLogic( aPos, MAP_APPFONT );
- aSize = pDevice->PixelToLogic( aSize, MAP_APPFONT );
+ aPos = pDevice->PixelToLogic( aPos, MapUnit::MapAppFont );
+ aSize = pDevice->PixelToLogic( aSize, MapUnit::MapAppFont );
// set out parameters
nXOut = aPos.Width();
@@ -248,9 +248,9 @@ bool DlgEdObj::TransformControlToSdrCoordinates(
DBG_ASSERT( pDevice, "DlgEdObj::TransformControlToSdrCoordinates: missing default device!" );
if ( !pDevice )
return false;
- aPos = pDevice->LogicToPixel( aPos, MAP_APPFONT );
- aSize = pDevice->LogicToPixel( aSize, MAP_APPFONT );
- aFormPos = pDevice->LogicToPixel( aFormPos, MAP_APPFONT );
+ aPos = pDevice->LogicToPixel( aPos, MapUnit::MapAppFont );
+ aSize = pDevice->LogicToPixel( aSize, MapUnit::MapAppFont );
+ aFormPos = pDevice->LogicToPixel( aFormPos, MapUnit::MapAppFont );
// add form position
aPos.Width() += aFormPos.Width();
@@ -267,8 +267,8 @@ bool DlgEdObj::TransformControlToSdrCoordinates(
}
// convert pixel to 100th_mm
- aPos = pDevice->PixelToLogic( aPos, MapMode( MAP_100TH_MM ) );
- aSize = pDevice->PixelToLogic( aSize, MapMode( MAP_100TH_MM ) );
+ aPos = pDevice->PixelToLogic( aPos, MapMode( MapUnit::Map100thMM ) );
+ aSize = pDevice->PixelToLogic( aSize, MapMode( MapUnit::Map100thMM ) );
// set out parameters
nXOut = aPos.Width();
@@ -298,8 +298,8 @@ bool DlgEdObj::TransformFormToSdrCoordinates(
if ( !lcl_getDlgEdForm( this, pForm ) )
return false;
- aPos = pDevice->LogicToPixel( aPos, MAP_APPFONT );
- aSize = pDevice->LogicToPixel( aSize, MAP_APPFONT );
+ aPos = pDevice->LogicToPixel( aPos, MapUnit::MapAppFont );
+ aSize = pDevice->LogicToPixel( aSize, MapUnit::MapAppFont );
// take window borders into account
Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY );
@@ -316,8 +316,8 @@ bool DlgEdObj::TransformFormToSdrCoordinates(
}
// convert pixel to 100th_mm
- aPos = pDevice->PixelToLogic( aPos, MapMode( MAP_100TH_MM ) );
- aSize = pDevice->PixelToLogic( aSize, MapMode( MAP_100TH_MM ) );
+ aPos = pDevice->PixelToLogic( aPos, MapMode( MapUnit::Map100thMM ) );
+ aSize = pDevice->PixelToLogic( aSize, MapMode( MapUnit::Map100thMM ) );
// set out parameters
nXOut = aPos.Width();
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index 4b89c6c4cf08..215c2a5a7835 100644
--- a/basic/source/runtime/inputbox.cxx
+++ b/basic/source/runtime/inputbox.cxx
@@ -58,7 +58,7 @@ SvRTLInputBox::SvRTLInputBox( vcl::Window* pParent, const OUString& rPrompt,
aEdit( VclPtr<Edit>::Create(this, WB_LEFT | WB_BORDER) ),
aOk( VclPtr<OKButton>::Create(this) ), aCancel( VclPtr<CancelButton>::Create(this) ), aPromptText( VclPtr<FixedText>::Create(this, WB_WORDBREAK) )
{
- SetMapMode( MapMode( MAP_APPFONT ) );
+ SetMapMode( MapMode( MapUnit::MapAppFont ) );
Size aDlgSizeApp( 280, 80 );
PositionDialog( nXTwips, nYTwips, aDlgSizeApp );
InitButtons( aDlgSizeApp );
@@ -104,7 +104,7 @@ void SvRTLInputBox::PositionDialog(long nXTwips, long nYTwips, const Size& rDlgS
if( nXTwips != -1 && nYTwips != -1 )
{
Point aDlgPosApp( nXTwips, nYTwips );
- SetPosPixel( LogicToPixel( aDlgPosApp, MAP_TWIP ) );
+ SetPosPixel( LogicToPixel( aDlgPosApp, MapUnit::MapTwip ) );
}
}
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index a56d6e33373d..a143257e722d 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -83,7 +83,7 @@ SbiInputDialog::SbiInputDialog( vcl::Window* pParent, const OUString& rPrompt )
SetText( rPrompt );
aOk->SetClickHdl( LINK( this, SbiInputDialog, Ok ) );
aCancel->SetClickHdl( LINK( this, SbiInputDialog, Cancel ) );
- SetMapMode( MapMode( MAP_APPFONT ) );
+ SetMapMode( MapMode( MapUnit::MapAppFont ) );
Point aPt = LogicToPixel( Point( 50, 50 ) );
Size aSz = LogicToPixel( Size( 145, 65 ) );
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index a60b16d1c79d..8a385c2a3d9b 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -747,7 +747,7 @@ RTLFUNC(TwipsPerPixelX)
sal_Int32 nResult = 0;
Size aSize( 100,0 );
- MapMode aMap( MAP_TWIP );
+ MapMode aMap( MapUnit::MapTwip );
OutputDevice* pDevice = Application::GetDefaultDevice();
if( pDevice )
{
@@ -764,7 +764,7 @@ RTLFUNC(TwipsPerPixelY)
sal_Int32 nResult = 0;
Size aSize( 0,100 );
- MapMode aMap( MAP_TWIP );
+ MapMode aMap( MapUnit::MapTwip );
OutputDevice* pDevice = Application::GetDefaultDevice();
if( pDevice )
{
@@ -1345,9 +1345,9 @@ static double GetDialogZoomFactor( bool bX, long nValue )
Size aRefSize( nValue, nValue );
Fraction aFracX( 1, 26 );
Fraction aFracY( 1, 24 );
- MapMode aMap( MAP_APPFONT, Point(), aFracX, aFracY );
+ MapMode aMap( MapUnit::MapAppFont, Point(), aFracX, aFracY );
Size aScaledSize = pDevice->LogicToPixel( aRefSize, aMap );
- aRefSize = pDevice->LogicToPixel( aRefSize, MapMode(MAP_TWIP) );
+ aRefSize = pDevice->LogicToPixel( aRefSize, MapMode(MapUnit::MapTwip) );
double nRef, nScaled;
if( bX )
diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx
index 5c2e6e071983..cd963d12301b 100644
--- a/basic/source/runtime/stdobj1.cxx
+++ b/basic/source/runtime/stdobj1.cxx
@@ -86,7 +86,7 @@ void SbStdPicture::PropWidth( SbxVariable* pVar, SbxArray*, bool bWrite )
Size aSize = aGraphic.GetPrefSize();
aSize = Application::GetAppWindow()->LogicToPixel( aSize, aGraphic.GetPrefMapMode() );
- aSize = Application::GetAppWindow()->PixelToLogic( aSize, MapMode( MAP_TWIP ) );
+ aSize = Application::GetAppWindow()->PixelToLogic( aSize, MapMode( MapUnit::MapTwip ) );
pVar->PutInteger( (sal_Int16)aSize.Width() );
}
@@ -101,7 +101,7 @@ void SbStdPicture::PropHeight( SbxVariable* pVar, SbxArray*, bool bWrite )
Size aSize = aGraphic.GetPrefSize();
aSize = Application::GetAppWindow()->LogicToPixel( aSize, aGraphic.GetPrefMapMode() );
- aSize = Application::GetAppWindow()->PixelToLogic( aSize, MapMode( MAP_TWIP ) );
+ aSize = Application::GetAppWindow()->PixelToLogic( aSize, MapMode( MapUnit::MapTwip ) );
pVar->PutInteger( (sal_Int16)aSize.Height() );
}
diff --git a/canvas/source/cairo/cairo_devicehelper.cxx b/canvas/source/cairo/cairo_devicehelper.cxx
index d2ea8416a149..eae148187671 100644
--- a/canvas/source/cairo/cairo_devicehelper.cxx
+++ b/canvas/source/cairo/cairo_devicehelper.cxx
@@ -104,7 +104,7 @@ namespace cairocanvas
{
// Map a one-by-one millimeter box to pixel
const MapMode aOldMapMode( mpRefDevice->GetMapMode() );
- mpRefDevice->SetMapMode( MapMode(MAP_MM) );
+ mpRefDevice->SetMapMode( MapMode(MapUnit::MapMM) );
const Size aPixelSize( mpRefDevice->LogicToPixel(Size(1,1)) );
mpRefDevice->SetMapMode( aOldMapMode );
@@ -118,7 +118,7 @@ namespace cairocanvas
// Map the pixel dimensions of the output window to millimeter
const MapMode aOldMapMode( mpRefDevice->GetMapMode() );
- mpRefDevice->SetMapMode( MapMode(MAP_MM) );
+ mpRefDevice->SetMapMode( MapMode(MapUnit::MapMM) );
const Size aLogSize( mpRefDevice->PixelToLogic(mpRefDevice->GetOutputSizePixel()) );
mpRefDevice->SetMapMode( aOldMapMode );
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx
index 0ccf5b7df17f..50bf7142e9a4 100644
--- a/canvas/source/opengl/ogl_spritedevicehelper.cxx
+++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx
@@ -160,7 +160,7 @@ namespace oglcanvas
// Map a one-by-one millimeter box to pixel
SystemChildWindow* pChildWindow = mxContext->getChildWindow();
const MapMode aOldMapMode( pChildWindow->GetMapMode() );
- pChildWindow->SetMapMode( MapMode(MAP_MM) );
+ pChildWindow->SetMapMode( MapMode(MapUnit::MapMM) );
const Size aPixelSize( pChildWindow->LogicToPixel(Size(1,1)) );
pChildWindow->SetMapMode( aOldMapMode );
@@ -175,7 +175,7 @@ namespace oglcanvas
// Map the pixel dimensions of the output window to millimeter
SystemChildWindow* pChildWindow = mxContext->getChildWindow();
const MapMode aOldMapMode( pChildWindow->GetMapMode() );
- pChildWindow->SetMapMode( MapMode(MAP_MM) );
+ pChildWindow->SetMapMode( MapMode(MapUnit::MapMM) );
const Size aLogSize( pChildWindow->PixelToLogic(pChildWindow->GetOutputSizePixel()) );
pChildWindow->SetMapMode( aOldMapMode );
diff --git a/canvas/source/vcl/devicehelper.cxx b/canvas/source/vcl/devicehelper.cxx
index 7447cef2f2ad..a278273bf048 100644
--- a/canvas/source/vcl/devicehelper.cxx
+++ b/canvas/source/vcl/devicehelper.cxx
@@ -54,7 +54,7 @@ namespace vclcanvas
// Map a one-by-one millimeter box to pixel
OutputDevice& rOutDev = mpOutDev->getOutDev();
const MapMode aOldMapMode( rOutDev.GetMapMode() );
- rOutDev.SetMapMode( MapMode(MAP_MM) );
+ rOutDev.SetMapMode( MapMode(MapUnit::MapMM) );
const Size aPixelSize( rOutDev.LogicToPixel(Size(1,1)) );
rOutDev.SetMapMode( aOldMapMode );
@@ -69,7 +69,7 @@ namespace vclcanvas
// Map the pixel dimensions of the output window to millimeter
OutputDevice& rOutDev = mpOutDev->getOutDev();
const MapMode aOldMapMode( rOutDev.GetMapMode() );
- rOutDev.SetMapMode( MapMode(MAP_MM) );
+ rOutDev.SetMapMode( MapMode(MapUnit::MapMM) );
const Size aLogSize( rOutDev.PixelToLogic(rOutDev.GetOutputSizePixel()) );
rOutDev.SetMapMode( aOldMapMode );
diff --git a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
index 30e2acc7051f..22dff81d646a 100644
--- a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
+++ b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
@@ -30,7 +30,7 @@ namespace chart
AccessibleViewForwarder::AccessibleViewForwarder( AccessibleChartView* pAccChartView, vcl::Window* pWindow )
:m_pAccChartView( pAccChartView )
,m_pWindow( pWindow )
- ,m_aMapMode( MAP_100TH_MM )
+ ,m_aMapMode( MapUnit::Map100thMM )
{
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
index c256754ddb13..7ccda8441db3 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
@@ -409,7 +409,7 @@ void lcl_correctSymbolSizeForBitmaps( chart2::Symbol& rSymbol )
if( (xProp->getPropertyValue( "SizePixel" ) >>= aAWTPixelSize) )
{
Size aPixelSize(aAWTPixelSize.Width,aAWTPixelSize.Height);
- Size aNewSize = ( OutputDevice::LogicToLogic( aPixelSize, MAP_PIXEL, MAP_100TH_MM ));
+ Size aNewSize = ( OutputDevice::LogicToLogic( aPixelSize, MapUnit::MapPixel, MapUnit::Map100thMM ));
aSize = awt::Size( aNewSize.Width(), aNewSize.Height() );
if( aSize.Width == 0 && aSize.Height == 0 )
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 79b214efd9a7..b6c7df5ae441 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -244,29 +244,29 @@ void SeriesHeader::SetPos( const Point & rPos )
// chart type symbol
Size aSize( nSymbolHeight, nSymbolHeight );
- aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT );
+ aSize = m_pDevice->LogicToPixel( aSize, MapUnit::MapAppFont );
m_spSymbol->set_width_request(aSize.Width());
m_spSymbol->set_height_request(aSize.Height());
// series name edit field
aSize.setWidth(nSymbolDistance);
- aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT );
+ aSize = m_pDevice->LogicToPixel( aSize, MapUnit::MapAppFont );
m_spSeriesName->set_margin_left(aSize.Width() + 2);
aSize.setWidth( m_nWidth - nSymbolHeight - nSymbolDistance );
sal_Int32 nHeight = 12;
aSize.setHeight( nHeight );
- aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT );
+ aSize = m_pDevice->LogicToPixel( aSize, MapUnit::MapAppFont );
m_spSeriesName->set_width_request(aSize.Width());
m_spSeriesName->set_height_request(aSize.Height());
// color bar
aSize.setWidth(1);
- aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT );
+ aSize = m_pDevice->LogicToPixel( aSize, MapUnit::MapAppFont );
m_spColorBar->set_margin_left(aSize.Width() + 2);
nHeight = 3;
aSize.setWidth( m_nWidth - 1 );
aSize.setHeight( nHeight );
- aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT );
+ aSize = m_pDevice->LogicToPixel( aSize, MapUnit::MapAppFont );
m_spColorBar->set_width_request(aSize.Width());
m_spColorBar->set_height_request(aSize.Height());
}
@@ -279,7 +279,7 @@ void SeriesHeader::SetWidth( sal_Int32 nWidth )
void SeriesHeader::SetPixelWidth( sal_Int32 nWidth )
{
- SetWidth( m_pDevice->PixelToLogic( Size( nWidth, 0 ), MAP_APPFONT ).getWidth());
+ SetWidth( m_pDevice->PixelToLogic( Size( nWidth, 0 ), MapUnit::MapAppFont ).getWidth());
}
void SeriesHeader::SetChartType(
@@ -555,7 +555,7 @@ void DataBrowser::RenewTable()
OUString aDefaultSeriesName(SCH_RESSTR(STR_COLUMN_LABEL));
replaceParamterInString( aDefaultSeriesName, "%COLUMNNUMBER", OUString::number( 24 ) );
sal_Int32 nColumnWidth = GetDataWindow().GetTextWidth( aDefaultSeriesName )
- + GetDataWindow().LogicToPixel( Point( 4 + impl::SeriesHeader::GetRelativeAppFontXPosForNameField(), 0 ), MAP_APPFONT ).X();
+ + GetDataWindow().LogicToPixel( Point( 4 + impl::SeriesHeader::GetRelativeAppFontXPosForNameField(), 0 ), MapUnit::MapAppFont ).X();
sal_Int32 nColumnCount = m_apDataBrowserModel->getColumnCount();
// nRowCount is a member of a base class
sal_Int32 nRowCountLocal = m_apDataBrowserModel->getMaxRowCount();
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
index 268cf58145c3..21f6e28d6726 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
@@ -68,8 +68,8 @@ CreationWizard::CreationWizard( vcl::Window* pParent, const uno::Reference< fram
);
this->SetRoadmapHelpId( HID_SCH_WIZARD_ROADMAP );
this->SetRoadmapInteractive( true );
- Size aAdditionalRoadmapSize( LogicToPixel( Size( 85, 0 ), MAP_APPFONT ) );
- Size aSize(LogicToPixel(Size(CHART_WIZARD_PAGEWIDTH, CHART_WIZARD_PAGEHEIGHT), MAP_APPFONT));
+ Size aAdditionalRoadmapSize( LogicToPixel( Size( 85, 0 ), MapUnit::MapAppFont ) );
+ Size aSize(LogicToPixel(Size(CHART_WIZARD_PAGEWIDTH, CHART_WIZARD_PAGEHEIGHT), MapUnit::MapAppFont));
aSize.Width() += aAdditionalRoadmapSize.Width();
this->SetSizePixel( aSize );
diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx
index 36af3ffcb78d..15971efc442e 100644
--- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx
@@ -52,7 +52,7 @@ DataEditor::DataEditor(vcl::Window* pParent,
m_xBrwData->set_hexpand(true);
m_xBrwData->set_vexpand(true);
m_xBrwData->set_expand(true);
- Size aSize(m_xBrwData->LogicToPixel(Size(232, 121), MAP_APPFONT));
+ Size aSize(m_xBrwData->LogicToPixel(Size(232, 121), MapUnit::MapAppFont));
m_xBrwData->set_width_request(aSize.Width());
m_xBrwData->set_height_request(aSize.Height());
m_xBrwData->Show();
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 777297cb45c0..99447ea1ff61 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -700,7 +700,7 @@ ChartTypeTabPage::ChartTypeTabPage(vcl::Window* pParent
get(m_pFT_ChooseType, "FT_CAPTION_FOR_WIZARD");
get(m_pMainTypeList, "charttype");
get(m_pSubTypeList, "subtype");
- Size aSize(m_pSubTypeList->LogicToPixel(Size(150, 50), MAP_APPFONT));
+ Size aSize(m_pSubTypeList->LogicToPixel(Size(150, 50), MapUnit::MapAppFont));
m_pSubTypeList->set_width_request(aSize.Width());
m_pSubTypeList->set_height_request(aSize.Height());
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
index 2a6e4097cf9c..9ff91385bc97 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -143,7 +143,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
SdrObject* pObj = pSymbolList->GetObj(nStandardSymbol);
ScopedVclPtrInstance< VirtualDevice > pVDev;
- pVDev->SetMapMode(MapMode(MAP_100TH_MM));
+ pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
SdrModel* pModel = new SdrModel();
pModel->GetItemPool().FreezeIdRanges();
SdrPage* pPage = new SdrPage( *pModel, false );
@@ -164,7 +164,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
Graphic aGraph(aMeta);
Size aSize = pObj->GetSnapRect().GetSize();
aGraph.SetPrefSize(aSize);
- aGraph.SetPrefMapMode(MAP_100TH_MM);
+ aGraph.SetPrefMapMode(MapUnit::Map100thMM);
pView->UnmarkAll();
pObj=pPage->RemoveObject(0);
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index e55196f86521..b1daf046eaee 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -229,7 +229,7 @@ void SAL_CALL ChartController::setPosSize(
if(xWindow.is() && m_pChartWindow)
{
- Size aLogicSize = m_pChartWindow->PixelToLogic( Size( Width, Height ), MapMode( MAP_100TH_MM ) );
+ Size aLogicSize = m_pChartWindow->PixelToLogic( Size( Width, Height ), MapMode( MapUnit::Map100thMM ) );
//todo: for standalone chart: detect whether we are standalone
//change map mode to fit new size
@@ -239,7 +239,7 @@ void SAL_CALL ChartController::setPosSize(
sal_Int32 nScaleYNumerator = aLogicSize.Height();
sal_Int32 nScaleYDenominator = aModelPageSize.Height;
MapMode aNewMapMode(
- MAP_100TH_MM,
+ MapUnit::Map100thMM,
Point(0,0),
Fraction(nScaleXNumerator, nScaleXDenominator),
Fraction(nScaleYNumerator, nScaleYDenominator) );
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index ed053f67b8d4..21cc0cefc2ab 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -58,7 +58,7 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
{
set_id("chart_window");
this->SetHelpId( HID_SCH_WIN_DOCUMENT );
- this->SetMapMode( MapMode(MAP_100TH_MM) );
+ this->SetMapMode( MapMode(MapUnit::Map100thMM) );
adjustHighContrastMode();
// chart does not depend on exact pixel painting => enable antialiased drawing
SetAntialiasing( AntialiasingFlags::EnableB2dDraw | GetAntialiasing() );
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index 6d1453b581fa..e03a43c7e094 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -318,7 +318,7 @@ uno::Reference< awt::XWindow > SAL_CALL ElementSelectorToolbarController::create
{
m_apSelectorListBox.reset( VclPtr<SelectorListBox>::Create( pParent, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER ) );
::Size aLogicalSize( 95, 160 );
- ::Size aPixelSize = m_apSelectorListBox->LogicToPixel( aLogicalSize, MAP_APPFONT );
+ ::Size aPixelSize = m_apSelectorListBox->LogicToPixel( aLogicalSize, MapUnit::MapAppFont );
m_apSelectorListBox->SetSizePixel( aPixelSize );
m_apSelectorListBox->SetDropDownLineCount( 5 );
}
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx
index 8cc18b90dca6..8fefe156675e 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx
@@ -174,7 +174,7 @@ void ChartLinePanel::Initialize()
SvxColorToolBoxControl* pToolBoxColor = getColorToolBoxControl(mpTBColor.get());
pToolBoxColor->setColorSelectFunction(maLineColorWrapper);
- setMapUnit(MAP_100TH_MM);
+ setMapUnit(MapUnit::Map100thMM);
updateData();
}
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 7ec565c406f0..4ec9554a3c96 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -203,7 +203,7 @@ SfxItemPool* ChartItemPool::Clone() const
MapUnit ChartItemPool::GetMetric(sal_uInt16 /* nWhich */) const
{
- return MAP_100TH_MM;
+ return MapUnit::Map100thMM;
}
SfxItemPool* ChartItemPool::CreateChartItemPool()
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 3c27e6d1bb34..5f81d854f1ee 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -3347,7 +3347,7 @@ void ChartView::createShapes3D()
if( pWindow->GetSizePixel().Width() == 0 || pWindow->GetSizePixel().Height() == 0 )
{
awt::Size aPageSize = mrChartModel.getVisualAreaSize( embed::Aspects::MSOLE_CONTENT );
- Size aSize = pWindow->LogicToPixel( Size(aPageSize.Width,aPageSize.Height), MapUnit(MAP_100TH_MM) );
+ Size aSize = pWindow->LogicToPixel( Size(aPageSize.Width,aPageSize.Height), MapUnit(MapUnit::Map100thMM) );
pWindow->SetSizePixel(aSize);
}
pWindow->Show();
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index 4dda034eb916..826e02230f36 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -58,12 +58,12 @@ DrawModelWrapper::DrawModelWrapper( const uno::Reference<uno::XComponentContext>
{
m_pChartItemPool = ChartItemPool::CreateChartItemPool();
- SetScaleUnit(MAP_100TH_MM);
+ SetScaleUnit(MapUnit::Map100thMM);
SetScaleFraction(Fraction(1, 1));
SetDefaultFontHeight(423); // 12pt
SfxItemPool* pMasterPool = &GetItemPool();
- pMasterPool->SetDefaultMetric(MAP_100TH_MM);
+ pMasterPool->SetDefaultMetric(MapUnit::Map100thMM);
pMasterPool->SetPoolDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE, true) );
pMasterPool->SetPoolDefaultItem(makeSvx3DPercentDiagonalItem (5));
@@ -113,7 +113,7 @@ DrawModelWrapper::DrawModelWrapper( const uno::Reference<uno::XComponentContext>
m_pRefDevice.disposeAndClear();
m_pRefDevice = VclPtr<VirtualDevice>::Create(*pDefaultDevice);
MapMode aMapMode = m_pRefDevice->GetMapMode();
- aMapMode.SetMapUnit(MAP_100TH_MM);
+ aMapMode.SetMapUnit(MapUnit::Map100thMM);
m_pRefDevice->SetMapMode(aMapMode);
SetRefDevice(m_pRefDevice.get());
rOutliner.SetRefDevice(m_pRefDevice.get());
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 6d7b165da0ca..0491553a42ff 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -816,7 +816,7 @@ namespace cppcanvas
rFontSizeLog = ::Size(0, 16);
// convert to target MapUnit if not pixels
- rFontSizeLog = OutputDevice::LogicToLogic(rFontSizeLog, MAP_PIXEL, rParms.mrVDev.GetMapMode());
+ rFontSizeLog = OutputDevice::LogicToLogic(rFontSizeLog, MapUnit::MapPixel, rParms.mrVDev.GetMapMode());
}
const sal_Int32 nFontWidthLog = rFontSizeLog.Width();
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 65281aadce3d..c3f14d1c6adf 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -761,20 +761,20 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const
get(m_pSaveButton, "save");
get(m_pResetButton, "reset");
get(m_pEntriesBox, "shortcuts");
- Size aSize(LogicToPixel(Size(174, 100), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(174, 100), MapUnit::MapAppFont));
m_pEntriesBox->set_width_request(aSize.Width());
m_pEntriesBox->set_height_request(aSize.Height());
m_pEntriesBox->SetAccelConfigPage(this);
get(m_pGroupLBox, "category");
- aSize = LogicToPixel(Size(78 , 91), MAP_APPFONT);
+ aSize = LogicToPixel(Size(78 , 91), MapUnit::MapAppFont);
m_pGroupLBox->set_width_request(aSize.Width());
m_pGroupLBox->set_height_request(aSize.Height());
get(m_pFunctionBox, "function");
- aSize = LogicToPixel(Size(88, 91), MAP_APPFONT);
+ aSize = LogicToPixel(Size(88, 91), MapUnit::MapAppFont);
m_pFunctionBox->set_width_request(aSize.Width());
m_pFunctionBox->set_height_request(aSize.Height());
get(m_pKeyBox, "keys");
- aSize = LogicToPixel(Size(80, 91), MAP_APPFONT);
+ aSize = LogicToPixel(Size(80, 91), MapUnit::MapAppFont);
m_pKeyBox->set_width_request(aSize.Width());
m_pKeyBox->set_height_request(aSize.Height());
@@ -810,7 +810,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const
nMaxWidth = nTmp;
}
// recalc second tab
- long nNewTab = PixelToLogic( Size( nMaxWidth, 0 ), MAP_APPFONT ).Width();
+ long nNewTab = PixelToLogic( Size( nMaxWidth, 0 ), MapUnit::MapAppFont ).Width();
nNewTab = nNewTab + 5; // additional space
m_pEntriesBox->SetTab( 1, nNewTab );
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index bfda9e3f3551..dcbe98f2acab 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1763,7 +1763,7 @@ SvxConfigPage::SvxConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
get(m_pDescriptionField, "desc");
m_pDescriptionField->set_height_request(m_pDescriptionField->GetTextHeight()*4);
get(m_pEntries, "entries");
- Size aSize(LogicToPixel(Size(108, 115), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(108, 115), MapUnit::MapAppFont));
m_pEntries->set_height_request(aSize.Height());
m_pEntries->set_width_request(aSize.Width());
@@ -5015,7 +5015,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow,
get(pBtnImport, "importButton");
get(pBtnDelete, "deleteButton");
- aTbSize = pTbSymbol->LogicToPixel(Size(160, 80), MapMode(MAP_APPFONT));
+ aTbSize = pTbSymbol->LogicToPixel(Size(160, 80), MapMode(MapUnit::MapAppFont));
pTbSymbol->set_width_request(aTbSize.Width());
pTbSymbol->set_height_request(aTbSize.Height());
pTbSymbol->SetStyle(pTbSymbol->GetStyle() | WB_SCROLL | WB_LINESPACING);
@@ -5630,7 +5630,7 @@ SvxIconChangeDialog::SvxIconChangeDialog(
get(pFImageInfo, "infoImage");
get(pLineEditDescription, "addrTextview");
- Size aSize(LogicToPixel(Size(140, 83), MapMode(MAP_APPFONT)));
+ Size aSize(LogicToPixel(Size(140, 83), MapMode(MapUnit::MapAppFont)));
pLineEditDescription->set_width_request(aSize.Width());
pLineEditDescription->set_height_request(aSize.Height());
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx
index 082194fdc66d..9e422eb9ba84 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -65,7 +65,7 @@ SvxEventConfigPage::SvxEventConfigPage(vcl::Window *pParent, const SfxItemSet& r
mpImpl->sStrEvent = get<FixedText>("eventft")->GetText();
mpImpl->sAssignedMacro = get<FixedText>("actionft")->GetText();
get(mpImpl->pEventLB, "events");
- Size aSize(LogicToPixel(Size(205, 229), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(205, 229), MapUnit::MapAppFont));
mpImpl->pEventLB->set_width_request(aSize.Width());
mpImpl->pEventLB->set_height_request(aSize.Height());
get(mpImpl->pAssignPB, "macro");
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 3826bf53713f..7ff2f551da7a 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -110,7 +110,7 @@ IMPL_LINK( MacroEventListBox, HeaderEndDrag_Impl, HeaderBar*, pBar, void )
long _nWidth = maHeaderBar->GetItemSize( i );
aSz.Width() = _nWidth + nTmpSz;
nTmpSz += _nWidth;
- maListBox->SetTab( i, PixelToLogic( aSz, MapMode( MAP_APPFONT ) ).Width() );
+ maListBox->SetTab( i, PixelToLogic( aSz, MapMode( MapUnit::MapAppFont ) ).Width() );
}
}
}
@@ -166,7 +166,7 @@ VCL_BUILDER_DECL_FACTORY(MacroEventListBox)
Size MacroEventListBox::GetOptimalSize() const
{
- return LogicToPixel(Size(192, 72), MapMode(MAP_APPFONT ));
+ return LogicToPixel(Size(192, 72), MapMode(MapUnit::MapAppFont ));
}
void MacroEventListBox::Resize()
@@ -727,9 +727,9 @@ void SvxMacroTabPage_::InitAndSetHandler( const Reference< container::XNameRepla
rListBox.SetSelectionMode( SelectionMode::Single );
rListBox.SetTabs( &nTabs[0] );
Size aSize( nTabs[ 2 ], 0 );
- rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
+ rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() );
aSize.Width() = 1764; // don't know what, so 42^2 is best to use...
- rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
+ rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() );
rListBox.SetSpaceBetweenEntries( 0 );
mpImpl->pEventLB->Show();
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 56bbd308123f..a08ec7546344 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -201,7 +201,7 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow,
get(m_pExplainLink, "explainlink");
get(m_pNotInDictFT, "notindictft");
get(m_pSentenceED, "sentence");
- Size aEdSize(LogicToPixel(Size(197, 48), MAP_APPFONT));
+ Size aEdSize(LogicToPixel(Size(197, 48), MapUnit::MapAppFont));
m_pSentenceED->set_width_request(aEdSize.Width());
m_pSentenceED->set_height_request(aEdSize.Height());
get(m_pSuggestionFT, "suggestionsft");
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index c1c7ac64e61b..5591310489c7 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -276,7 +276,7 @@ VCL_BUILDER_DECL_FACTORY(ColorFieldControl)
Size ColorFieldControl::GetOptimalSize() const
{
- return LogicToPixel(Size(158, 158), MAP_APPFONT);
+ return LogicToPixel(Size(158, 158), MapUnit::MapAppFont);
}
void ColorFieldControl::UpdateBitmap()
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 2484a03dddd8..f90e719022aa 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -733,7 +733,7 @@ TPGalleryThemeProperties::TPGalleryThemeProperties( vcl::Window* pWindow, const
{
get(m_pCbbFileType, "filetype");
get(m_pLbxFound, "files");
- Size aSize(LogicToPixel(Size(172, 156), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(172, 156), MapUnit::MapAppFont));
m_pLbxFound->set_width_request(aSize.Width());
m_pLbxFound->set_height_request(aSize.Height());
m_pLbxFound->EnableMultiSelection(true);
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index dc680de5bd48..43217dc39d96 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -53,7 +53,7 @@ VCL_BUILDER_DECL_FACTORY(GraphicPreviewWindow)
Size GraphicPreviewWindow::GetOptimalSize() const
{
- return LogicToPixel(Size(81, 73), MAP_APPFONT);
+ return LogicToPixel(Size(81, 73), MapUnit::MapAppFont);
}
@@ -532,7 +532,7 @@ void EmbossControl::MouseButtonDown( const MouseEvent& rEvt )
Size EmbossControl::GetOptimalSize() const
{
- return LogicToPixel(Size(77, 60), MAP_APPFONT);
+ return LogicToPixel(Size(77, 60), MapUnit::MapAppFont);
}
diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx
index 986e608a6598..f2087cc4840e 100644
--- a/cui/source/dialogs/hlmarkwn.cxx
+++ b/cui/source/dialogs/hlmarkwn.cxx
@@ -95,7 +95,7 @@ VCL_BUILDER_DECL_FACTORY(SvxHlmarkTreeLBox)
Size SvxHlmarkTreeLBox::GetOptimalSize() const
{
- return LogicToPixel(Size(103, 162), MAP_APPFONT);
+ return LogicToPixel(Size(103, 162), MapUnit::MapAppFont);
}
void SvxHlmarkTreeLBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 4ee16b38bf1c..7df24bd982d3 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -99,7 +99,7 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, LinkManager* pMgr, bool b
aUpdateIdle("cui SvBaseLinksDlg UpdateIdle")
{
get(m_pTbLinks, "TB_LINKS");
- Size aSize(LogicToPixel(Size(257, 87), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(257, 87), MapUnit::MapAppFont));
m_pTbLinks->set_width_request(aSize.Width());
m_pTbLinks->set_height_request(aSize.Height());
get(m_pFtFullFileName, "FULL_FILE_NAME");
@@ -115,11 +115,11 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, LinkManager* pMgr, bool b
m_pTbLinks->SetSelectionMode( SelectionMode::Multiple );
m_pTbLinks->SetTabs( &nTabs[0] );
FixedText *pFtFiles = get<FixedText>("FILES");
- pFtFiles->set_width_request(LogicToPixel(Size(nTabs[2] - nTabs[1] - 2, 0), MAP_APPFONT).Width());
+ pFtFiles->set_width_request(LogicToPixel(Size(nTabs[2] - nTabs[1] - 2, 0), MapUnit::MapAppFont).Width());
FixedText *pFtLinks = get<FixedText>("LINKS");
- pFtLinks->set_width_request(LogicToPixel(Size(nTabs[3] - nTabs[2] - 2, 0), MAP_APPFONT).Width());
+ pFtLinks->set_width_request(LogicToPixel(Size(nTabs[3] - nTabs[2] - 2, 0), MapUnit::MapAppFont).Width());
FixedText *pFtTypes = get<FixedText>("TYPE");
- pFtTypes->set_width_request(LogicToPixel(Size(nTabs[4] - nTabs[3] - 2, 0), MAP_APPFONT).Width());
+ pFtTypes->set_width_request(LogicToPixel(Size(nTabs[4] - nTabs[3] - 2, 0), MapUnit::MapAppFont).Width());
m_pTbLinks->Resize(); // OS: hack for correct selection
// UpdateTimer for DDE-/Grf-links, which are waited for
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index afe5584e8b15..f20db7a4583c 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -179,7 +179,7 @@ SvxMultiPathDialog::SvxMultiPathDialog(vcl::Window* pParent)
get(m_pDelBtn, "delete");
SvSimpleTableContainer* pRadioLBContainer = get<SvSimpleTableContainer>("paths");
- Size aSize(LogicToPixel(Size(195, 77), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(195, 77), MapUnit::MapAppFont));
pRadioLBContainer->set_width_request(aSize.Width());
pRadioLBContainer->set_height_request(aSize.Height());
m_pRadioLB = VclPtr<svx::SvxRadioButtonListBox>::Create(*pRadioLBContainer, 0);
@@ -207,7 +207,7 @@ SvxPathSelectDialog::SvxPathSelectDialog(vcl::Window* pParent)
get(m_pAddBtn, "add");
get(m_pDelBtn, "delete");
get(m_pPathLB, "paths");
- Size aSize(LogicToPixel(Size(189, 80), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(189, 80), MapUnit::MapAppFont));
m_pPathLB->set_width_request(aSize.Width());
m_pPathLB->set_height_request(aSize.Height());
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index 18ad0b14abac..f853ce3e9b50 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -31,7 +31,7 @@ CertPathDialog::CertPathDialog(vcl::Window* pParent)
get(m_pOKBtn, "ok");
get(m_pAddBtn, "add");
get(m_pCertPathListContainer, "paths");
- Size aSize(LogicToPixel(Size(210, 60), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(210, 60), MapUnit::MapAppFont));
m_pCertPathListContainer->set_width_request(aSize.Width());
m_pCertPathListContainer->set_height_request(aSize.Height());
m_pCertPathList =
diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx
index 9362469caf3a..bf34078cac9a 100644
--- a/cui/source/options/connpooloptions.cxx
+++ b/cui/source/options/connpooloptions.cxx
@@ -127,11 +127,11 @@ namespace offapp
{
EditBrowseBox::Init();
- Size aColWidth = LogicToPixel(Size(160, 0), MAP_APPFONT);
+ Size aColWidth = LogicToPixel(Size(160, 0), MapUnit::MapAppFont);
InsertDataColumn(1, OUString(CUI_RES(RID_SVXSTR_DRIVER_NAME)), aColWidth.Width());
- aColWidth = LogicToPixel(Size(30, 0), MAP_APPFONT);
+ aColWidth = LogicToPixel(Size(30, 0), MapUnit::MapAppFont);
InsertDataColumn(2, OUString(CUI_RES(RID_SVXSTR_POOLED_FLAG)), aColWidth.Width());
- aColWidth = LogicToPixel(Size(60, 0), MAP_APPFONT);
+ aColWidth = LogicToPixel(Size(60, 0), MapUnit::MapAppFont);
InsertDataColumn(3, OUString(CUI_RES(RID_SVXSTR_POOL_TIMEOUT)), aColWidth.Width());
// Attention: the resource of the string is local to the resource of the enclosing dialog!
}
@@ -303,7 +303,7 @@ namespace offapp
get(m_pTimeout, "timeout");
Size aControlSize(248, 100);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
m_pDriverList->set_width_request(aControlSize.Width());
m_pDriverList->set_height_request(aControlSize.Height());
m_pDriverList->Init();
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index be470fc95c0b..c34f7b60919b 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -110,7 +110,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons
{
get(m_pPathCtrl, "pathctrl");
Size aControlSize(248, 147);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
m_pPathCtrl->set_width_request(aControlSize.Width());
m_pPathCtrl->set_height_request(aControlSize.Height());
@@ -134,11 +134,11 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons
Size aSz;
aSz.Width() = TAB_WIDTH1;
rBar.InsertItem( ITEMID_TYPE, m_aTypeText,
- LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
+ LogicToPixel( aSz, MapMode( MapUnit::MapAppFont ) ).Width(),
HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER | HeaderBarItemBits::CLICKABLE | HeaderBarItemBits::UPARROW );
aSz.Width() = TAB_WIDTH2;
rBar.InsertItem( ITEMID_PATH, m_aPathText,
- LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
+ LogicToPixel( aSz, MapMode( MapUnit::MapAppFont ) ).Width(),
HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER );
static long aTabs[] = {3, 0, TAB_WIDTH1, TAB_WIDTH1 + TAB_WIDTH2 };
@@ -364,7 +364,7 @@ IMPL_LINK( DbRegistrationOptionsPage, HeaderEndDrag_Impl, HeaderBar*, pBar, void
long _nWidth = pBar->GetItemSize(i);
aSz.Width() = _nWidth + nTmpSz;
nTmpSz += _nWidth;
- m_pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width() );
+ m_pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() );
}
}
}
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index 9abe7d4db52b..7264c0d194c9 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -59,7 +59,7 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( vcl::Window* pParent,
SvSimpleTableContainer *pCheckLBContainer = get<SvSimpleTableContainer>("checklb");
Size aControlSize(248, 75);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
pCheckLBContainer->set_width_request(aControlSize.Width());
pCheckLBContainer->set_height_request(aControlSize.Height());
@@ -421,7 +421,7 @@ void SvxFontSubstCheckListBox::setColSizes()
long nW1 = rBar.GetTextWidth(rBar.GetItemText(3));
long nW2 = rBar.GetTextWidth(rBar.GetItemText(4));
long nMax = std::max( nW1, nW2 ) + 6; // width of the longest header + a little offset
- long nMin = rBar.LogicToPixel(Size(10, 0), MAP_APPFONT).Width();
+ long nMin = rBar.LogicToPixel(Size(10, 0), MapUnit::MapAppFont).Width();
nMax = std::max( nMax, nMin );
const long nDoubleMax = 2*nMax;
const long nRest = GetSizePixel().Width() - nDoubleMax;
@@ -429,7 +429,7 @@ void SvxFontSubstCheckListBox::setColSizes()
aStaticTabs[2] = nMax;
aStaticTabs[3] = nDoubleMax;
aStaticTabs[4] = nDoubleMax + nRest/2;
- SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL);
+ SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
}
void SvxFontSubstCheckListBox::Resize()
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index a6c06a9c4ba4..bacba9e98b78 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -137,7 +137,7 @@ void CuiCustomMultilineEdit::KeyInput( const KeyEvent& rKeyEvent )
Size CuiCustomMultilineEdit::GetOptimalSize() const
{
- return LogicToPixel(Size(150, GetTextHeight()), MAP_APPFONT);
+ return LogicToPixel(Size(150, GetTextHeight()), MapUnit::MapAppFont);
}
CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxItemSet& rItemSet*/ ) :
@@ -150,7 +150,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI
m_vectorOfModified(),
m_pPrefBox( VclPtr<SvSimpleTable>::Create(*m_pPrefCtrl, WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) )
{
- Size aControlSize(LogicToPixel(Size(385, 230), MAP_APPFONT));
+ Size aControlSize(LogicToPixel(Size(385, 230), MapUnit::MapAppFont));
m_pPrefCtrl->set_width_request(aControlSize.Width());
m_pPrefCtrl->set_height_request(aControlSize.Height());
@@ -179,7 +179,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI
m_options.searchFlag |= (util::SearchFlags::REG_NOT_BEGINOFLINE |
util::SearchFlags::REG_NOT_ENDOFLINE);
- m_pPrefBox->SetTabs(aTabs, MAP_PIXEL);
+ m_pPrefBox->SetTabs(aTabs, MapUnit::MapPixel);
m_pPrefBox->SetAlternatingRowColors( true );
}
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index d3c9fc1002c8..6e791c8911ca 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -158,7 +158,7 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet
get( aShadingRB, "shading" );
Size aControlSize(248, 55);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
m_pCheckLBContainer->set_width_request(aControlSize.Width());
m_pCheckLBContainer->set_height_request(aControlSize.Height());
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 9ddc4fff0cf8..c8bb0cb241eb 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -108,7 +108,7 @@ public:
if (rBar.GetItemCount() < 4)
return;
long nCheckWidth = std::max(GetControlColumnWidth() + 12,
- rBar.LogicToPixel(Size(15, 0), MAP_APPFONT).Width());
+ rBar.LogicToPixel(Size(15, 0), MapUnit::MapAppFont).Width());
long nVersionWidth = 12 +
std::max(rBar.GetTextWidth(rBar.GetItemText(3)),
GetTextWidth("0.0.0_00-icedtea"));
@@ -123,7 +123,7 @@ public:
aStaticTabs[2] = nCheckWidth;
aStaticTabs[3] = aStaticTabs[2] + nVendorWidth;
aStaticTabs[4] = aStaticTabs[3] + nVersionWidth;
- SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL);
+ SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
}
virtual void Resize() override
{
@@ -163,7 +163,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet&
SvSimpleTableContainer *pJavaListContainer = get<SvSimpleTableContainer>("javas");
Size aControlSize(177, 60);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
pJavaListContainer->set_width_request(aControlSize.Width());
pJavaListContainer->set_height_request(aControlSize.Height());
m_pJavaList = VclPtr<SvxJavaListBox>::Create(*pJavaListContainer, m_sAccessibilityText);
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index fc9f3c612240..6e3c09993cff 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1816,7 +1816,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD
get(m_pPrioDownPB, "down");
get(m_pPrioUpPB, "up");
get(m_pModulesCLB, "lingudicts");
- Size aListSize(m_pModulesCLB->LogicToPixel(Size(166, 120), MAP_APPFONT));
+ Size aListSize(m_pModulesCLB->LogicToPixel(Size(166, 120), MapUnit::MapAppFont));
m_pModulesCLB->set_height_request(aListSize.Height());
m_pModulesCLB->set_width_request(aListSize.Width());
get(m_pLanguageLB, "language");
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 88d7fd5b6eb8..f3511513f88b 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -204,7 +204,7 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pPathBtn->SetClickHdl( LINK( this, SvxPathTabPage, PathHdl_Impl ) );
Size aControlSize(236 , 147);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
m_pPathCtrl->set_width_request(aControlSize.Width());
m_pPathCtrl->set_height_request(aControlSize.Height());
WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
@@ -227,7 +227,7 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
long aTabs[] = {3, 0, 0, 0};
aTabs[2] = nWidth1 + 12;
aTabs[3] = aTabs[2] + nWidth2 + 12;
- pPathBox->SetTabs(aTabs, MAP_PIXEL);
+ pPathBox->SetTabs(aTabs, MapUnit::MapPixel);
pPathBox->SetDoubleClickHdl( LINK( this, SvxPathTabPage, DoubleClickPathHdl_Impl ) );
pPathBox->SetSelectHdl( LINK( this, SvxPathTabPage, PathSelect_Impl ) );
@@ -342,7 +342,7 @@ void SvxPathTabPage::Reset( const SfxItemSet* )
long aTabs[] = {3, 0, 0, 0};
aTabs[2] = nWidth1 + 12;
aTabs[3] = aTabs[2] + nWidth2 + 12;
- pPathBox->SetTabs(aTabs, MAP_PIXEL);
+ pPathBox->SetTabs(aTabs, MapUnit::MapPixel);
#if 0
String aUserData = GetUserData();
@@ -716,7 +716,7 @@ IMPL_LINK( SvxPathTabPage, HeaderEndDrag_Impl, HeaderBar*, pBar, void )
long _nWidth = pBar->GetItemSize(i);
aSz.Width() = _nWidth + nTmpSz;
nTmpSz += _nWidth;
- pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width() );
+ pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() );
}
}
}
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 716bb2a253e1..3ecfdf624a84 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -498,7 +498,7 @@ void OfaTreeOptionsDialog::InitWidgets()
get(pBackPB, "revert");
get(pTreeLB, "pages");
get(pTabBox, "box");
- Size aSize(pTabBox->LogicToPixel(Size(278, 259), MAP_APPFONT));
+ Size aSize(pTabBox->LogicToPixel(Size(278, 259), MapUnit::MapAppFont));
pTabBox->set_width_request(aSize.Width());
pTabBox->set_height_request(aSize.Height() - get_action_area()->get_preferred_size().Height());
pTreeLB->set_width_request(pTreeLB->approximate_char_width() * 25);
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index 21ed6daa0e88..d9473ea8f7ab 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -96,7 +96,7 @@ void PasswordTable::setColWidths()
GetSizePixel().Width() - nUserNameWidth);
long aStaticTabs[]= { 2, 0, 0 };
aStaticTabs[2] = nWebSiteWidth;
- SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL);
+ SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
}
// class WebConnectionInfoDialog -----------------------------------------
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 64ab34f826f5..67efba2e1b2c 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -437,7 +437,7 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( vcl::Window* pParent,
SvSimpleTableContainer* pCheckLBContainer(get<SvSimpleTableContainer>("list"));
Size aControlSize(248 , 149);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
pCheckLBContainer->set_width_request(aControlSize.Width());
pCheckLBContainer->set_height_request(aControlSize.Height());
m_pCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pCheckLBContainer);
@@ -1773,7 +1773,7 @@ void AutoCorrEdit::Resize()
Edit::Resize();
if (!m_xReplaceTLB)
return;
- m_xReplaceTLB->SetTab(m_nCol, GetPosPixel().X(), MAP_PIXEL);
+ m_xReplaceTLB->SetTab(m_nCol, GetPosPixel().X(), MapUnit::MapPixel);
}
enum OfaQuoteOptions
@@ -1823,7 +1823,7 @@ OfaQuoteTabPage::OfaQuoteTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
SvSimpleTableContainer *pListContainer = get<SvSimpleTableContainer>("list");
Size aControlSize(252 , 85);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
pListContainer->set_width_request(aControlSize.Width());
pListContainer->set_height_request(aControlSize.Height());
m_pSwCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pListContainer);
@@ -2195,7 +2195,7 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage(vcl::Window* pParent,
get(m_pNFMaxEntries, "maxentries");
get(m_pLBEntries, "entries");
m_pLBEntries->SetPage(this);
- aSize = LogicToPixel(Size(121, 158), MAP_APPFONT);
+ aSize = LogicToPixel(Size(121, 158), MapUnit::MapAppFont);
m_pLBEntries->set_width_request(aSize.Width());
m_pLBEntries->set_height_request(aSize.Height());
get(m_pPBEntries, "delete");
@@ -2477,7 +2477,7 @@ OfaSmartTagOptionsTabPage::OfaSmartTagOptionsTabPage( vcl::Window* pParent,
// some options for the list box:
m_pSmartTagTypesLB->SetStyle( m_pSmartTagTypesLB->GetStyle() | WB_HSCROLL | WB_HIDESELECTION );
m_pSmartTagTypesLB->SetHighlightRange();
- Size aControlSize(LogicToPixel(Size(172, 154), MAP_APPFONT));
+ Size aControlSize(LogicToPixel(Size(172, 154), MapUnit::MapAppFont));
m_pSmartTagTypesLB->set_width_request(aControlSize.Width());
m_pSmartTagTypesLB->set_height_request(aControlSize.Height());
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index f94fb4aba33c..2a2a32065d9a 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -251,7 +251,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
}
bIsDontCare = !pBoxInfo->IsValid( SvxBoxInfoItemValidFlags::DISABLE );
}
- if(!mbUseMarginItem && eFUnit == FUNIT_MM && MAP_TWIP == rCoreAttrs.GetPool()->GetMetric( GetWhich( SID_ATTR_BORDER_INNER ) ))
+ if(!mbUseMarginItem && eFUnit == FUNIT_MM && MapUnit::MapTwip == rCoreAttrs.GetPool()->GetMetric( GetWhich( SID_ATTR_BORDER_INNER ) ))
{
//#i91548# changing the number of decimal digits changes the minimum values, too
lcl_SetDecimalDigitsTo1(*m_pLeftMF);
@@ -540,7 +540,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
// Determine the width first as some styles can be missing depending on it
sal_Int64 nWidthPt = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
sal_Int64( nWidth ), m_pLineWidthMF->GetDecimalDigits( ),
- MAP_TWIP,m_pLineWidthMF->GetUnit() ));
+ MapUnit::MapTwip, m_pLineWidthMF->GetUnit() ));
m_pLineWidthMF->SetValue( nWidthPt );
m_pLbLineStyle->SetWidth( nWidth );
@@ -896,7 +896,7 @@ IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl, Edit&, void)
sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
m_pLineWidthMF->GetValue( ),
m_pLineWidthMF->GetDecimalDigits( ),
- m_pLineWidthMF->GetUnit(), MAP_TWIP ));
+ m_pLineWidthMF->GetUnit(), MapUnit::MapTwip ));
m_pLbLineStyle->SetWidth( nVal );
m_pFrameSel->SetStyleToSelection( nVal,
@@ -911,7 +911,7 @@ IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox&, rLb, void )
sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
m_pLineWidthMF->GetValue( ),
m_pLineWidthMF->GetDecimalDigits( ),
- m_pLineWidthMF->GetUnit(), MAP_TWIP ));
+ m_pLineWidthMF->GetUnit(), MapUnit::MapTwip ));
m_pFrameSel->SetStyleToSelection ( nVal,
SvxBorderStyle( m_pLbLineStyle->GetSelectEntryStyle() ) );
}
@@ -1111,7 +1111,7 @@ void SvxBorderTabPage::FillLineListBox_Impl()
sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
m_pLineWidthMF->GetValue( ),
m_pLineWidthMF->GetDecimalDigits( ),
- m_pLineWidthMF->GetUnit(), MAP_TWIP ));
+ m_pLineWidthMF->GetUnit(), MapUnit::MapTwip ));
m_pLbLineStyle->SetWidth( nVal );
}
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 444fd626376e..1d270844ce60 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -780,9 +780,9 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
MapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
const SvxFontHeightItem& rItem = static_cast<const SvxFontHeightItem&>(rSet.Get( nWhich ));
- if( rItem.GetProp() != 100 || MAP_RELATIVE != rItem.GetPropUnit() )
+ if( rItem.GetProp() != 100 || MapUnit::MapRelative != rItem.GetPropUnit() )
{
- bool bPtRel = MAP_POINT == rItem.GetPropUnit();
+ bool bPtRel = MapUnit::MapPoint == rItem.GetPropUnit();
pSizeBox->SetPtRelative( bPtRel );
pSizeBox->SetValue( bPtRel ? ((short)rItem.GetProp()) * 10 : rItem.GetProp() );
}
@@ -1079,7 +1079,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
}
if ( bChanged || !pOldHeight ||
- bRel != ( MAP_RELATIVE != pOldHeight->GetPropUnit() || 100 != pOldHeight->GetProp() ) )
+ bRel != ( MapUnit::MapRelative != pOldHeight->GetPropUnit() || 100 != pOldHeight->GetProp() ) )
{
MapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
if ( pSizeBox->IsRelative() )
@@ -1090,7 +1090,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
SvxFontHeightItem aHeight( 240, 100, nWhich );
if ( pSizeBox->IsPtRelative() )
- aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)( nSize / 10 ), MAP_POINT, eUnit );
+ aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)( nSize / 10 ), MapUnit::MapPoint, eUnit );
else
aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)nSize );
rSet.Put( aHeight );
@@ -2826,7 +2826,7 @@ IMPL_LINK( SvxCharPositionPage, FitToLineHdl_Impl, Button*, pBox, void )
IMPL_LINK_NOARG(SvxCharPositionPage, KerningModifyHdl_Impl, Edit&, void)
{
long nVal = static_cast<long>(m_pKerningMF->GetValue());
- nVal = LogicToLogic( nVal, MAP_POINT, MAP_TWIP );
+ nVal = LogicToLogic( nVal, MapUnit::MapPoint, MapUnit::MapTwip );
long nKern = (short)m_pKerningMF->Denormalize( nVal );
SvxFont& rFont = GetPreviewFont();
@@ -3005,12 +3005,12 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>(rSet->Get( nWhich ));
MapUnit eUnit = rSet->GetPool()->GetMetric( nWhich );
MapUnit eOrgUnit = (MapUnit)eUnit;
- MapUnit ePntUnit( MAP_POINT );
+ MapUnit ePntUnit( MapUnit::MapPoint );
long nBig = static_cast<long>(m_pKerningMF->Normalize( static_cast<long>(rItem.GetValue()) ));
long nKerning = LogicToLogic( nBig, eOrgUnit, ePntUnit );
// set Kerning at the Font, convert into Twips before
- long nKern = LogicToLogic( rItem.GetValue(), (MapUnit)eUnit, MAP_TWIP );
+ long nKern = LogicToLogic( rItem.GetValue(), (MapUnit)eUnit, MapUnit::MapTwip );
rFont.SetFixKerning( (short)nKern );
rCJKFont.SetFixKerning( (short)nKern );
rCTLFont.SetFixKerning( (short)nKern );
@@ -3179,7 +3179,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
MapUnit eUnit = rSet->GetPool()->GetMetric( nWhich );
long nTmp = static_cast<long>(m_pKerningMF->GetValue());
- long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit );
+ long nVal = LogicToLogic( nTmp, MapUnit::MapPoint, (MapUnit)eUnit );
nKerning = (short)m_pKerningMF->Denormalize( nVal );
SfxItemState eOldKernState = rOldSet.GetItemState( nWhich, false );
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 5c09f6b10d39..0e0965819b27 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -217,7 +217,7 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
{
aPageSize = OutputDevice::LogicToLogic(
Size( CM_1_TO_TWIP, CM_1_TO_TWIP ),
- MapMode( MAP_TWIP ),
+ MapMode( MapUnit::MapTwip ),
MapMode( (MapUnit)rSet->GetPool()->GetMetric( nW ) ) );
}
@@ -749,9 +749,9 @@ IMPL_LINK( SvxGrfCropPage, CropModifyHdl, Edit&, rField, void )
Size SvxGrfCropPage::GetGrfOrigSize( const Graphic& rGrf ) const
{
- const MapMode aMapTwip( MAP_TWIP );
+ const MapMode aMapTwip( MapUnit::MapTwip );
Size aSize( rGrf.GetPrefSize() );
- if( MAP_PIXEL == rGrf.GetPrefMapMode().GetMapUnit() )
+ if( MapUnit::MapPixel == rGrf.GetPrefMapMode().GetMapUnit() )
aSize = PixelToLogic( aSize, aMapTwip );
else
aSize = OutputDevice::LogicToLogic( aSize,
@@ -765,7 +765,7 @@ SvxCropExample::SvxCropExample( vcl::Window* pPar, WinBits nStyle )
: Window( pPar, nStyle)
, aFrameSize( OutputDevice::LogicToLogic(
Size( CM_1_TO_TWIP / 2, CM_1_TO_TWIP / 2 ),
- MapMode( MAP_TWIP ), GetMapMode() ))
+ MapMode( MapUnit::MapTwip ), GetMapMode() ))
, aTopLeft(0,0)
, aBottomRight(0,0)
{
@@ -774,7 +774,7 @@ SvxCropExample::SvxCropExample( vcl::Window* pPar, WinBits nStyle )
Size SvxCropExample::GetOptimalSize() const
{
- return LogicToPixel(Size(78, 78), MAP_APPFONT);
+ return LogicToPixel(Size(78, 78), MapUnit::MapAppFont);
}
VCL_BUILDER_DECL_FACTORY(SvxCropExample)
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index c325ff9d19a3..e255e9cec723 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -87,7 +87,7 @@ SvxCaptionTabPage::SvxCaptionTabPage(vcl::Window* pParent, const SfxItemSet& rIn
{
get(m_pCT_CAPTTYPE, "valueset");
- Size aSize(m_pCT_CAPTTYPE->LogicToPixel(Size(187, 38), MAP_APPFONT));
+ Size aSize(m_pCT_CAPTTYPE->LogicToPixel(Size(187, 38), MapUnit::MapAppFont));
m_pCT_CAPTTYPE->set_width_request(aSize.Width());
m_pCT_CAPTTYPE->set_height_request(aSize.Height());
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index b980bc1f38cb..8c7a4e0f0387 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -398,9 +398,9 @@ void SfxMacroTabPage::InitAndSetHandler()
rListBox.SetSelectionMode( SelectionMode::Single );
rListBox.SetTabs( &nTabs[0] );
Size aSize( nTabs[ 2 ], 0 );
- rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
+ rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() );
aSize.Width() = 1764; // don't know what, so 42^2 is best to use...
- rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() );
+ rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() );
rListBox.SetSpaceBetweenEntries( 0 );
mpImpl->pEventLB->Show();
diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index 6fabe1fee2a1..e023463ee431 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -86,7 +86,7 @@ SvxMeasurePage::SvxMeasurePage( vcl::Window* pWindow, const SfxItemSet& rInAttrs
rOutAttrs ( rInAttrs ),
aAttrSet ( *rInAttrs.GetPool() ),
pView( nullptr ),
- eUnit( MAP_100TH_MM ),
+ eUnit( MapUnit::Map100thMM ),
bPositionModified ( false )
{
get(m_pMtrFldLineDist, "MTR_LINE_DIST");
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 04cabab006d1..1d7ab68557e5 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -969,7 +969,7 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
{
Size aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
- aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)eCoreUnit);
+ aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, (MapUnit)eCoreUnit);
SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH );
aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient );
}
@@ -2013,7 +2013,7 @@ IMPL_LINK( SvxNumOptionsTabPage, GraphicHdl_Impl, MenuButton *, pButton, void )
}
if(bSucc)
{
- aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)eCoreUnit);
+ aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, (MapUnit)eCoreUnit);
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
@@ -2171,9 +2171,9 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void)
long nWidthVal = static_cast<long>(m_pWidthMF->Denormalize(m_pWidthMF->GetValue(FUNIT_100TH_MM)));
long nHeightVal = static_cast<long>(m_pHeightMF->Denormalize(m_pHeightMF->GetValue(FUNIT_100TH_MM)));
nWidthVal = OutputDevice::LogicToLogic( nWidthVal ,
- MAP_100TH_MM, (MapUnit)eCoreUnit );
+ MapUnit::Map100thMM, (MapUnit)eCoreUnit );
nHeightVal = OutputDevice::LogicToLogic( nHeightVal,
- MAP_100TH_MM, (MapUnit)eCoreUnit);
+ MapUnit::Map100thMM, (MapUnit)eCoreUnit);
double fSizeRatio;
bool bRepaint = false;
@@ -2201,7 +2201,7 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void)
{
aSize.Height() = aInitSize[i].Height() + (long)((double)nDelta / fSizeRatio);
m_pHeightMF->SetUserValue(m_pHeightMF->Normalize(
- OutputDevice::LogicToLogic( aSize.Height(), (MapUnit)eCoreUnit, MAP_100TH_MM )),
+ OutputDevice::LogicToLogic( aSize.Height(), (MapUnit)eCoreUnit, MapUnit::Map100thMM )),
FUNIT_100TH_MM);
}
}
@@ -2213,7 +2213,7 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void)
{
aSize.Width() = aInitSize[i].Width() + (long)((double)nDelta * fSizeRatio);
m_pWidthMF->SetUserValue(m_pWidthMF->Normalize(
- OutputDevice::LogicToLogic( aSize.Width(), (MapUnit)eCoreUnit, MAP_100TH_MM )),
+ OutputDevice::LogicToLogic( aSize.Width(), (MapUnit)eCoreUnit, MapUnit::Map100thMM )),
FUNIT_100TH_MM);
}
}
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index b0940e4f85f7..a6097ea8aaa2 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -118,7 +118,7 @@ Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBo
long ConvertLong_Impl( const long nIn, MapUnit eUnit )
{
- return OutputDevice::LogicToLogic( nIn, eUnit, MAP_TWIP );
+ return OutputDevice::LogicToLogic( nIn, eUnit, MapUnit::MapTwip );
}
bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize )
@@ -290,7 +290,7 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr
}
MapMode aOldMode = mpDefPrinter->GetMapMode();
- mpDefPrinter->SetMapMode( MAP_TWIP );
+ mpDefPrinter->SetMapMode( MapUnit::MapTwip );
// set first- and last-values for the margins
Size aPaperSize = mpDefPrinter->GetPaperSize();
@@ -535,22 +535,22 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
m_pBspWin->SetSize( Size( ConvertLong_Impl( aPaperSize.Width(), eUnit ),
ConvertLong_Impl( aPaperSize.Height(), eUnit ) ) );
- aPaperSize = OutputDevice::LogicToLogic(aPaperSize, (MapUnit)eUnit, MAP_100TH_MM);
+ aPaperSize = OutputDevice::LogicToLogic(aPaperSize, (MapUnit)eUnit, MapUnit::Map100thMM);
if ( bLandscape )
Swap( aPaperSize );
// Actual Paper Format
- Paper ePaper = SvxPaperInfo::GetSvxPaper( aPaperSize, MAP_100TH_MM, true );
+ Paper ePaper = SvxPaperInfo::GetSvxPaper( aPaperSize, MapUnit::Map100thMM, true );
if ( PAPER_USER != ePaper )
- aPaperSize = SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM );
+ aPaperSize = SvxPaperInfo::GetPaperSize( ePaper, MapUnit::Map100thMM );
if ( bLandscape )
Swap( aPaperSize );
// write values into the edits
- SetMetricValue( *m_pPaperHeightEdit, aPaperSize.Height(), MAP_100TH_MM );
- SetMetricValue( *m_pPaperWidthEdit, aPaperSize.Width(), MAP_100TH_MM );
+ SetMetricValue( *m_pPaperHeightEdit, aPaperSize.Height(), MapUnit::Map100thMM );
+ SetMetricValue( *m_pPaperWidthEdit, aPaperSize.Width(), MapUnit::Map100thMM );
m_pPaperSizeBox->Clear();
m_pPaperSizeBox->FillPaperSizeEntries( ( ePaperStart == PAPER_A3 ) ? PaperSizeApp::Std : PaperSizeApp::Draw );
@@ -953,7 +953,7 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void )
if ( ePaper != PAPER_USER )
{
- Size aSize( SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM ) );
+ Size aSize( SvxPaperInfo::GetPaperSize( ePaper, MapUnit::Map100thMM ) );
if ( m_pLandscapeBtn->IsChecked() )
Swap( aSize );
@@ -964,8 +964,8 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void )
if ( aSize.Width() < m_pPaperWidthEdit->GetMin( FUNIT_100TH_MM ) )
m_pPaperWidthEdit->SetMin(
m_pPaperWidthEdit->Normalize( aSize.Width() ), FUNIT_100TH_MM );
- SetMetricValue( *m_pPaperHeightEdit, aSize.Height(), MAP_100TH_MM );
- SetMetricValue( *m_pPaperWidthEdit, aSize.Width(), MAP_100TH_MM );
+ SetMetricValue( *m_pPaperHeightEdit, aSize.Height(), MapUnit::Map100thMM );
+ SetMetricValue( *m_pPaperWidthEdit, aSize.Width(), MapUnit::Map100thMM );
CalcMargin_Impl();
@@ -984,28 +984,28 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void )
if ( bScreen || m_pRightMarginEdit->GetValue() == 0 )
{
- SetMetricValue( *m_pRightMarginEdit, nTmp, MAP_CM );
+ SetMetricValue( *m_pRightMarginEdit, nTmp, MapUnit::MapCM );
if ( !bScreen &&
m_pRightMarginEdit->GetFirst() > m_pRightMarginEdit->GetValue() )
m_pRightMarginEdit->SetValue( m_pRightMarginEdit->GetFirst() );
}
if ( bScreen || m_pLeftMarginEdit->GetValue() == 0 )
{
- SetMetricValue( *m_pLeftMarginEdit, nTmp, MAP_CM );
+ SetMetricValue( *m_pLeftMarginEdit, nTmp, MapUnit::MapCM );
if ( !bScreen &&
m_pLeftMarginEdit->GetFirst() > m_pLeftMarginEdit->GetValue() )
m_pLeftMarginEdit->SetValue( m_pLeftMarginEdit->GetFirst() );
}
if ( bScreen || m_pBottomMarginEdit->GetValue() == 0 )
{
- SetMetricValue( *m_pBottomMarginEdit, nTmp, MAP_CM );
+ SetMetricValue( *m_pBottomMarginEdit, nTmp, MapUnit::MapCM );
if ( !bScreen &&
m_pBottomMarginEdit->GetFirst() > m_pBottomMarginEdit->GetValue() )
m_pBottomMarginEdit->SetValue( m_pBottomMarginEdit->GetFirst() );
}
if ( bScreen || m_pTopMarginEdit->GetValue() == 0 )
{
- SetMetricValue( *m_pTopMarginEdit, nTmp, MAP_CM );
+ SetMetricValue( *m_pTopMarginEdit, nTmp, MapUnit::MapCM );
if ( !bScreen &&
m_pTopMarginEdit->GetFirst() > m_pTopMarginEdit->GetValue() )
m_pTopMarginEdit->SetValue( m_pTopMarginEdit->GetFirst() );
@@ -1038,12 +1038,12 @@ IMPL_LINK( SvxPageDescPage, SwapOrientation_Impl, Button *, pBtn, void )
{
bLandscape = m_pLandscapeBtn->IsChecked();
- const long lWidth = GetCoreValue( *m_pPaperWidthEdit, MAP_100TH_MM );
- const long lHeight = GetCoreValue( *m_pPaperHeightEdit, MAP_100TH_MM );
+ const long lWidth = GetCoreValue( *m_pPaperWidthEdit, MapUnit::Map100thMM );
+ const long lHeight = GetCoreValue( *m_pPaperHeightEdit, MapUnit::Map100thMM );
// swap width and height
- SetMetricValue( *m_pPaperWidthEdit, lHeight, MAP_100TH_MM );
- SetMetricValue( *m_pPaperHeightEdit, lWidth, MAP_100TH_MM );
+ SetMetricValue( *m_pPaperWidthEdit, lHeight, MapUnit::Map100thMM );
+ SetMetricValue( *m_pPaperHeightEdit, lWidth, MapUnit::Map100thMM );
// recalculate margins if necessary
CalcMargin_Impl();
@@ -1065,7 +1065,7 @@ void SvxPageDescPage::SwapFirstValues_Impl( bool bSet )
eOri = Orientation::Landscape;
Orientation eOldOri = mpDefPrinter->GetOrientation();
mpDefPrinter->SetOrientation( eOri );
- mpDefPrinter->SetMapMode( MAP_TWIP );
+ mpDefPrinter->SetMapMode( MapUnit::MapTwip );
// set first- and last-values for margins
Size aPaperSize = mpDefPrinter->GetPaperSize();
@@ -1133,16 +1133,16 @@ IMPL_LINK_NOARG(SvxPageDescPage, BorderModify_Impl, Edit&, void)
void SvxPageDescPage::UpdateExample_Impl( bool bResetbackground )
{
// Size
- Size aSize( GetCoreValue( *m_pPaperWidthEdit, MAP_TWIP ),
- GetCoreValue( *m_pPaperHeightEdit, MAP_TWIP ) );
+ Size aSize( GetCoreValue( *m_pPaperWidthEdit, MapUnit::MapTwip ),
+ GetCoreValue( *m_pPaperHeightEdit, MapUnit::MapTwip ) );
m_pBspWin->SetSize( aSize );
// Margins
- m_pBspWin->SetTop( GetCoreValue( *m_pTopMarginEdit, MAP_TWIP ) );
- m_pBspWin->SetBottom( GetCoreValue( *m_pBottomMarginEdit, MAP_TWIP ) );
- m_pBspWin->SetLeft( GetCoreValue( *m_pLeftMarginEdit, MAP_TWIP ) );
- m_pBspWin->SetRight( GetCoreValue( *m_pRightMarginEdit, MAP_TWIP ) );
+ m_pBspWin->SetTop( GetCoreValue( *m_pTopMarginEdit, MapUnit::MapTwip ) );
+ m_pBspWin->SetBottom( GetCoreValue( *m_pBottomMarginEdit, MapUnit::MapTwip ) );
+ m_pBspWin->SetLeft( GetCoreValue( *m_pLeftMarginEdit, MapUnit::MapTwip ) );
+ m_pBspWin->SetRight( GetCoreValue( *m_pRightMarginEdit, MapUnit::MapTwip ) );
// Layout
m_pBspWin->SetUsage( PosToPageUsage_Impl( m_pLayoutBox->GetSelectEntryPos() ) );
@@ -1540,14 +1540,14 @@ IMPL_LINK_NOARG(SvxPageDescPage, RangeHdl_Impl, Control&, void)
void SvxPageDescPage::CalcMargin_Impl()
{
// current values for page margins
- long nBT = GetCoreValue( *m_pTopMarginEdit, MAP_TWIP );
- long nBB = GetCoreValue( *m_pBottomMarginEdit, MAP_TWIP );
+ long nBT = GetCoreValue( *m_pTopMarginEdit, MapUnit::MapTwip );
+ long nBB = GetCoreValue( *m_pBottomMarginEdit, MapUnit::MapTwip );
- long nBL = GetCoreValue( *m_pLeftMarginEdit, MAP_TWIP );
- long nBR = GetCoreValue( *m_pRightMarginEdit, MAP_TWIP );
+ long nBL = GetCoreValue( *m_pLeftMarginEdit, MapUnit::MapTwip );
+ long nBR = GetCoreValue( *m_pRightMarginEdit, MapUnit::MapTwip );
- long nH = GetCoreValue( *m_pPaperHeightEdit, MAP_TWIP );
- long nW = GetCoreValue( *m_pPaperWidthEdit, MAP_TWIP );
+ long nH = GetCoreValue( *m_pPaperHeightEdit, MapUnit::MapTwip );
+ long nW = GetCoreValue( *m_pPaperWidthEdit, MapUnit::MapTwip );
long nWidth = nBL + nBR + MINBODY;
long nHeight = nBT + nBB + MINBODY;
@@ -1560,9 +1560,9 @@ void SvxPageDescPage::CalcMargin_Impl()
nTmp -= nWidth - nW;
if ( nBL <= nBR )
- SetMetricValue( *m_pRightMarginEdit, nTmp, MAP_TWIP );
+ SetMetricValue( *m_pRightMarginEdit, nTmp, MapUnit::MapTwip );
else
- SetMetricValue( *m_pLeftMarginEdit, nTmp, MAP_TWIP );
+ SetMetricValue( *m_pLeftMarginEdit, nTmp, MapUnit::MapTwip );
}
if ( nHeight > nH )
@@ -1571,9 +1571,9 @@ void SvxPageDescPage::CalcMargin_Impl()
nTmp -= nHeight - nH;
if ( nBT <= nBB )
- SetMetricValue( *m_pBottomMarginEdit, nTmp, MAP_TWIP );
+ SetMetricValue( *m_pBottomMarginEdit, nTmp, MapUnit::MapTwip );
else
- SetMetricValue( *m_pTopMarginEdit, nTmp, MAP_TWIP );
+ SetMetricValue( *m_pTopMarginEdit, nTmp, MapUnit::MapTwip );
}
}
}
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 1266cc67d36c..55a080c66d2d 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -365,7 +365,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
if ( bNullTab )
{
MapUnit eUnit = (MapUnit)pPool->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
- if ( MAP_100TH_MM != eUnit )
+ if ( MapUnit::Map100thMM != eUnit )
{
// negative first line indent -> set null default tabstob if applicable
@@ -837,7 +837,7 @@ IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox&, rBox, void )
// if the value has been changed at SetMin,
// it is time for the default
if ( m_pLineDistAtMetricBox->GetValue() != nTemp )
- SetMetricValue( *m_pLineDistAtMetricBox, FIX_DIST_DEF, MAP_TWIP ); // fix is only in Writer
+ SetMetricValue( *m_pLineDistAtMetricBox, FIX_DIST_DEF, MapUnit::MapTwip ); // fix is only in Writer
m_pLineDistAtPercentBox->Hide();
m_pLineDistAtMetricBox->Show();
m_pLineDistAtMetricBox->Enable();
@@ -908,7 +908,7 @@ void SvxStdParagraphTabPage::UpdateExample_Impl()
case LLINESPACE_DURCH:
case LLINESPACE_FIX:
m_pExampleWin->SetLineSpace( (SvxPrevLineSpace)nPos,
- (sal_uInt16)GetCoreValue( *m_pLineDistAtMetricBox, MAP_TWIP ) );
+ (sal_uInt16)GetCoreValue( *m_pLineDistAtMetricBox, MapUnit::MapTwip ) );
break;
}
m_pExampleWin->Invalidate();
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 477ac3bce31a..239406398e9f 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -224,7 +224,7 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet)
MapUnit eUnit = (MapUnit)pPool->GetMetric(GetWhich(SID_ATTR_TABSTOP));
const SfxPoolItem* pOld = GetOldItem(*rSet, SID_ATTR_TABSTOP);
- if (MAP_100TH_MM != eUnit)
+ if (MapUnit::Map100thMM != eUnit)
{
// If the ItemSet contains a LRSpaceItem with negative first line indent,
// the TabStopItem needs to have a DefTab at position 0.
@@ -245,7 +245,7 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet)
for (sal_uInt16 i = 0; i < aNewTabs.Count(); ++i)
{
SvxTabStop aTmpStop = aNewTabs[i];
- aTmpStop.GetTabPos() = LogicToLogic(aTmpStop.GetTabPos(), MAP_100TH_MM, eUnit);
+ aTmpStop.GetTabPos() = LogicToLogic(aTmpStop.GetTabPos(), MapUnit::Map100thMM, eUnit);
aTmp.Insert(aTmpStop);
}
@@ -278,7 +278,7 @@ void SvxTabulatorTabPage::Reset(const SfxItemSet* rSet)
if (pItem)
{
- if (MAP_100TH_MM != eUnit)
+ if (MapUnit::Map100thMM != eUnit)
{
SvxTabStopItem aTmp(*static_cast<const SvxTabStopItem*>(pItem));
aNewTabs.Remove(0, aNewTabs.Count());
@@ -286,7 +286,7 @@ void SvxTabulatorTabPage::Reset(const SfxItemSet* rSet)
for (sal_uInt16 i = 0; i < aTmp.Count(); ++i)
{
SvxTabStop aTmpStop = aTmp[i];
- aTmpStop.GetTabPos() = LogicToLogic(aTmpStop.GetTabPos(), eUnit, MAP_100TH_MM);
+ aTmpStop.GetTabPos() = LogicToLogic(aTmpStop.GetTabPos(), eUnit, MapUnit::Map100thMM);
aNewTabs.Insert(aTmpStop);
}
}
@@ -301,7 +301,7 @@ void SvxTabulatorTabPage::Reset(const SfxItemSet* rSet)
pItem = GetItem(*rSet, SID_ATTR_TABSTOP_DEFAULTS);
if (pItem)
- nDefDist = LogicToLogic(long(static_cast<const SfxUInt16Item*>(pItem)->GetValue()), eUnit, MAP_100TH_MM);
+ nDefDist = LogicToLogic(long(static_cast<const SfxUInt16Item*>(pItem)->GetValue()), eUnit, MapUnit::Map100thMM);
// Tab pos currently selected
sal_uInt16 nTabPos = 0;
@@ -373,7 +373,7 @@ void SvxTabulatorTabPage::InitTabPos_Impl( sal_uInt16 nTabPos )
{
nOffset = static_cast<const SfxInt32Item*>(pItem)->GetValue();
MapUnit eUnit = (MapUnit)GetItemSet().GetPool()->GetMetric(GetWhich(SID_ATTR_TABSTOP));
- nOffset = OutputDevice::LogicToLogic(nOffset, eUnit, MAP_100TH_MM);
+ nOffset = OutputDevice::LogicToLogic(nOffset, eUnit, MapUnit::Map100thMM);
}
// Correct current TabPos and default tabs
@@ -479,7 +479,7 @@ IMPL_LINK( SvxTabulatorTabPage, NewHdl_Impl, Button *, pBtn, void )
{
nOffset = static_cast<const SfxInt32Item*>(pItem)->GetValue();
MapUnit eUnit = (MapUnit)GetItemSet().GetPool()->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
- nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MAP_100TH_MM );
+ nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MapUnit::Map100thMM );
}
const long nReal = nVal - nOffset;
sal_Int32 nSize = m_pTabBox->GetEntryCount();
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index a9022678b390..d89945dbd8e3 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -137,7 +137,7 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
m_pCtlXRectPreview->EnableRTL(false);
// Calculate size of dropdown listboxes
- Size aSize = LogicToPixel(Size(108, 103), MAP_APPFONT);
+ Size aSize = LogicToPixel(Size(108, 103), MapUnit::MapAppFont);
m_pLbColor->set_width_request(aSize.Width());
m_pLbColor->set_height_request(aSize.Height());
@@ -151,7 +151,7 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
m_pLbBitmap->set_height_request(aSize.Height());
// Calculate size of display boxes
- Size aSize2 = LogicToPixel(Size(110, 42), MAP_APPFONT);
+ Size aSize2 = LogicToPixel(Size(110, 42), MapUnit::MapAppFont);
m_pCtlBitmapPreview->set_width_request(aSize2.Width());
m_pCtlBitmapPreview->set_height_request(aSize2.Height());
m_pCtlXRectPreview->set_width_request(aSize2.Width());
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 5265f34fbb12..55f8ea55a82e 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -298,12 +298,12 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
pItem = GetItem( rGeoAttr, SID_ATTR_TRANSFORM_WIDTH );
m_fObjectWidth = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 );
- double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(m_fObjectWidth),(MapUnit)mePoolUnit, MAP_100TH_MM )) / fUIScale);
+ double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(m_fObjectWidth), mePoolUnit, MapUnit::Map100thMM )) / fUIScale);
m_fObjectWidth = fTmpWidth;
pItem = GetItem( rGeoAttr, SID_ATTR_TRANSFORM_HEIGHT );
m_fObjectHeight = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 );
- double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(m_fObjectHeight),(MapUnit)mePoolUnit, MAP_100TH_MM )) / fUIScale);
+ double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(m_fObjectHeight), mePoolUnit, MapUnit::Map100thMM )) / fUIScale);
m_fObjectHeight = fTmpHeight;
XFillBitmapItem aItem( static_cast<const XFillBitmapItem&>(rAttrs->Get(XATTR_FILLBITMAP)) );
@@ -324,8 +324,8 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
{
BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
Size aTempBitmapSize = aBmpEx.GetSizePixel();
- rBitmapSize.Width() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MAP_PIXEL, MAP_100TH_MM )) / fUIScale);
- rBitmapSize.Height() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MAP_PIXEL, MAP_100TH_MM )) / fUIScale);
+ rBitmapSize.Width() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale);
+ rBitmapSize.Height() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale);
CalculateBitmapPresetSize();
}
@@ -376,8 +376,8 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
if(eRelative != TRISTATE_TRUE)
{
- nWidth = (OutputDevice::LogicToLogic(static_cast<long>(nWidth),(MapUnit)mePoolUnit, MAP_100TH_MM )) / fUIScale;
- nHeight = (OutputDevice::LogicToLogic(static_cast<long>(nHeight),(MapUnit)mePoolUnit, MAP_100TH_MM )) / fUIScale;
+ nWidth = (OutputDevice::LogicToLogic(static_cast<long>(nWidth), mePoolUnit, MapUnit::Map100thMM )) / fUIScale;
+ nHeight = (OutputDevice::LogicToLogic(static_cast<long>(nHeight), mePoolUnit, MapUnit::Map100thMM )) / fUIScale;
}
if(m_pBitmapStyleLB->GetSelectEntryPos() == 0)
@@ -537,8 +537,8 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void)
Size aTempBitmapSize = aBmpEx.GetSizePixel();
const double fUIScale(double(mpView->GetModel()->GetUIScale()));
- rBitmapSize.Width() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MAP_PIXEL, MAP_100TH_MM )) / fUIScale);
- rBitmapSize.Height() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MAP_PIXEL, MAP_100TH_MM )) / fUIScale);
+ rBitmapSize.Width() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale);
+ rBitmapSize.Height() = ((OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale);
CalculateBitmapPresetSize();
ModifyBitmapStyleHdl( *m_pBitmapStyleLB );
ModifyBitmapPositionHdl( *m_pPositionLB );
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index d0335f325bee..36abaf503b79 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -72,13 +72,13 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
{
get(m_pSelectPalette, "paletteselector");
get(m_pValSetColorList, "colorset");
- Size aSize = LogicToPixel(Size(100 , 120), MAP_APPFONT);
+ Size aSize = LogicToPixel(Size(100 , 120), MapUnit::MapAppFont);
m_pValSetColorList->set_width_request(aSize.Width());
m_pValSetColorList->set_height_request(aSize.Height());
get(m_pValSetRecentList, "recentcolorset");
get(m_pCtlPreviewOld, "oldpreview");
get(m_pCtlPreviewNew, "newpreview");
- aSize = LogicToPixel(Size(34 , 25), MAP_APPFONT);
+ aSize = LogicToPixel(Size(34 , 25), MapUnit::MapAppFont);
m_pCtlPreviewOld->set_width_request(aSize.Width());
m_pCtlPreviewOld->set_height_request(aSize.Height());
m_pCtlPreviewNew->set_width_request(aSize.Width());
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 6b5ade69f9eb..43f51a5485fd 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -353,7 +353,7 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && m_pSymbolList)
{
ScopedVclPtrInstance< VirtualDevice > pVDev;
- pVDev->SetMapMode(MapMode(MAP_100TH_MM));
+ pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
std::unique_ptr<SdrModel> pModel(new SdrModel);
pModel->GetItemPool().FreezeIdRanges();
// Page
@@ -498,7 +498,7 @@ void SvxLineTabPage::SymbolSelected(MenuButton* pButton)
if(pGraphic)
{
Size aSize = SvxNumberFormat::GetGraphicSizeMM100(pGraphic);
- aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)m_ePoolUnit);
+ aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, (MapUnit)m_ePoolUnit);
m_aSymbolGraphic=*pGraphic;
if( bResetSize )
{
@@ -1134,7 +1134,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
else if(nSymType >= 0)
{
ScopedVclPtrInstance< VirtualDevice > pVDev;
- pVDev->SetMapMode(MapMode(MAP_100TH_MM));
+ pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
std::unique_ptr<SdrModel> pModel(new SdrModel);
pModel->GetItemPool().FreezeIdRanges();
@@ -1181,7 +1181,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
m_aSymbolGraphic=Graphic(aMeta);
m_aSymbolSize=pObj->GetSnapRect().GetSize();
m_aSymbolGraphic.SetPrefSize(pInvisibleSquare->GetSnapRect().GetSize());
- m_aSymbolGraphic.SetPrefMapMode(MAP_100TH_MM);
+ m_aSymbolGraphic.SetPrefMapMode(MapUnit::Map100thMM);
bPrevSym=true;
bEnable=true;
bIgnoreGraphic=true;
@@ -1209,7 +1209,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
{
m_aSymbolSize=OutputDevice::LogicToLogic( pGraphic->GetPrefSize(),
pGraphic->GetPrefMapMode(),
- MAP_100TH_MM );
+ MapUnit::Map100thMM );
}
bPrevSym=true;
}
@@ -1733,8 +1733,8 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, Edit&, rField, void)
bool bRatio = m_pSymbolRatioCB->IsChecked();
long nWidthVal = static_cast<long>(m_pSymbolWidthMF->Denormalize(m_pSymbolWidthMF->GetValue(FUNIT_100TH_MM)));
long nHeightVal= static_cast<long>(m_pSymbolHeightMF->Denormalize(m_pSymbolHeightMF->GetValue(FUNIT_100TH_MM)));
- nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MAP_100TH_MM,(MapUnit)m_ePoolUnit );
- nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MAP_100TH_MM,(MapUnit)m_ePoolUnit);
+ nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MapUnit::Map100thMM,(MapUnit)m_ePoolUnit );
+ nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MapUnit::Map100thMM,(MapUnit)m_ePoolUnit);
m_aSymbolSize = Size(nWidthVal,nHeightVal);
double fSizeRatio = (double)1;
@@ -1753,7 +1753,7 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, Edit&, rField, void)
if (bRatio)
{
m_aSymbolSize.Height() = m_aSymbolLastSize.Height() + (long)((double)nDelta / fSizeRatio);
- m_aSymbolSize.Height() = OutputDevice::LogicToLogic( m_aSymbolSize.Height(),(MapUnit)m_ePoolUnit, MAP_100TH_MM );
+ m_aSymbolSize.Height() = OutputDevice::LogicToLogic( m_aSymbolSize.Height(),(MapUnit)m_ePoolUnit, MapUnit::Map100thMM );
m_pSymbolHeightMF->SetUserValue(m_pSymbolHeightMF->Normalize(m_aSymbolSize.Height()), FUNIT_100TH_MM);
}
}
@@ -1764,7 +1764,7 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, Edit&, rField, void)
if (bRatio)
{
m_aSymbolSize.Width() = m_aSymbolLastSize.Width() + (long)((double)nDelta * fSizeRatio);
- m_aSymbolSize.Width() = OutputDevice::LogicToLogic( m_aSymbolSize.Width(), (MapUnit)m_ePoolUnit, MAP_100TH_MM );
+ m_aSymbolSize.Width() = OutputDevice::LogicToLogic( m_aSymbolSize.Width(), (MapUnit)m_ePoolUnit, MapUnit::Map100thMM );
m_pSymbolWidthMF->SetUserValue(m_pSymbolWidthMF->Normalize(m_aSymbolSize.Width()), FUNIT_100TH_MM);
}
}
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index d673aa64725a..98d1f9b765f4 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -900,8 +900,8 @@ void SvxPositionSizeTabPage::Construct()
// take UI units into account
const sal_uInt16 nDigits(m_pMtrPosX->GetDecimalDigits());
- TransfrmHelper::ConvertRect( maWorkRange, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
- TransfrmHelper::ConvertRect( maRange, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
+ TransfrmHelper::ConvertRect( maWorkRange, nDigits, mePoolUnit, meDlgUnit );
+ TransfrmHelper::ConvertRect( maRange, nDigits, mePoolUnit, meDlgUnit );
SetMinMaxPosition();
}
@@ -969,14 +969,14 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
double nWidth = static_cast<double>(m_pMtrWidth->GetValue( meDlgUnit ));
nWidth = MetricField::ConvertDoubleValue( nWidth, m_pMtrWidth->GetBaseValue(), m_pMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
long lWidth = long(nWidth * (double)aUIScale);
- lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit );
+ lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit );
lWidth = static_cast<long>(m_pMtrWidth->Denormalize( lWidth ));
// get Height
double nHeight = static_cast<double>(m_pMtrHeight->GetValue( meDlgUnit ));
nHeight = MetricField::ConvertDoubleValue( nHeight, m_pMtrHeight->GetBaseValue(), m_pMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
long lHeight = long(nHeight * (double)aUIScale);
- lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit );
+ lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit );
lHeight = static_cast<long>(m_pMtrHeight->Denormalize( lHeight ));
// put Width & Height to itemset
@@ -1073,7 +1073,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
{ // #i75273# set width
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH );
mfOldWidth = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 );
- double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale);
+ double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
if(m_pMtrWidth->GetDecimalDigits())
fTmpWidth *= pow(10.0, m_pMtrWidth->GetDecimalDigits());
@@ -1085,7 +1085,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
{ // #i75273# set height
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT );
mfOldHeight = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 );
- double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale);
+ double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
if(m_pMtrHeight->GetDecimalDigits())
fTmpHeight *= pow(10.0, m_pMtrHeight->GetDecimalDigits());
@@ -1310,7 +1310,7 @@ void SvxPositionSizeTabPage::SetMinMaxPosition()
}
}
- const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MAP_100TH_MM, meDlgUnit ) - 1L));
+ const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1L));
fLeft = basegfx::clamp(fLeft, -fMaxLong, fMaxLong);
fRight = basegfx::clamp(fRight, -fMaxLong, fMaxLong);
fTop = basegfx::clamp(fTop, - fMaxLong, fMaxLong);
diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
index ab736b1ad026..ad6916f1b6af 100644
--- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
@@ -137,7 +137,7 @@ namespace dbmm
declarePath( PATH_DEFAULT, {STATE_CLOSE_SUB_DOCS, STATE_BACKUP_DBDOC, STATE_MIGRATE, STATE_SUMMARY} );
- SetPageSizePixel( LogicToPixel( ::Size( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ), MAP_APPFONT ) );
+ SetPageSizePixel( LogicToPixel( ::Size( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ), MapUnit::MapAppFont ) );
SetRoadmapInteractive( true );
enableAutomaticNextButtonState();
defaultButton( WizardButtonFlags::NEXT );
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 2b2867ec23c6..74706f5a3889 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -929,7 +929,7 @@ void OAppDetailPageHelper::Resize()
vcl::Window* pWindow = getCurrentView();
if ( pWindow )
{
- Size aFLSize = LogicToPixel( Size( 2, 6 ), MAP_APPFONT );
+ Size aFLSize = LogicToPixel( Size( 2, 6 ), MapUnit::MapAppFont );
sal_Int32 n6PPT = aFLSize.Height();
long nHalfOutputWidth = static_cast<long>(nOutputWidth * 0.5);
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index dfa9c280ea2d..d19fca85ccc7 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -444,7 +444,7 @@ void OTasksWindow::Resize()
long nOutputWidth = aOutputSize.Width();
long nOutputHeight = aOutputSize.Height();
- Size aFLSize = LogicToPixel( Size( 2, 6 ), MAP_APPFONT );
+ Size aFLSize = LogicToPixel( Size( 2, 6 ), MapUnit::MapAppFont );
sal_Int32 n6PPT = aFLSize.Height();
long nHalfOutputWidth = static_cast<long>(nOutputWidth * 0.5);
@@ -542,7 +542,7 @@ OApplicationDetailView::OApplicationDetailView(OAppBorderWindow& _rParent,Previe
m_aContainer->Show();
- const long nFrameWidth = LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width();
+ const long nFrameWidth = LogicToPixel( Size( 3, 0 ), MapUnit::MapAppFont ).Width();
m_aHorzSplitter->SetPosSizePixel( Point(0,50), Size(0,nFrameWidth) );
// now set the components at the base class
set(m_aContainer.get(),m_aTasks.get());
diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx
index 644b846b86ae..084d79d56e56 100644
--- a/dbaccess/source/ui/app/AppSwapWindow.cxx
+++ b/dbaccess/source/ui/app/AppSwapWindow.cxx
@@ -63,7 +63,7 @@ void OApplicationSwapWindow::dispose()
void OApplicationSwapWindow::Resize()
{
- Size aFLSize = LogicToPixel( Size( 8, 0 ), MAP_APPFONT );
+ Size aFLSize = LogicToPixel( Size( 8, 0 ), MapUnit::MapAppFont );
long nX = 0;
if ( m_aIconControl->GetEntryCount() != 0 )
nX = m_aIconControl->GetBoundingBox( m_aIconControl->GetEntry(0) ).GetWidth() + aFLSize.Width();
diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx
index 7c89754c0da0..d11608cfcdd5 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.cxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.cxx
@@ -83,7 +83,7 @@ void OTitleWindow::Resize()
long nOutputWidth = aOutputSize.Width();
long nOutputHeight = aOutputSize.Height();
- Size aTextSize = LogicToPixel( Size( 6, 3 ), MAP_APPFONT );
+ Size aTextSize = LogicToPixel( Size( 6, 3 ), MapUnit::MapAppFont );
sal_Int32 nXOffset = aTextSize.Width();
sal_Int32 nYOffset = aTextSize.Height();
sal_Int32 nHeight = GetTextHeight() + 2*nYOffset;
@@ -118,7 +118,7 @@ void OTitleWindow::GetFocus()
long OTitleWindow::GetWidthPixel() const
{
- Size aTextSize = LogicToPixel( Size( 12, 0 ), MAP_APPFONT );
+ Size aTextSize = LogicToPixel( Size( 12, 0 ), MapUnit::MapAppFont );
sal_Int32 nWidth = GetTextWidth(m_aTitle->GetText()) + 2*aTextSize.Width();
return nWidth;
diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx
index cb07e831cda7..fdb2f078a478 100644
--- a/dbaccess/source/ui/app/AppView.cxx
+++ b/dbaccess/source/ui/app/AppView.cxx
@@ -113,7 +113,7 @@ void OAppBorderWindow::Resize()
long nOutputHeight = aOutputSize.Height();
long nX = 0;
- Size aFLSize = LogicToPixel( Size( 3, 8 ), MAP_APPFONT );
+ Size aFLSize = LogicToPixel( Size( 3, 8 ), MapUnit::MapAppFont );
if ( m_pPanel )
{
OApplicationSwapWindow* pSwap = getPanel();
@@ -244,7 +244,7 @@ void OApplicationView::resizeDocumentView(Rectangle& _rPlayground)
{
if ( m_pWin && !_rPlayground.IsEmpty() )
{
- Size aFLSize = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
+ Size aFLSize = LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont );
_rPlayground.Move( aFLSize.A(),aFLSize.B() );
Size aOldSize = _rPlayground.GetSize();
_rPlayground.SetSize( Size(aOldSize.A() - 2*aFLSize.A(), aOldSize.B() - 2*aFLSize.B()) );
diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx
index d041f10fcec4..f40bcf13f009 100644
--- a/dbaccess/source/ui/browser/brwview.cxx
+++ b/dbaccess/source/ui/browser/brwview.cxx
@@ -215,7 +215,7 @@ void UnoDataBrowserView::resizeDocumentView(Rectangle& _rPlayground)
if (m_pStatus && m_pStatus->IsVisible())
{
Size aStatusSize(aPlaygroundPos.X(), GetTextHeight() + 2);
- aStatusSize = LogicToPixel(aStatusSize, MAP_APPFONT);
+ aStatusSize = LogicToPixel(aStatusSize, MapUnit::MapAppFont);
aStatusSize.Width() = aTreeViewSize.Width() - 2 - 2;
Point aStatusPos( aPlaygroundPos.X() + 2, aTreeViewPos.Y() + aTreeViewSize.Height() - aStatusSize.Height() );
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index da2d7c9d275c..f42a38633b91 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -348,7 +348,7 @@ bool SbaTableQueryBrowser::Construct(vcl::Window* pParent)
{
// create controls and set sizes
- const long nFrameWidth = getBrowserView()->LogicToPixel( ::Size( 3, 0 ), MAP_APPFONT ).Width();
+ const long nFrameWidth = getBrowserView()->LogicToPixel( ::Size( 3, 0 ), MapUnit::MapAppFont ).Width();
m_pSplitter = VclPtr<Splitter>::Create(getBrowserView(),WB_HSCROLL);
m_pSplitter->SetPosSizePixel( ::Point(0,0), ::Size(nFrameWidth,0) );
@@ -364,7 +364,7 @@ bool SbaTableQueryBrowser::Construct(vcl::Window* pParent)
m_pTreeView->SetHelpId(HID_CTL_TREEVIEW);
// a default pos for the splitter, so that the listbox is about 80 (logical) pixels wide
- m_pSplitter->SetSplitPosPixel( getBrowserView()->LogicToPixel( ::Size( 80, 0 ), MAP_APPFONT ).Width() );
+ m_pSplitter->SetSplitPosPixel( getBrowserView()->LogicToPixel( ::Size( 80, 0 ), MapUnit::MapAppFont ).Width() );
getBrowserView()->setSplitter(m_pSplitter);
getBrowserView()->setTreeView(m_pTreeView);
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index b9735ec0c03b..812c2049a622 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -290,7 +290,7 @@ void OFieldDescControl::CheckScrollBars()
// Which one is the last one that fits?
sal_uInt16 nLastVisible;
const sal_Int32 nControlHeight = GetMaxControlHeight();
- const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height();
+ const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MapUnit::MapAppFont).Height();
if (bNeedHScrollBar)
nLastVisible = static_cast<sal_uInt16>((szOverallSize.Height() - nControl_Spacing_y - nHScrollHeight) / (nControl_Spacing_y + nControlHeight));
else
@@ -369,7 +369,7 @@ void OFieldDescControl::ScrollAllAggregates()
if (m_nOldVThumb != m_pVertScroll->GetThumbPos())
{
const sal_Int32 nControlHeight = GetMaxControlHeight();
- const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height();
+ const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MapUnit::MapAppFont).Height();
nDeltaY = (m_nOldVThumb - m_pVertScroll->GetThumbPos()) * (nControl_Spacing_y + nControlHeight);
m_nOldVThumb = m_pVertScroll->GetThumbPos();
}
@@ -994,7 +994,7 @@ void OFieldDescControl::SetPosSize( VclPtr<Control>& rControl, long nRow, sal_uI
const sal_Int32 nControlHeight = GetMaxControlHeight();
Size aSize(0,nControlHeight);
if ( isRightAligned() && nCol )
- aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width();
+ aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MapUnit::MapAppFont).Width();
else
{
switch( nCol )
@@ -1041,7 +1041,7 @@ void OFieldDescControl::SetPosSize( VclPtr<Control>& rControl, long nRow, sal_uI
rControl->SetSizePixel( aSize );
aSize = rControl->GetSizePixel( );
- const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height();
+ const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MapUnit::MapAppFont).Height();
aPosition.Y() += ((nRow+1)*nControl_Spacing_y) +
(nRow*nControlHeight);
diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx
index ea6987518c1e..f996db591258 100644
--- a/dbaccess/source/ui/control/RelationControl.cxx
+++ b/dbaccess/source/ui/control/RelationControl.cxx
@@ -435,7 +435,7 @@ namespace dbaui
Size ORelationControl::GetOptimalSize() const
{
- return LogicToPixel(Size(140, 80), MAP_APPFONT);
+ return LogicToPixel(Size(140, 80), MapUnit::MapAppFont);
}
// class OTableListBoxControl
diff --git a/dbaccess/source/ui/control/VertSplitView.cxx b/dbaccess/source/ui/control/VertSplitView.cxx
index 45e11a6c20e1..57a61ecbcb8e 100644
--- a/dbaccess/source/ui/control/VertSplitView.cxx
+++ b/dbaccess/source/ui/control/VertSplitView.cxx
@@ -156,7 +156,7 @@ void OSplitterView::setSplitter(Splitter* _pSplitter)
m_pSplitter = _pSplitter;
if ( m_pSplitter )
{
- m_pSplitter->SetSplitPosPixel( LogicToPixel( Size( SPLITTER_WIDTH, 0 ), MAP_APPFONT ).Width() );
+ m_pSplitter->SetSplitPosPixel( LogicToPixel( Size( SPLITTER_WIDTH, 0 ), MapUnit::MapAppFont ).Width() );
m_pSplitter->SetSplitHdl( LINK(this, OSplitterView, SplitHdl) );
m_pSplitter->Show();
LINK( this, OSplitterView, SplitHdl ).Call(m_pSplitter);
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index 0a5f62e811bb..2b3100c3a460 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -278,7 +278,7 @@ namespace dbaui
aReference.Y() += _rReference.GetSizePixel().Height();
const vcl::Window* pConverter = _rControl.GetParent();
- Size aOffset = pConverter->LogicToPixel( Size( _nIndentAppFont, ( _eRelation == RelatedControls ? 3 : 6 ) ), MAP_APPFONT );
+ Size aOffset = pConverter->LogicToPixel( Size( _nIndentAppFont, ( _eRelation == RelatedControls ? 3 : 6 ) ), MapUnit::MapAppFont );
Point aControlPos( aReference.X() + aOffset.Width(), aReference.Y() + aOffset.Height() );
_rControl.SetPosPixel( aControlPos );
diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx
index 71e5f26e9b18..1aa01c2182c0 100644
--- a/dbaccess/source/ui/dlg/adtabdlg.cxx
+++ b/dbaccess/source/ui/dlg/adtabdlg.cxx
@@ -322,7 +322,7 @@ OAddTableDlg::OAddTableDlg( vcl::Window* pParent, IAddTableDialogContext& _rCont
get(m_pTableList, "tablelist");
get(m_pQueryList, "querylist");
- Size aSize(LogicToPixel(Size(106 , 122), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(106 , 122), MapUnit::MapAppFont));
m_pTableList->set_height_request(aSize.Height());
m_pTableList->set_width_request(aSize.Width());
get(m_pQueryList, "querylist");
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index 3ed234ce954d..2495ff2316df 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -50,7 +50,7 @@ ODbaseIndexDialog::ODbaseIndexDialog(vcl::Window * pParent, const OUString& aDat
get(m_pIndexes, "frame");
get(m_pLB_TableIndexes, "tableindex");
get(m_pLB_FreeIndexes, "freeindex");
- Size aSize(LogicToPixel(Size(76, 98), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(76, 98), MapUnit::MapAppFont));
m_pLB_TableIndexes->set_height_request(aSize.Height());
m_pLB_TableIndexes->set_width_request(aSize.Width());
m_pLB_FreeIndexes->set_height_request(aSize.Height());
diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx
index 2062b4269d4f..3eb5c8055dfc 100644
--- a/dbaccess/source/ui/dlg/dbwiz.cxx
+++ b/dbaccess/source/ui/dlg/dbwiz.cxx
@@ -78,7 +78,7 @@ ODbTypeWizDialog::ODbTypeWizDialog(vcl::Window* _pParent
m_pImpl->translateProperties(xDatasource, *m_pOutSet);
m_eType = dbaui::ODbDataSourceAdministrationHelper::getDatasourceType(*m_pOutSet);
- SetPageSizePixel(LogicToPixel(::Size(PAGE_X, PAGE_Y), MAP_APPFONT));
+ SetPageSizePixel(LogicToPixel(::Size(PAGE_X, PAGE_Y), MapUnit::MapAppFont));
defaultButton(WizardButtonFlags::NEXT);
enableButtons(WizardButtonFlags::FINISH, false);
enableAutomaticNextButtonState();
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 3e1c2200216b..523a0a314090 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -145,7 +145,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent
m_pImpl->translateProperties(xDatasource, *m_pOutSet);
- SetPageSizePixel(LogicToPixel(::Size(WIZARD_PAGE_X, WIZARD_PAGE_Y), MAP_APPFONT));
+ SetPageSizePixel(LogicToPixel(::Size(WIZARD_PAGE_X, WIZARD_PAGE_Y), MapUnit::MapAppFont));
defaultButton(WizardButtonFlags::NEXT);
enableButtons(WizardButtonFlags::FINISH, true);
enableAutomaticNextButtonState();
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index 53ecfa10e867..d2758b0d51ac 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -193,7 +193,7 @@ namespace dbaui
maLcResetCmdImg = get<FixedImage>("image5")->GetImage();
get(m_pIndexList, "INDEX_LIST");
- Size aSize(LogicToPixel(Size(70, 97), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(70, 97), MapUnit::MapAppFont));
m_pIndexList->set_width_request(aSize.Width());
m_pIndexList->set_height_request(aSize.Height());
get(m_pIndexDetails, "INDEX_DETAILS");
@@ -202,7 +202,7 @@ namespace dbaui
get(m_pUnique, "UNIQUE");
get(m_pFieldsLabel, "FIELDS_LABEL");
get(m_pFields, "FIELDS");
- aSize = LogicToPixel(Size(128, 61), MAP_APPFONT);
+ aSize = LogicToPixel(Size(128, 61), MapUnit::MapAppFont);
m_pFields->set_width_request(aSize.Width());
m_pFields->set_height_request(aSize.Height());
get(m_pClose, "close");
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index 3a5cd53d4c82..2d4660d03f3e 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -303,11 +303,11 @@ OExceptionChainDialog::OExceptionChainDialog(vcl::Window* pParent, const Excepti
, m_aExceptions(_rExceptions)
{
get(m_pExceptionList, "list");
- Size aListSize(LogicToPixel(Size(85, 93), MAP_APPFONT));
+ Size aListSize(LogicToPixel(Size(85, 93), MapUnit::MapAppFont));
m_pExceptionList->set_width_request(aListSize.Width());
m_pExceptionList->set_height_request(aListSize.Height());
get(m_pExceptionText, "description");
- Size aTextSize(LogicToPixel(Size(125 , 93), MAP_APPFONT));
+ Size aTextSize(LogicToPixel(Size(125 , 93), MapUnit::MapAppFont));
m_pExceptionText->set_width_request(aTextSize.Width());
m_pExceptionText->set_height_request(aTextSize.Height());
@@ -398,8 +398,8 @@ namespace
{
void lcl_positionInAppFont( const vcl::Window& _rParent, vcl::Window& _rChild, long _nX, long _nY, long Width, long Height )
{
- Point aPos = _rParent.LogicToPixel( Point( _nX, _nY ), MAP_APPFONT );
- Size aSize = _rParent.LogicToPixel( Size( Width, Height ), MAP_APPFONT );
+ Point aPos = _rParent.LogicToPixel( Point( _nX, _nY ), MapUnit::MapAppFont );
+ Size aSize = _rParent.LogicToPixel( Size( Width, Height ), MapUnit::MapAppFont );
_rChild.SetPosSizePixel( aPos, aSize );
}
@@ -512,8 +512,8 @@ void OSQLMessageBox::impl_positionControls()
// adjust dialog size accordingly
const Rectangle& rBottomTextRect( bHaveSecondaryText ? aSecondaryRect : aPrimaryRect );
- Size aBorderSize = LogicToPixel( Size( OUTER_MARGIN, OUTER_MARGIN ), MAP_APPFONT );
- Size aDialogSize( LogicToPixel( Size( DIALOG_WIDTH, 30 ), MAP_APPFONT ) );
+ Size aBorderSize = LogicToPixel( Size( OUTER_MARGIN, OUTER_MARGIN ), MapUnit::MapAppFont );
+ Size aDialogSize( LogicToPixel( Size( DIALOG_WIDTH, 30 ), MapUnit::MapAppFont ) );
aDialogSize.Height() = rBottomTextRect.Bottom() + aBorderSize.Height();
aDialogSize.Width() = aPrimaryRect.Right() + aBorderSize.Width();
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 430e703cc525..35ba9385d185 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -821,7 +821,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
};
SfxItemPool* pPool = new SfxItemPool(OUString("GridBrowserProperties"), SBA_DEF_RANGEFORMAT, SBA_ATTR_ALIGN_HOR_JUSTIFY, aItemInfos, pDefaults);
- pPool->SetDefaultMetric( MAP_TWIP ); // ripped, don't understand why
+ pPool->SetDefaultMetric( MapUnit::MapTwip ); // ripped, don't understand why
pPool->FreezeIdRanges(); // the same
std::unique_ptr<SfxItemSet> pFormatDescriptor(new SfxItemSet(*pPool, aAttrMap));
@@ -990,11 +990,11 @@ void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId
sal_uInt32 nDefaultWidth = _pBox->GetDefaultColumnWidth( _pBox->GetColumnTitle( _nColId ) );
if ( nDefaultWidth != _pBox->GetColumnWidth( _nColId ) )
{
- Size aSizeMM = _pBox->PixelToLogic( Size( _pBox->GetColumnWidth( _nColId ), 0 ), MapMode( MAP_MM ) );
+ Size aSizeMM = _pBox->PixelToLogic( Size( _pBox->GetColumnWidth( _nColId ), 0 ), MapMode( MapUnit::MapMM ) );
nColSize = aSizeMM.Width() * 10;
}
- Size aDefaultMM = _pBox->PixelToLogic( Size( nDefaultWidth, 0 ), MapMode( MAP_MM ) );
+ Size aDefaultMM = _pBox->PixelToLogic( Size( nDefaultWidth, 0 ), MapMode( MapUnit::MapMM ) );
ScopedVclPtrInstance< DlgSize > aColumnSizeDlg( _pBox, nColSize, false, aDefaultMM.Width() * 10 );
if ( aColumnSizeDlg->Execute() )
@@ -1007,7 +1007,7 @@ void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId
else
{
Size aSizeMM( nValue / 10, 0 );
- nValue = _pBox->LogicToPixel( aSizeMM, MapMode( MAP_MM ) ).Width();
+ nValue = _pBox->LogicToPixel( aSizeMM, MapMode( MapUnit::MapMM ) ).Width();
}
_pBox->SetColumnWidth( _nColId, nValue );
}
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index cd473baa5a50..c7127dce6898 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -645,11 +645,11 @@ void OCopyTableWizard::construct()
AddButton( m_pbNext = VclPtr<PushButton>::Create(this, WB_TABSTOP));
AddButton( m_pbFinish = VclPtr<PushButton>::Create(this, WB_TABSTOP));
- m_pbHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
- m_pbCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
- m_pbPrev->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
- m_pbNext->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
- m_pbFinish->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
+ m_pbHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) );
+ m_pbCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) );
+ m_pbPrev->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) );
+ m_pbNext->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) );
+ m_pbFinish->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) );
m_pbPrev->SetText(ModuleRes(STR_WIZ_PB_PREV));
m_pbNext->SetText(ModuleRes(STR_WIZ_PB_NEXT));
diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
index f78cd420e7ba..2118643b32e5 100644
--- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
+++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
@@ -203,7 +203,7 @@ namespace dbaui
Size aSize = GetOutputSizePixel();
Size aBeamer(aSize.Width(),sal_Int32(aSize.Height()*0.33));
- const long nFrameHeight = LogicToPixel( Size( 0, 3 ), MAP_APPFONT ).Height();
+ const long nFrameHeight = LogicToPixel( Size( 0, 3 ), MapUnit::MapAppFont ).Height();
Point aPos(0,aBeamer.Height()+nFrameHeight);
m_pBeamer->SetPosSizePixel(Point(0,0),aBeamer);
diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx
index 7710a97be15b..97268bab13b9 100644
--- a/dbaccess/source/ui/querydesign/querydlg.cxx
+++ b/dbaccess/source/ui/querydesign/querydlg.cxx
@@ -55,7 +55,7 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent,
, m_xConnection(_xConnection)
{
get(m_pML_HelpText, "helptext");
- Size aSize(LogicToPixel(Size(179, 49), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(179, 49), MapUnit::MapAppFont));
//alternatively loop through the STR_QUERY_* strings with their STR_JOIN_TYPE_HINT
//suffix to find the longest entry at runtime
m_pML_HelpText->set_height_request(aSize.Height());
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index fd15aae69031..553f1f5c1e88 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -184,7 +184,7 @@ void ExtBoxWithBtns_Impl::InitFromDialog(ExtMgrDialog *pParentDialog)
m_pRemoveBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) );
Size aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
- MapMode( MAP_APPFONT ) );
+ MapMode( MapUnit::MapAppFont ) );
m_pOptionsBtn->SetSizePixel( aSize );
m_pEnableBtn->SetSizePixel( aSize );
m_pRemoveBtn->SetSizePixel( aSize );
@@ -1574,7 +1574,7 @@ ShowLicenseDialog::ShowLicenseDialog( vcl::Window * pParent,
: ModalDialog(pParent, "ShowLicenseDialog", "desktop/ui/showlicensedialog.ui")
{
get(m_pLicenseText, "textview");
- Size aSize(m_pLicenseText->LogicToPixel(Size(290, 170), MAP_APPFONT));
+ Size aSize(m_pLicenseText->LogicToPixel(Size(290, 170), MapUnit::MapAppFont));
m_pLicenseText->set_width_request(aSize.Width());
m_pLicenseText->set_height_request(aSize.Height());
m_pLicenseText->SetText(xPackage->getLicenseText());
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 375512bfc939..2eaef2913346 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -756,7 +756,7 @@ void ExtensionBox_Impl::Resize()
Size ExtensionBox_Impl::GetOptimalSize() const
{
- return LogicToPixel(Size(250, 150), MAP_APPFONT);
+ return LogicToPixel(Size(250, 150), MapUnit::MapAppFont);
}
VCL_BUILDER_DECL_FACTORY(ExtensionBox)
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index caf95d46c575..85ae2a080748 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -510,7 +510,7 @@ UpdateDialog::UpdateDialog(
get(m_pUpdate, "UPDATE_LABEL");
get(m_pContainer, "UPDATES_CONTAINER");
m_pUpdates = VclPtr<UpdateDialog::CheckListBox>::Create(m_pContainer, *this);
- Size aSize(LogicToPixel(Size(240, 51), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(240, 51), MapUnit::MapAppFont));
m_pUpdates->set_width_request(aSize.Width());
m_pUpdates->set_height_request(aSize.Height());
m_pUpdates->Show();
@@ -521,7 +521,7 @@ UpdateDialog::UpdateDialog(
get(m_pReleaseNotesLabel, "RELEASE_NOTES_LABEL");
get(m_pReleaseNotesLink, "RELEASE_NOTES_LINK");
get(m_pDescriptions, "DESCRIPTIONS");
- aSize = LogicToPixel(Size(240, 59), MAP_APPFONT);
+ aSize = LogicToPixel(Size(240, 59), MapUnit::MapAppFont);
m_pDescriptions->set_width_request(aSize.Width());
m_pDescriptions->set_height_request(aSize.Height());
get(m_pOk, "INSTALL");
diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx
index e94db4bb5f6b..6540181139db 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.cxx
@@ -216,7 +216,7 @@ LicenseDialogImpl::LicenseDialogImpl(
m_pArrow2->Show(false);
get(m_pLicense, "textview");
- Size aSize(m_pLicense->LogicToPixel(Size(290, 170), MAP_APPFONT));
+ Size aSize(m_pLicense->LogicToPixel(Size(290, 170), MapUnit::MapAppFont));
m_pLicense->set_width_request(aSize.Width());
m_pLicense->set_height_request(aSize.Height());
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 1092de8d796d..ef23f2194ede 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -176,7 +176,7 @@ namespace drawinglayer
{
const uno::Reference< rendering::XGraphicDevice > xGraphicDevice;
- aBitmapEx.SetPrefMapMode(MapMode(MAP_100TH_MM));
+ aBitmapEx.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
aBitmapEx.SetPrefSize(Size(basegfx::fround(fWidth), basegfx::fround(fHeight)));
XBitmap = vcl::unotools::xBitmapFromBitmapEx(xGraphicDevice, aBitmapEx);
}
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index 1367692b8f3c..6a62af0ad014 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -135,8 +135,8 @@ namespace drawinglayer
{ // #i93162# For painting the control setting a Zoom (using setZoom() at the xControlView)
// is needed to define the font size. Normally this is done in
// ViewObjectContactOfUnoControl::createPrimitive2DSequence by using positionControlForPaint().
- // For some reason the difference between MAP_TWIPS and MAP_100TH_MM still plays
- // a role there so that for Draw/Impress/Calc (the MAP_100TH_MM users) i need to set a zoom
+ // For some reason the difference between MapUnit::MapTwipS and MapUnit::Map100thMM still plays
+ // a role there so that for Draw/Impress/Calc (the MapUnit::Map100thMM users) i need to set a zoom
// here, too. The factor includes the needed scale, but is calculated by pure comparisons. It
// is somehow related to the twips/100thmm relationship.
bool bUserIs100thmm(false);
@@ -160,7 +160,7 @@ namespace drawinglayer
if(pWindow)
{
- if(MAP_100TH_MM == pWindow->GetMapMode().GetMapUnit())
+ if(MapUnit::Map100thMM == pWindow->GetMapMode().GetMapUnit())
{
bUserIs100thmm = true;
}
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index f83939a65cd4..de1c22bba9b0 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -104,7 +104,7 @@ namespace
public:
PropertyHolder()
: maTransformation(),
- maMapUnit(MAP_100TH_MM),
+ maMapUnit(MapUnit::Map100thMM),
maLineColor(),
maFillColor(),
maTextColor(COL_BLACK),
@@ -2661,14 +2661,14 @@ namespace
case MetaActionType::MAPMODE :
{
/** CHECKED, WORKS WELL */
- // the most necessary MapMode to be interpreted is MAP_RELATIVE,
+ // the most necessary MapMode to be interpreted is MapUnit::MapRelative,
// but also the others may occur. Even not yet supported ones
// may need to be added here later
const MetaMapModeAction* pA = static_cast<const MetaMapModeAction*>(pAction);
const MapMode& rMapMode = pA->GetMapMode();
basegfx::B2DHomMatrix aMapping;
- if(MAP_RELATIVE == rMapMode.GetMapUnit())
+ if(MapUnit::MapRelative == rMapMode.GetMapUnit())
{
aMapping = getTransformFromMapMode(rMapMode);
}
@@ -2676,21 +2676,21 @@ namespace
{
switch(rMapMode.GetMapUnit())
{
- case MAP_100TH_MM :
+ case MapUnit::Map100thMM :
{
- if(MAP_TWIP == rPropertyHolders.Current().getMapUnit())
+ if(MapUnit::MapTwip == rPropertyHolders.Current().getMapUnit())
{
- // MAP_TWIP -> MAP_100TH_MM
+ // MapUnit::MapTwip -> MapUnit::Map100thMM
const double fTwipTo100thMm(127.0 / 72.0);
aMapping.scale(fTwipTo100thMm, fTwipTo100thMm);
}
break;
}
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
- if(MAP_100TH_MM == rPropertyHolders.Current().getMapUnit())
+ if(MapUnit::Map100thMM == rPropertyHolders.Current().getMapUnit())
{
- // MAP_100TH_MM -> MAP_TWIP
+ // MapUnit::Map100thMM -> MapUnit::MapTwip
const double f100thMmToTwip(72.0 / 127.0);
aMapping.scale(f100thMmToTwip, f100thMmToTwip);
}
@@ -2733,7 +2733,7 @@ namespace
// convert to target MapUnit if not pixels
aFontSize = OutputDevice::LogicToLogic(
- aFontSize, MAP_PIXEL, rPropertyHolders.Current().getMapUnit());
+ aFontSize, MapUnit::MapPixel, rPropertyHolders.Current().getMapUnit());
aCorrectedFont.SetFontSize(aFontSize);
rPropertyHolders.Current().setFont(aCorrectedFont);
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index b87df2739280..d863d21eb7a5 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -124,7 +124,7 @@ namespace
aRetval = BitmapEx(aContent, aAlpha);
// #i101811# set PrefMapMode and PrefSize at newly created Bitmap
- aRetval.SetPrefMapMode(MAP_PIXEL);
+ aRetval.SetPrefMapMode(MapUnit::MapPixel);
aRetval.SetPrefSize(Size(nWidth, nHeight));
}
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index ce0c192c44d1..19ad8bdb9fb8 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -818,7 +818,7 @@ namespace drawinglayer
double fFactorY(1.0);
{
- const MapMode aMapMode100thmm(MAP_100TH_MM);
+ const MapMode aMapMode100thmm(MapUnit::Map100thMM);
const Size aBitmapSize(OutputDevice::LogicToLogic(
rGraphicPrimitive.getGraphicObject().GetPrefSize(),
rGraphicPrimitive.getGraphicObject().GetPrefMapMode(), aMapMode100thmm));
@@ -909,7 +909,7 @@ namespace drawinglayer
pPDFControl->Location = aRectLogic;
Size aFontSize(pPDFControl->TextFont.GetFontSize());
- aFontSize = OutputDevice::LogicToLogic(aFontSize, MapMode(MAP_POINT), mpOutputDevice->GetMapMode());
+ aFontSize = OutputDevice::LogicToLogic(aFontSize, MapMode(MapUnit::MapPoint), mpOutputDevice->GetMapMode());
pPDFControl->TextFont.SetFontSize(aFontSize);
mpPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::Form);
@@ -2033,10 +2033,10 @@ namespace drawinglayer
// prepare view transformation for target renderers
// ATTENTION! Need to apply another scaling because of the potential DPI differences
// between Printer and VDev (mpOutputDevice and aBufferDevice here).
- // To get the DPI, LogicToPixel from (1,1) from MAP_INCH needs to be used.
+ // To get the DPI, LogicToPixel from (1,1) from MapUnit::MapInch needs to be used.
basegfx::B2DHomMatrix aViewTransform(aBufferDevice->GetViewTransformation());
- const Size aDPIOld(mpOutputDevice->LogicToPixel(Size(1, 1), MAP_INCH));
- const Size aDPINew(aBufferDevice->LogicToPixel(Size(1, 1), MAP_INCH));
+ const Size aDPIOld(mpOutputDevice->LogicToPixel(Size(1, 1), MapUnit::MapInch));
+ const Size aDPINew(aBufferDevice->LogicToPixel(Size(1, 1), MapUnit::MapInch));
const double fDPIXChange((double)aDPIOld.getWidth() / (double)aDPINew.getWidth());
const double fDPIYChange((double)aDPIOld.getHeight() / (double)aDPINew.getHeight());
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index ac41e60fbc77..93cc3329b2e6 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -50,7 +50,7 @@ namespace drawinglayer
if(!rSeq.empty() && nDiscreteWidth && nDiscreteHeight)
{
// get destination size in pixels
- const MapMode aMapModePixel(MAP_PIXEL);
+ const MapMode aMapModePixel(MapUnit::MapPixel);
const sal_uInt32 nViewVisibleArea(nDiscreteWidth * nDiscreteHeight);
drawinglayer::primitive2d::Primitive2DContainer aSequence(rSeq);
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index 134abc8d7457..a39b465c155b 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -208,7 +208,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem)
Size aSz( 0, static_cast<const SvxFontHeightItem&>(rItem).GetHeight() );
MapUnit eUnit = rPool.GetMetric( rItem.Which() );
MapMode aItemMapMode(eUnit);
- MapMode aPntMap( MAP_POINT );
+ MapMode aPntMap( MapUnit::MapPoint );
aSz = OutputDevice::LogicToLogic( aSz, aItemMapMode, aPntMap );
aDebStr.append(" Points=");
aDebStr.append(static_cast<sal_Int32>(aSz.Height()));
@@ -278,7 +278,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem)
Size aSz( 0, (short)static_cast<const SvxKerningItem&>(rItem).GetValue() );
MapUnit eUnit = rPool.GetMetric( rItem.Which() );
MapMode aItemMapMode(eUnit);
- MapMode aPntMap( MAP_POINT );
+ MapMode aPntMap( MapUnit::MapPoint );
aSz = OutputDevice::LogicToLogic( aSz, aItemMapMode, aPntMap );
aDebStr.append(" Points=");
aDebStr.append(static_cast<sal_Int32>(aSz.Height()));
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 491507820060..3c256baa5c4f 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1211,7 +1211,7 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo
SvxFontHeightItem aFontHeightItem( static_cast<const SvxFontHeightItem&>(rSet.Get( *pWhich )) );
long nHeight = aFontHeightItem.GetHeight();
const MapUnit eUnit = rSet.GetPool()->GetMetric( *pWhich );
- nHeight = OutputDevice::LogicToLogic(nHeight * 10, eUnit, MAP_POINT);
+ nHeight = OutputDevice::LogicToLogic(nHeight * 10, eUnit, MapUnit::MapPoint);
FontMetric aFontMetric = pFontList->Get( pFontItem->GetFamilyName(), pFontItem->GetStyleName() );
const sal_IntPtr* pAry = pFontList->GetSizeAry( aFontMetric );
@@ -1264,7 +1264,7 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo
if( (nHeight >= 2) && (nHeight <= 9999 ) )
{
- nHeight = OutputDevice::LogicToLogic( nHeight, MAP_POINT, (MapUnit)eUnit ) / 10;
+ nHeight = OutputDevice::LogicToLogic( nHeight, MapUnit::MapPoint, (MapUnit)eUnit ) / 10;
if( nHeight != (long)aFontHeightItem.GetHeight() )
{
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index 58620b6efb72..4f7f99bba563 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -607,8 +607,8 @@ void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel )
// Font hight and margins, when LogicToLogic is possible:
MapUnit eUnit = mpEditEngine->GetRefMapMode().GetMapUnit();
- if ( ( eUnit != MAP_PIXEL ) && ( eUnit != MAP_SYSFONT ) &&
- ( eUnit != MAP_APPFONT ) && ( eUnit != MAP_RELATIVE ) )
+ if ( ( eUnit != MapUnit::MapPixel ) && ( eUnit != MapUnit::MapSysFont ) &&
+ ( eUnit != MapUnit::MapAppFont ) && ( eUnit != MapUnit::MapRelative ) )
{
long nPoints = 10;
if ( nHLevel == 1 )
@@ -620,7 +620,7 @@ void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel )
else if ( nHLevel == 4 )
nPoints = 11;
- nPoints = OutputDevice::LogicToLogic( nPoints, MAP_POINT, eUnit );
+ nPoints = OutputDevice::LogicToLogic( nPoints, MapUnit::MapPoint, eUnit );
SvxFontHeightItem aHeightItem( nPoints, 100, EE_CHAR_FONTHEIGHT );
aItems.Put( aHeightItem );
@@ -635,8 +635,8 @@ void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel )
if ( !nHLevel || ((nHLevel >= 1) && (nHLevel <= 6)) )
{
SvxULSpaceItem aULSpaceItem( EE_PARA_ULSPACE );
- aULSpaceItem.SetUpper( (sal_uInt16)OutputDevice::LogicToLogic( 42, MAP_10TH_MM, eUnit ) );
- aULSpaceItem.SetLower( (sal_uInt16)OutputDevice::LogicToLogic( 35, MAP_10TH_MM, eUnit ) );
+ aULSpaceItem.SetUpper( (sal_uInt16)OutputDevice::LogicToLogic( 42, MapUnit::Map10thMM, eUnit ) );
+ aULSpaceItem.SetLower( (sal_uInt16)OutputDevice::LogicToLogic( 35, MapUnit::Map10thMM, eUnit ) );
aItems.Put( aULSpaceItem );
}
}
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index bf03c9042241..19a4225073db 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -55,7 +55,7 @@ EditRTFParser::EditRTFParser(
SvxRTFParser(rAttrPool, rIn, nullptr),
aCurSel(aSel),
mpEditEngine(pEditEngine),
- aRTFMapMode(MAP_TWIP),
+ aRTFMapMode(MapUnit::MapTwip),
nDefFont(0),
nDefTab(0),
bLastActionInsertParaBreak(false)
@@ -143,7 +143,7 @@ void EditRTFParser::AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& r
{
// Problem: DefFont and DefFontHeight
Size aSz( 12, 0 );
- MapMode aPntMode( MAP_POINT );
+ MapMode aPntMode( MapUnit::MapPoint );
MapMode _aEditMapMode(mpEditEngine->GetRefDevice()->GetMapMode().GetMapUnit());
aSz = mpEditEngine->GetRefDevice()->LogicToLogic(aSz, &aPntMode, &_aEditMapMode);
SvxFontHeightItem aFontHeightItem( aSz.Width(), 100, EE_CHAR_FONTHEIGHT );
@@ -495,7 +495,7 @@ void EditRTFParser::CreateStyleSheets()
void EditRTFParser::CalcValue()
{
- const MapUnit eDestUnit = static_cast< MapUnit >( aEditMapMode.GetMapUnit() );
+ const MapUnit eDestUnit = aEditMapMode.GetMapUnit();
const MapUnit eSrcUnit = aRTFMapMode.GetMapUnit();
if (eDestUnit != eSrcUnit)
nTokenValue = OutputDevice::LogicToLogic( (long)nTokenValue, eSrcUnit, eDestUnit );
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index b04a4918e5ba..3d4498084444 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -179,7 +179,7 @@ void lcl_translateTwips(vcl::Window& rParent, vcl::Window& rChild)
if (!rChild.IsMapModeEnabled())
{
MapMode aMapMode(rChild.GetMapMode());
- aMapMode.SetMapUnit(MAP_TWIP);
+ aMapMode.SetMapUnit(MapUnit::MapTwip);
aMapMode.SetScaleX(rParent.GetMapMode().GetScaleX());
aMapMode.SetScaleY(rParent.GetMapMode().GetScaleY());
rChild.SetMapMode(aMapMode);
@@ -351,7 +351,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
if (comphelper::LibreOfficeKit::isActive() && mpViewShell && !pOldRegion)
{
pOutWin->Push(PushFlags::MAPMODE);
- if (pOutWin->GetMapMode().GetMapUnit() == MAP_TWIP)
+ if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
{
// Find the parent that is not right
// on top of us to use its offset.
@@ -369,10 +369,10 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
}
}
- bool bMm100ToTwip = pOutWin->GetMapMode().GetMapUnit() == MAP_100TH_MM;
+ bool bMm100ToTwip = pOutWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM;
Point aOrigin;
- if (pOutWin->GetMapMode().GetMapUnit() == MAP_TWIP)
+ if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
// Writer comments: they use editeng, but are separate widgets.
aOrigin = pOutWin->GetMapMode().GetOrigin();
@@ -388,7 +388,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
Rectangle& rStart = aRectangles.front();
Rectangle aStart = Rectangle(rStart.Left(), rStart.Top(), rStart.Left() + 1, rStart.Bottom());
if (bMm100ToTwip)
- aStart = OutputDevice::LogicToLogic(aStart, MAP_100TH_MM, MAP_TWIP);
+ aStart = OutputDevice::LogicToLogic(aStart, MapUnit::Map100thMM, MapUnit::MapTwip);
aStart.Move(aOrigin.getX(), aOrigin.getY());
mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, aStart.toString().getStr());
@@ -396,7 +396,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
Rectangle& rEnd = aRectangles.back();
Rectangle aEnd = Rectangle(rEnd.Right() - 1, rEnd.Top(), rEnd.Right(), rEnd.Bottom());
if (bMm100ToTwip)
- aEnd = OutputDevice::LogicToLogic(aEnd, MAP_100TH_MM, MAP_TWIP);
+ aEnd = OutputDevice::LogicToLogic(aEnd, MapUnit::Map100thMM, MapUnit::MapTwip);
aEnd.Move(aOrigin.getX(), aOrigin.getY());
mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, aEnd.toString().getStr());
@@ -406,7 +406,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
for (Rectangle & rRectangle : aRectangles)
{
if (bMm100ToTwip)
- rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, MAP_TWIP);
+ rRectangle = OutputDevice::LogicToLogic(rRectangle, MapUnit::Map100thMM, MapUnit::MapTwip);
rRectangle.Move(aOrigin.getX(), aOrigin.getY());
v.push_back(rRectangle.toString().getStr());
}
@@ -444,7 +444,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
void ImpEditView::GetSelectionRectangles(std::vector<Rectangle>& rLogicRects)
{
- bool bMm100ToTwip = pOutWin->GetMapMode().GetMapUnit() == MAP_100TH_MM;
+ bool bMm100ToTwip = pOutWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM;
vcl::Region aRegion;
DrawSelection(aEditSelection, &aRegion);
aRegion.GetRegionRectangles(rLogicRects);
@@ -452,7 +452,7 @@ void ImpEditView::GetSelectionRectangles(std::vector<Rectangle>& rLogicRects)
for (Rectangle& rRectangle : rLogicRects)
{
if (bMm100ToTwip)
- rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, MAP_TWIP);
+ rRectangle = OutputDevice::LogicToLogic(rRectangle, MapUnit::Map100thMM, MapUnit::MapTwip);
}
}
@@ -460,7 +460,7 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice* _pTarget, const Point& rD
{
if ( rDocPosTopLeft.X() != rDocPosBottomRight.X() )
{
- bool bPixelMode = _pTarget->GetMapMode() == MAP_PIXEL;
+ bool bPixelMode = _pTarget->GetMapMode() == MapUnit::MapPixel;
Point aPnt1( GetWindowPos( rDocPosTopLeft ) );
Point aPnt2( GetWindowPos( rDocPosBottomRight ) );
@@ -1007,9 +1007,9 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
Rectangle aRect(rPos.getX(), rPos.getY(), rPos.getX() + GetCursor()->GetWidth(), rPos.getY() + GetCursor()->GetHeight());
// LOK output is always in twips, convert from mm100 if necessary.
- if (pOutWin->GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aRect = OutputDevice::LogicToLogic(aRect, MAP_100TH_MM, MAP_TWIP);
- else if (pOutWin->GetMapMode().GetMapUnit() == MAP_TWIP)
+ if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aRect = OutputDevice::LogicToLogic(aRect, MapUnit::Map100thMM, MapUnit::MapTwip);
+ else if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
{
// Writer comments: they use editeng, but are separate widgets.
Point aOrigin = pOutWin->GetMapMode().GetOrigin();
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 0badeb5a712a..4fd52827283e 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -194,7 +194,7 @@ void ImpEditEngine::SetRefDevice( OutputDevice* pRef )
if ( !pRef )
{
pRefDev = VclPtr<VirtualDevice>::Create();
- pRefDev->SetMapMode( MAP_TWIP );
+ pRefDev->SetMapMode( MapUnit::MapTwip );
bOwnerOfRefDev = true;
} else
{
@@ -219,7 +219,7 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode )
if ( !bOwnerOfRefDev )
{
pRefDev = VclPtr<VirtualDevice>::Create();
- pRefDev->SetMapMode( MAP_TWIP );
+ pRefDev->SetMapMode( MapUnit::MapTwip );
SetRefDevice( pRefDev );
bOwnerOfRefDev = true;
}
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index c994c40e65c0..e98c5adda0fc 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -535,7 +535,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
rOutput.WriteChar( '}' ) << endl;
// DefTab:
- MapMode aTwpMode( MAP_TWIP );
+ MapMode aTwpMode( MapUnit::MapTwip );
sal_uInt16 nDefTabTwps = (sal_uInt16) GetRefDevice()->LogicToLogic(
Point( aEditDoc.GetDefTab(), 0 ),
&GetRefMapMode(), &aTwpMode ).X();
@@ -965,7 +965,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
SvxFont aFont;
ContentNode* pNode = aEditDoc.GetObject( nPara );
SeekCursor( pNode, nPos, aFont );
- MapMode aPntMode( MAP_POINT );
+ MapMode aPntMode( MapUnit::MapPoint );
long nFontHeight = GetRefDevice()->LogicToLogic(
aFont.GetFontSize(), &GetRefMapMode(), &aPntMode ).Height();
nFontHeight *=2; // Half Points
@@ -3112,7 +3112,7 @@ bool ImpEditEngine::ImplHasText() const
sal_Int32 ImpEditEngine::LogicToTwips(sal_Int32 n)
{
Size aSz(n, 0);
- MapMode aTwipsMode( MAP_TWIP );
+ MapMode aTwipsMode( MapUnit::MapTwip );
aSz = pRefDev->LogicToLogic( aSz, nullptr, &aTwipsMode );
return aSz.Width();
}
diff --git a/editeng/source/items/itemtype.cxx b/editeng/source/items/itemtype.cxx
index ee1749186b8b..c8ff68c37e26 100644
--- a/editeng/source/items/itemtype.cxx
+++ b/editeng/source/items/itemtype.cxx
@@ -39,45 +39,45 @@ OUString GetMetricText( long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const In
switch ( eDestUnit )
{
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- case MAP_MM:
- case MAP_CM:
+ case MapUnit::Map100thMM:
+ case MapUnit::Map10thMM:
+ case MapUnit::MapMM:
+ case MapUnit::MapCM:
{
nRet = (long)OutputDevice::LogicToLogic(
- nVal, (MapUnit)eSrcUnit, (MapUnit)MAP_100TH_MM );
+ nVal, (MapUnit)eSrcUnit, (MapUnit)MapUnit::Map100thMM );
switch ( eDestUnit )
{
- case MAP_100TH_MM: nRet *= 1000; break;
- case MAP_10TH_MM: nRet *= 100; break;
- case MAP_MM: nRet *= 10; break;
+ case MapUnit::Map100thMM: nRet *= 1000; break;
+ case MapUnit::Map10thMM: nRet *= 100; break;
+ case MapUnit::MapMM: nRet *= 10; break;
default: ;//prevent warning
}
break;
}
- case MAP_1000TH_INCH:
- case MAP_100TH_INCH:
- case MAP_10TH_INCH:
- case MAP_INCH:
+ case MapUnit::Map1000thInch:
+ case MapUnit::Map100thInch:
+ case MapUnit::Map10thInch:
+ case MapUnit::MapInch:
{
nRet = OutputDevice::LogicToLogic(
- nVal, (MapUnit)eSrcUnit, (MapUnit)MAP_1000TH_INCH );
+ nVal, (MapUnit)eSrcUnit, (MapUnit)MapUnit::Map1000thInch );
switch ( eDestUnit )
{
- case MAP_1000TH_INCH: nRet *= 1000; break;
- case MAP_100TH_INCH: nRet *= 100; break;
- case MAP_10TH_INCH: nRet *= 10; break;
+ case MapUnit::Map1000thInch: nRet *= 1000; break;
+ case MapUnit::Map100thInch: nRet *= 100; break;
+ case MapUnit::Map10thInch: nRet *= 10; break;
default: ;//prevent warning
}
break;
}
- case MAP_POINT:
- case MAP_TWIP:
- case MAP_PIXEL:
+ case MapUnit::MapPoint:
+ case MapUnit::MapTwip:
+ case MapUnit::MapPixel:
return OUString::number( (long)OutputDevice::LogicToLogic(
nVal, (MapUnit)eSrcUnit, (MapUnit)eDestUnit ));
@@ -86,7 +86,7 @@ OUString GetMetricText( long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const In
return OUString();
}
- if ( MAP_CM == eDestUnit || MAP_INCH == eDestUnit )
+ if ( MapUnit::MapCM == eDestUnit || MapUnit::MapInch == eDestUnit )
{
sal_Int32 nMod = nRet % 10;
@@ -174,32 +174,32 @@ sal_uInt16 GetMetricId( MapUnit eUnit )
switch ( eUnit )
{
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- case MAP_MM:
+ case MapUnit::Map100thMM:
+ case MapUnit::Map10thMM:
+ case MapUnit::MapMM:
nId = RID_SVXITEMS_METRIC_MM;
break;
- case MAP_CM:
+ case MapUnit::MapCM:
nId = RID_SVXITEMS_METRIC_CM;
break;
- case MAP_1000TH_INCH:
- case MAP_100TH_INCH:
- case MAP_10TH_INCH:
- case MAP_INCH:
+ case MapUnit::Map1000thInch:
+ case MapUnit::Map100thInch:
+ case MapUnit::Map10thInch:
+ case MapUnit::MapInch:
nId = RID_SVXITEMS_METRIC_INCH;
break;
- case MAP_POINT:
+ case MapUnit::MapPoint:
nId = RID_SVXITEMS_METRIC_POINT;
break;
- case MAP_TWIP:
+ case MapUnit::MapTwip:
nId = RID_SVXITEMS_METRIC_TWIP;
break;
- case MAP_PIXEL:
+ case MapUnit::MapPixel:
nId = RID_SVXITEMS_METRIC_PIXEL;
break;
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index cde00e370a0d..3b6eba562c33 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -484,10 +484,10 @@ void SvxNumberFormat::SetIndentAt( const long nIndentAt )
Size SvxNumberFormat::GetGraphicSizeMM100(const Graphic* pGraphic)
{
- const MapMode aMapMM100( MAP_100TH_MM );
+ const MapMode aMapMM100( MapUnit::Map100thMM );
const Size& rSize = pGraphic->GetPrefSize();
Size aRetSize;
- if ( pGraphic->GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ if ( pGraphic->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
{
OutputDevice* pOutDev = Application::GetDefaultDevice();
MapMode aOldMap( pOutDev->GetMapMode() );
diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx
index 42d49e768369..bde8319d93e7 100644
--- a/editeng/source/items/paperinf.cxx
+++ b/editeng/source/items/paperinf.cxx
@@ -37,7 +37,7 @@ Size SvxPaperInfo::GetPaperSize( Paper ePaper, MapUnit eUnit )
{
PaperInfo aInfo(ePaper);
Size aRet(aInfo.getWidth(), aInfo.getHeight()); // in 100thMM
- return eUnit == MAP_100TH_MM ? aRet : OutputDevice::LogicToLogic(aRet, MAP_100TH_MM, eUnit);
+ return eUnit == MapUnit::Map100thMM ? aRet : OutputDevice::LogicToLogic(aRet, MapUnit::Map100thMM, eUnit);
}
/*------------------------------------------------------------------------
@@ -70,7 +70,7 @@ Size SvxPaperInfo::GetPaperSize( const Printer* pPrinter )
if ( aMap1 == aMap2 )
aPaperSize =
- pPrinter->PixelToLogic( aPaperSize, MapMode( MAP_TWIP ) );
+ pPrinter->PixelToLogic( aPaperSize, MapMode( MapUnit::MapTwip ) );
return aPaperSize;
}
@@ -85,7 +85,7 @@ Size SvxPaperInfo::GetPaperSize( const Printer* pPrinter )
Paper SvxPaperInfo::GetSvxPaper( const Size &rSize, MapUnit eUnit, bool bSloppy )
{
- Size aSize(eUnit == MAP_100TH_MM ? rSize : OutputDevice::LogicToLogic(rSize, eUnit, MAP_100TH_MM));
+ Size aSize(eUnit == MapUnit::Map100thMM ? rSize : OutputDevice::LogicToLogic(rSize, eUnit, MapUnit::Map100thMM));
PaperInfo aInfo(aSize.Width(), aSize.Height());
if (bSloppy)
aInfo.doSloppyFit();
@@ -95,9 +95,9 @@ Paper SvxPaperInfo::GetSvxPaper( const Size &rSize, MapUnit eUnit, bool bSloppy
long SvxPaperInfo::GetSloppyPaperDimension( long nSize )
{
- nSize = OutputDevice::LogicToLogic(nSize, MAP_TWIP, MAP_100TH_MM);
+ nSize = OutputDevice::LogicToLogic(nSize, MapUnit::MapTwip, MapUnit::Map100thMM);
nSize = PaperInfo::sloppyFitPageDimension(nSize);
- return OutputDevice::LogicToLogic(nSize, MAP_100TH_MM, MAP_TWIP);
+ return OutputDevice::LogicToLogic(nSize, MapUnit::Map100thMM, MapUnit::MapTwip);
}
@@ -105,7 +105,7 @@ Size SvxPaperInfo::GetDefaultPaperSize( MapUnit eUnit )
{
PaperInfo aInfo(PaperInfo::getSystemDefaultPaper());
Size aRet(aInfo.getWidth(), aInfo.getHeight());
- return eUnit == MAP_100TH_MM ? aRet : OutputDevice::LogicToLogic(aRet, MAP_100TH_MM, eUnit);
+ return eUnit == MapUnit::Map100thMM ? aRet : OutputDevice::LogicToLogic(aRet, MapUnit::Map100thMM, eUnit);
}
/*------------------------------------------------------------------------
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 410b83a872c4..b7e4446b450b 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -727,13 +727,13 @@ SvStream& SvxFontHeightItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion )
rStrm.WriteUInt16( GetHeight() );
if( FONTHEIGHT_UNIT_VERSION <= nItemVersion )
- rStrm.WriteUInt16( GetProp() ).WriteUInt16( GetPropUnit() );
+ rStrm.WriteUInt16( GetProp() ).WriteUInt16( (sal_uInt16)GetPropUnit() );
else
{
// When exporting to the old versions the relative information is lost
// when there is no percentage
sal_uInt16 _nProp = GetProp();
- if( MAP_RELATIVE != GetPropUnit() )
+ if( MapUnit::MapRelative != GetPropUnit() )
_nProp = 100;
rStrm.WriteUInt16( _nProp );
}
@@ -744,7 +744,8 @@ SvStream& SvxFontHeightItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion )
SfxPoolItem* SvxFontHeightItem::Create( SvStream& rStrm,
sal_uInt16 nVersion ) const
{
- sal_uInt16 nsize, nprop = 0, nPropUnit = MAP_RELATIVE;
+ sal_uInt16 nsize, nprop = 0;
+ MapUnit nPropUnit = MapUnit::MapRelative;
rStrm.ReadUInt16( nsize );
@@ -758,7 +759,11 @@ SfxPoolItem* SvxFontHeightItem::Create( SvStream& rStrm,
}
if( FONTHEIGHT_UNIT_VERSION <= nVersion )
- rStrm.ReadUInt16( nPropUnit );
+ {
+ sal_uInt16 nTmp;
+ rStrm.ReadUInt16( nTmp );
+ nPropUnit = (MapUnit)nTmp;
+ }
SvxFontHeightItem* pItem = new SvxFontHeightItem( nsize, 100, Which() );
pItem->SetProp( nprop, (MapUnit)nPropUnit );
@@ -801,22 +806,22 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
aFontHeight.Height = fRoundPoints;
}
- aFontHeight.Prop = (sal_Int16)(MAP_RELATIVE == ePropUnit ? nProp : 100);
+ aFontHeight.Prop = (sal_Int16)(MapUnit::MapRelative == ePropUnit ? nProp : 100);
float fRet = (float)(short)nProp;
switch( ePropUnit )
{
- case MAP_RELATIVE:
+ case MapUnit::MapRelative:
fRet = 0.;
break;
- case MAP_100TH_MM:
+ case MapUnit::Map100thMM:
fRet = convertMm100ToTwip(fRet);
fRet /= 20.;
break;
- case MAP_POINT:
+ case MapUnit::MapPoint:
break;
- case MAP_TWIP:
+ case MapUnit::MapTwip:
fRet /= 20.;
break;
default: ;//prevent warning
@@ -843,24 +848,24 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
}
break;
case MID_FONTHEIGHT_PROP:
- rVal <<= (sal_Int16)(MAP_RELATIVE == ePropUnit ? nProp : 100);
+ rVal <<= (sal_Int16)(MapUnit::MapRelative == ePropUnit ? nProp : 100);
break;
case MID_FONTHEIGHT_DIFF:
{
float fRet = (float)(short)nProp;
switch( ePropUnit )
{
- case MAP_RELATIVE:
+ case MapUnit::MapRelative:
fRet = 0.;
break;
- case MAP_100TH_MM:
+ case MapUnit::Map100thMM:
fRet = convertMm100ToTwip(fRet);
fRet /= 20.;
break;
- case MAP_POINT:
+ case MapUnit::MapPoint:
break;
- case MAP_TWIP:
+ case MapUnit::MapTwip:
fRet /= 20.;
break;
default: ;//prevent warning
@@ -885,11 +890,11 @@ static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, M
short nDiff = 0;
switch( eProp )
{
- case MAP_RELATIVE:
+ case MapUnit::MapRelative:
nRet *= 100;
nRet /= nProp;
break;
- case MAP_POINT:
+ case MapUnit::MapPoint:
{
short nTemp = (short)nProp;
nDiff = nTemp * 20;
@@ -897,11 +902,11 @@ static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, M
nDiff = (short)convertTwipToMm100((long)(nDiff));
}
break;
- case MAP_100TH_MM:
+ case MapUnit::Map100thMM:
//then the core is surely also in 1/100 mm
nDiff = (short)nProp;
break;
- case MAP_TWIP:
+ case MapUnit::MapTwip:
// Here surely TWIP
nDiff = ((short)nProp);
break;
@@ -926,7 +931,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if ( rVal >>= aFontHeight )
{
// Height
- ePropUnit = MAP_RELATIVE;
+ ePropUnit = MapUnit::MapRelative;
nProp = 100;
double fPoint = aFontHeight.Height;
if( fPoint < 0. || fPoint > 10000. )
@@ -944,7 +949,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
case MID_FONTHEIGHT:
{
- ePropUnit = MAP_RELATIVE;
+ ePropUnit = MapUnit::MapRelative;
nProp = 100;
double fPoint = 0;
if(!(rVal >>= fPoint))
@@ -973,7 +978,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
nHeight *= nNew;
nHeight /= 100;
nProp = nNew;
- ePropUnit = MAP_RELATIVE;
+ ePropUnit = MapUnit::MapRelative;
}
break;
case MID_FONTHEIGHT_DIFF:
@@ -990,7 +995,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
sal_Int16 nCoreDiffValue = (sal_Int16)(fValue * 20.);
nHeight += bConvert ? nCoreDiffValue : convertTwipToMm100(nCoreDiffValue);
nProp = (sal_uInt16)((sal_Int16)fValue);
- ePropUnit = MAP_POINT;
+ ePropUnit = MapUnit::MapPoint;
}
break;
}
@@ -1006,7 +1011,7 @@ bool SvxFontHeightItem::GetPresentation
OUString& rText, const IntlWrapper *pIntl
) const
{
- if( MAP_RELATIVE != ePropUnit )
+ if( MapUnit::MapRelative != ePropUnit )
{
rText = OUString::number( (short)nProp ) +
" " + EE_RESSTR( GetMetricId( ePropUnit ) );
@@ -1016,8 +1021,8 @@ bool SvxFontHeightItem::GetPresentation
else if( 100 == nProp )
{
rText = GetMetricText( (long)nHeight,
- eCoreUnit, MAP_POINT, pIntl ) +
- " " + EE_RESSTR(GetMetricId(MAP_POINT));
+ eCoreUnit, MapUnit::MapPoint, pIntl ) +
+ " " + EE_RESSTR(GetMetricId(MapUnit::MapPoint));
}
else
rText = OUString::number( nProp ) + "%";
@@ -1049,7 +1054,7 @@ void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, const sal_uInt16 nNewP
{
DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
- if( MAP_RELATIVE != eUnit )
+ if( MapUnit::MapRelative != eUnit )
nHeight = nNewHeight + ::ItemToControl( (short)nNewProp, eUnit,
FUNIT_TWIP );
else if( 100 != nNewProp )
@@ -1066,7 +1071,7 @@ void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, sal_uInt16 nNewProp,
{
DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
- if( MAP_RELATIVE != eMetric )
+ if( MapUnit::MapRelative != eMetric )
nHeight = nNewHeight +
::ControlToItem( ::ItemToControl((short)nNewProp, eMetric,
FUNIT_TWIP ), FUNIT_TWIP,
@@ -1086,7 +1091,7 @@ void SvxFontHeightItem::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("height"), BAD_CAST(OString::number(nHeight).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("prop"), BAD_CAST(OString::number(nProp).getStr()));
- xmlTextWriterWriteAttribute(pWriter, BAD_CAST("propUnit"), BAD_CAST(OString::number(ePropUnit).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("propUnit"), BAD_CAST(OString::number((int)ePropUnit).getStr()));
xmlTextWriterEndElement(pWriter);
}
@@ -1194,8 +1199,8 @@ bool SvxFontWidthItem::GetPresentation
if ( 100 == nProp )
{
rText = GetMetricText( (long)nWidth,
- eCoreUnit, MAP_POINT, pIntl ) +
- " " + EE_RESSTR(GetMetricId(MAP_POINT));
+ eCoreUnit, MapUnit::MapPoint, pIntl ) +
+ " " + EE_RESSTR(GetMetricId(MapUnit::MapPoint));
}
else
rText = OUString::number( nProp ) + "%";
@@ -2033,8 +2038,8 @@ bool SvxKerningItem::GetPresentation
switch ( ePres )
{
case SfxItemPresentation::Nameless:
- rText = GetMetricText( (long)GetValue(), eCoreUnit, MAP_POINT, pIntl ) +
- " " + EE_RESSTR(GetMetricId(MAP_POINT));
+ rText = GetMetricText( (long)GetValue(), eCoreUnit, MapUnit::MapPoint, pIntl ) +
+ " " + EE_RESSTR(GetMetricId(MapUnit::MapPoint));
return true;
case SfxItemPresentation::Complete:
{
@@ -2049,8 +2054,8 @@ bool SvxKerningItem::GetPresentation
if ( nId )
rText += EE_RESSTR(nId);
rText = rText +
- GetMetricText( (long)GetValue(), eCoreUnit, MAP_POINT, pIntl ) +
- " " + EE_RESSTR(GetMetricId(MAP_POINT));
+ GetMetricText( (long)GetValue(), eCoreUnit, MapUnit::MapPoint, pIntl ) +
+ " " + EE_RESSTR(GetMetricId(MapUnit::MapPoint));
return true;
}
default: ; //prevent warning
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index a7f86b652142..f385cee753d0 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1455,7 +1455,7 @@ Size Outliner::ImplGetBulletSize( sal_Int32 nPara )
}
else
{
- pPara->aBulSize = OutputDevice::LogicToLogic( pFmt->GetGraphicSize(), MAP_100TH_MM, pEditEngine->GetRefDevice()->GetMapMode() );
+ pPara->aBulSize = OutputDevice::LogicToLogic( pFmt->GetGraphicSize(), MapUnit::Map100thMM, pEditEngine->GetRefDevice()->GetMapMode() );
}
}
diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index 31f7e48ea8e1..60bac11af009 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -103,9 +103,9 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
if( nullptr == pItem && pPool )
pItem = &(pPool->GetDefaultItem( pMap->nWID ));
- const MapUnit eMapUnit = pPool ? pPool->GetMetric((sal_uInt16)pMap->nWID) : MAP_100TH_MM;
+ const MapUnit eMapUnit = pPool ? pPool->GetMetric((sal_uInt16)pMap->nWID) : MapUnit::Map100thMM;
sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
- if( eMapUnit == MAP_100TH_MM )
+ if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
if(pItem)
@@ -113,7 +113,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
pItem->QueryValue( aVal, nMemberId );
if( pMap->nMemberId & SFX_METRIC_ITEM )
{
- if( eMapUnit != MAP_100TH_MM )
+ if( eMapUnit != MapUnit::Map100thMM )
{
if ( !bDontConvertNegativeValues || SvxUnoCheckForPositiveValue( aVal ) )
SvxUnoConvertToMM( eMapUnit, aVal );
@@ -164,10 +164,10 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa
{
uno::Any aValue( rVal );
- const MapUnit eMapUnit = pPool ? pPool->GetMetric((sal_uInt16)pMap->nWID) : MAP_100TH_MM;
+ const MapUnit eMapUnit = pPool ? pPool->GetMetric((sal_uInt16)pMap->nWID) : MapUnit::Map100thMM;
// check for needed metric translation
- if( (pMap->nMemberId & SFX_METRIC_ITEM) && eMapUnit != MAP_100TH_MM )
+ if( (pMap->nMemberId & SFX_METRIC_ITEM) && eMapUnit != MapUnit::Map100thMM )
{
if ( !bDontConvertNegativeValues || SvxUnoCheckForPositiveValue( aValue ) )
SvxUnoConvertFromMM( eMapUnit, aValue );
@@ -176,7 +176,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa
SfxPoolItem *pNewItem = pItem->Clone();
sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
- if( eMapUnit == MAP_100TH_MM )
+ if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
if( pNewItem->PutValue( aValue, nMemberId ) )
@@ -200,7 +200,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
// No UsrAny detected yet, generate Default entry and return this
const MapUnit eMapUnit = mrItemPool.GetMetric((sal_uInt16)pMap->nWID);
sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
- if( eMapUnit == MAP_100TH_MM )
+ if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
uno::Any aVal;
SfxItemSet aSet( mrItemPool, pMap->nWID, pMap->nWID);
@@ -226,7 +226,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
if( pMap->nMemberId & SFX_METRIC_ITEM )
{
// check for needed metric translation
- if(pMap->nMemberId & SFX_METRIC_ITEM && eMapUnit != MAP_100TH_MM)
+ if(pMap->nMemberId & SFX_METRIC_ITEM && eMapUnit != MapUnit::Map100thMM)
{
SvxUnoConvertToMM( eMapUnit, aVal );
}
@@ -282,7 +282,7 @@ void SvxUnoConvertToMM( const MapUnit eSourceMapUnit, uno::Any & rMetric ) throw
// map the metric of the itempool to 100th mm
switch(eSourceMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
switch( rMetric.getValueTypeClass() )
{
@@ -319,7 +319,7 @@ void SvxUnoConvertFromMM( const MapUnit eDestinationMapUnit, uno::Any & rMetric
{
switch(eDestinationMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
switch( rMetric.getValueTypeClass() )
{
diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx
index c24f55da2a58..8ceb9e2054ca 100644
--- a/extensions/source/abpilot/abspilot.cxx
+++ b/extensions/source/abpilot/abspilot.cxx
@@ -60,7 +60,7 @@ namespace abp
,m_aNewDataSource(_rxORB)
,m_eNewDataSourceType( AST_INVALID )
{
- SetPageSizePixel(LogicToPixel(Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MAP_APPFONT));
+ SetPageSizePixel(LogicToPixel(Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapUnit::MapAppFont));
declarePath( PATH_COMPLETE,
{STATE_SELECT_ABTYPE,
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx
index 38188dfd525f..1cc434f8c0d9 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -336,7 +336,7 @@ BibGeneralPage::BibGeneralPage(vcl::Window* pParent, BibDataManager* pMan):
SetText(BIB_RESSTR(ST_TYPE_TITLE));
- Size aSize(LogicToPixel(Size(0, 209), MapMode(MAP_APPFONT)));
+ Size aSize(LogicToPixel(Size(0, 209), MapMode(MapUnit::MapAppFont)));
set_height_request(aSize.Height());
}
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx
index 261918671f31..82ea3ea0d860 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -246,7 +246,7 @@ namespace dbp
m_aContext.xObjectModel = _rxObjectModel;
initContext();
- SetPageSizePixel(LogicToPixel(::Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MAP_APPFONT));
+ SetPageSizePixel(LogicToPixel(::Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapUnit::MapAppFont));
defaultButton(WizardButtonFlags::NEXT);
enableButtons(WizardButtonFlags::FINISH, false);
}
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index c223cc6dc305..d40f9f31cee4 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -209,7 +209,7 @@ namespace pcr
if ( m_bIndentTitle )
{
- Size aIndent( m_pTheParent->LogicToPixel( Size( 8, 0 ), MAP_APPFONT ) );
+ Size aIndent( m_pTheParent->LogicToPixel( Size( 8, 0 ), MapUnit::MapAppFont ) );
aTitlePos.X() += aIndent.Width();
aTitleSize.Width() -= aIndent.Width();
}
diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index bd9758a3fcf5..7036a7b22e8e 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -436,7 +436,7 @@ namespace pcr
void OBrowserListBox::Resize()
{
Rectangle aPlayground( Point( 0, 0 ), GetOutputSizePixel() );
- Size aHelpWindowDistance( LogicToPixel( Size( 0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT ), MAP_APPFONT ) );
+ Size aHelpWindowDistance( LogicToPixel( Size( 0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT ), MapUnit::MapAppFont ) );
long nHelpWindowHeight = m_nCurrentPreferredHelpHeight = impl_getPrefererredHelpHeight();
bool bPositionHelpWindow = ( nHelpWindowHeight != 0 );
@@ -773,7 +773,7 @@ namespace pcr
if ( HasHelpSection() )
{
- Size aHelpWindowDistance( LogicToPixel( Size( 0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT ), MAP_APPFONT ) );
+ Size aHelpWindowDistance( LogicToPixel( Size( 0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT ), MapUnit::MapAppFont ) );
nMinHeight += aHelpWindowDistance.Height();
nMinHeight += m_pHelpWindow->GetMinimalHeightPixel();
diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx
index 400739aa8e46..61a8a718e472 100644
--- a/extensions/source/propctrlr/fontdialog.cxx
+++ b/extensions/source/propctrlr/fontdialog.cxx
@@ -224,7 +224,7 @@ namespace pcr
// build SfxItems with the values
SvxFontItem aFontItem((FontFamily)nFontFamily, aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, CFID_FONT);
- nFontHeight = (float)OutputDevice::LogicToLogic(Size(0, (sal_Int32)nFontHeight), MAP_POINT, MAP_TWIP).Height();
+ nFontHeight = (float)OutputDevice::LogicToLogic(Size(0, (sal_Int32)nFontHeight), MapUnit::MapPoint, MapUnit::MapTwip).Height();
SvxFontHeightItem aSvxFontHeightItem((sal_uInt32)nFontHeight,100,CFID_HEIGHT);
FontWeight eWeight=VCLUnoHelper::ConvertFontWeight(nFontWeight);
@@ -328,7 +328,7 @@ namespace pcr
const SvxFontHeightItem& rSvxFontHeightItem =
static_cast<const SvxFontHeightItem&>(_rSet.Get(CFID_HEIGHT));
- float nHeight = (float)OutputDevice::LogicToLogic(Size(0, rSvxFontHeightItem.GetHeight()), MAP_TWIP, MAP_POINT).Height();
+ float nHeight = (float)OutputDevice::LogicToLogic(Size(0, rSvxFontHeightItem.GetHeight()), MapUnit::MapTwip, MapUnit::MapPoint).Height();
lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_HEIGHT,makeAny(nHeight));
}
diff --git a/extensions/source/propctrlr/inspectorhelpwindow.cxx b/extensions/source/propctrlr/inspectorhelpwindow.cxx
index c0090fa582bd..ddf871e5e752 100644
--- a/extensions/source/propctrlr/inspectorhelpwindow.cxx
+++ b/extensions/source/propctrlr/inspectorhelpwindow.cxx
@@ -81,8 +81,8 @@ namespace pcr
long InspectorHelpWindow::impl_getSpaceAboveTextWindow()
{
- Size aSeparatorSize( LogicToPixel( Size( 0, 8 ), MAP_APPFONT ) );
- Size a3AppFontSize( LogicToPixel( Size( 3, 3 ), MAP_APPFONT ) );
+ Size aSeparatorSize( LogicToPixel( Size( 0, 8 ), MapUnit::MapAppFont ) );
+ Size a3AppFontSize( LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ) );
return aSeparatorSize.Height() + a3AppFontSize.Height();
}
@@ -125,12 +125,12 @@ namespace pcr
void InspectorHelpWindow::Resize()
{
- Size a3AppFont( LogicToPixel( Size( 3, 3 ), MAP_APPFONT ) );
+ Size a3AppFont( LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ) );
Rectangle aPlayground( Point( 0, 0 ), GetOutputSizePixel() );
Rectangle aSeparatorArea( aPlayground );
- aSeparatorArea.Bottom() = aSeparatorArea.Top() + LogicToPixel( Size( 0, 8 ), MAP_APPFONT ).Height();
+ aSeparatorArea.Bottom() = aSeparatorArea.Top() + LogicToPixel( Size( 0, 8 ), MapUnit::MapAppFont ).Height();
m_aSeparator->SetPosSizePixel( aSeparatorArea.TopLeft(), aSeparatorArea.GetSize() );
Rectangle aTextArea( aPlayground );
diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx
index 73afae7f3649..41fc4b57d982 100644
--- a/extensions/source/propctrlr/listselectiondlg.cxx
+++ b/extensions/source/propctrlr/listselectiondlg.cxx
@@ -39,7 +39,7 @@ namespace pcr
OSL_PRECOND( m_xListBox.is(), "ListSelectionDialog::ListSelectionDialog: invalid list box!" );
get(m_pEntries, "treeview");
- Size aSize(LogicToPixel(Size(85, 97), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(85, 97), MapUnit::MapAppFont));
m_pEntries->set_width_request(aSize.Width());
m_pEntries->set_height_request(aSize.Height());
diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx
index 6a1cb1b5a9ad..90faba32e8fc 100644
--- a/extensions/source/scanner/grid.cxx
+++ b/extensions/source/scanner/grid.cxx
@@ -153,7 +153,7 @@ GridWindow::GridWindow(vcl::Window* pParent)
, m_aHandles()
, m_nDragIndex(0xffffffff)
{
- SetMapMode(MapMode(MAP_PIXEL));
+ SetMapMode(MapMode(MapUnit::MapPixel));
}
void GridWindow::Init(double* pXValues, double* pYValues, int nValues, bool bCutValues, const BitmapEx &rMarkerBitmap)
@@ -197,7 +197,7 @@ void GridWindow::onResize()
Size GridWindow::GetOptimalSize() const
{
- return LogicToPixel(Size(240, 200), MAP_APPFONT);
+ return LogicToPixel(Size(240, 200), MapUnit::MapAppFont);
}
GridDialog::GridDialog(double* pXValues, double* pYValues, int nValues, vcl::Window* pParent )
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 80cdbdadd379..386bd3ef3eb5 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -192,7 +192,7 @@ public:
}
virtual Size GetOptimalSize() const override
{
- Size aSize(LogicToPixel(Size(PREVIEW_WIDTH, PREVIEW_HEIGHT), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(PREVIEW_WIDTH, PREVIEW_HEIGHT), MapUnit::MapAppFont));
aSize.setWidth(aSize.getWidth()+1);
aSize.setHeight(aSize.getHeight()+1);
return aSize;
@@ -226,7 +226,7 @@ SaneDlg::SaneDlg( vcl::Window* pParent, Sane& rSane, bool bScanEnabled ) :
get(mpScanButton, "scanButton");
get(mpButtonOption, "optionsButton");
get(mpOptionTitle, "optionTitleLabel");
- Size aSize(LogicToPixel(Size(130, 102), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(130, 102), MapUnit::MapAppFont));
mpOptionTitle->set_width_request(aSize.Width());
mpOptionTitle->set_height_request(aSize.Height() / 2);
get(mpOptionDescTxt, "optionsDescLabel");
@@ -952,12 +952,12 @@ void ScanPreview::UpdatePreviewBounds()
void ScanPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
{
Window::Paint(rRenderContext, rRect);
- rRenderContext.SetMapMode(MAP_APPFONT);
+ rRenderContext.SetMapMode(MapUnit::MapAppFont);
rRenderContext.SetFillColor(Color(COL_WHITE));
rRenderContext.SetLineColor(Color(COL_WHITE));
rRenderContext.DrawRect(Rectangle(Point(0, 0),
Size(PREVIEW_WIDTH, PREVIEW_HEIGHT)));
- rRenderContext.SetMapMode(MapMode(MAP_PIXEL));
+ rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel));
// check for sane values
rRenderContext.DrawBitmap(maPreviewRect.TopLeft(), maPreviewRect.GetSize(), maPreviewBitmap);
@@ -1244,7 +1244,7 @@ void ScanPreview::DrawDrag(vcl::RenderContext& rRenderContext)
RasterOp eROP = rRenderContext.GetRasterOp();
rRenderContext.SetRasterOp(RasterOp::Invert);
- rRenderContext.SetMapMode(MapMode(MAP_PIXEL));
+ rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel));
if (mbDragDrawn)
DrawRectangles(rRenderContext, aLastUL, aLastBR);
@@ -1255,7 +1255,7 @@ void ScanPreview::DrawDrag(vcl::RenderContext& rRenderContext)
mbDragDrawn = true;
rRenderContext.SetRasterOp(eROP);
- rRenderContext.SetMapMode(MAP_APPFONT);
+ rRenderContext.SetMapMode(MapUnit::MapAppFont);
}
Point ScanPreview::GetPixelPos( const Point& rIn) const
@@ -1268,12 +1268,12 @@ Point ScanPreview::GetPixelPos( const Point& rIn) const
/ ( maMaxBottomRight.Y() - maMinTopLeft.Y() ) )
);
- return LogicToPixel(aConvert, MAP_APPFONT);
+ return LogicToPixel(aConvert, MapUnit::MapAppFont);
}
Point ScanPreview::GetLogicPos(const Point& rIn) const
{
- Point aConvert = PixelToLogic(rIn, MAP_APPFONT);
+ Point aConvert = PixelToLogic(rIn, MapUnit::MapAppFont);
if( aConvert.X() < 0 )
aConvert.X() = 0;
if( aConvert.X() >= PREVIEW_WIDTH )
diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx
index 22841bf1787a..1cd87e5ac097 100644
--- a/filter/source/flash/swfwriter.cxx
+++ b/filter/source/flash/swfwriter.cxx
@@ -27,8 +27,8 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
-static MapMode aTWIPSMode( MAP_TWIP );
-static MapMode a100thmmMode( MAP_100TH_MM );
+static MapMode aTWIPSMode( MapUnit::MapTwip );
+static MapMode a100thmmMode( MapUnit::Map100thMM );
static sal_Int32 map100thmm( sal_Int32 n100thMM )
{
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index 3db22ad9b8a6..720e8d7e920c 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -45,8 +45,8 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::beans;
-static MapMode aTWIPSMode( MAP_TWIP );
-static MapMode a100thmmMode( MAP_100TH_MM );
+static MapMode aTWIPSMode( MapUnit::MapTwip );
+static MapMode a100thmmMode( MapUnit::Map100thMM );
Point Writer::map( const Point& rPoint ) const
diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx
index 5955b8f1035f..29a75abf43d8 100644
--- a/filter/source/graphicfilter/egif/egif.cxx
+++ b/filter/source/graphicfilter/egif/egif.cxx
@@ -101,10 +101,10 @@ bool GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfi
Size aSize100;
const MapMode aMap( rGraphic.GetPrefMapMode() );
- bool bLogSize = ( aMap.GetMapUnit() != MAP_PIXEL );
+ bool bLogSize = ( aMap.GetMapUnit() != MapUnit::MapPixel );
if( bLogSize )
- aSize100 = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), aMap, MAP_100TH_MM );
+ aSize100 = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), aMap, MapUnit::Map100thMM );
bStatus = true;
nLastPercent = 0;
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index cce464e2faff..f8908a680803 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -468,7 +468,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview )
ImplWriteLong( 0 );
ImplWriteLong( 0 );
Size aSizePoint = OutputDevice::LogicToLogic( pMTF->GetPrefSize(),
- pMTF->GetPrefMapMode(), MAP_POINT );
+ pMTF->GetPrefMapMode(), MapUnit::MapPoint );
ImplWriteLong( aSizePoint.Width() );
ImplWriteLong( aSizePoint.Height() ,PS_RET );
ImplWriteLine( "%%Pages: 0" );
diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx
index b6421501529d..ed955cf947b3 100644
--- a/filter/source/graphicfilter/etiff/etiff.cxx
+++ b/filter/source/graphicfilter/etiff/etiff.cxx
@@ -199,10 +199,10 @@ bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterCo
{
Size aDestMapSize( 300, 300 );
const MapMode aMapMode( aBmp.GetPrefMapMode() );
- if ( aMapMode.GetMapUnit() != MAP_PIXEL )
+ if ( aMapMode.GetMapUnit() != MapUnit::MapPixel )
{
const Size aPrefSize( rGraphic.GetPrefSize() );
- aDestMapSize = OutputDevice::LogicToLogic( aPrefSize, aMapMode, MAP_INCH );
+ aDestMapSize = OutputDevice::LogicToLogic( aPrefSize, aMapMode, MapUnit::MapInch );
}
ImplWriteResolution( mnXResPos, aDestMapSize.Width() );
ImplWriteResolution( mnYResPos, aDestMapSize.Height() );
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index 43534f9e6629..8c2db883b9db 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -878,9 +878,9 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF
// simply set map mode to 1/100-mm (1/10-mm) if the graphic
// does not get not too small (<0.5cm)
if( ( aPrefSize.Width() < 500 ) && ( aPrefSize.Height() < 500 ) )
- rMTF.SetPrefMapMode( MapMode( MAP_10TH_MM ) );
+ rMTF.SetPrefMapMode( MapMode( MapUnit::Map10thMM ) );
else
- rMTF.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
+ rMTF.SetPrefMapMode( MapMode( MapUnit::Map100thMM ) );
}
pVirDev.disposeAndClear();
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index 61906c89bfc7..b2899b543dee 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -129,17 +129,17 @@ static void MakeAsMeta(Graphic &rGraphic)
if( !aSize.Width() || !aSize.Height() )
aSize = Application::GetDefaultDevice()->PixelToLogic(
- aBmp.GetSizePixel(), MAP_100TH_MM );
+ aBmp.GetSizePixel(), MapUnit::Map100thMM );
else
aSize = OutputDevice::LogicToLogic( aSize,
- aBmp.GetPrefMapMode(), MAP_100TH_MM );
+ aBmp.GetPrefMapMode(), MapUnit::Map100thMM );
pVDev->EnableOutput( false );
aMtf.Record( pVDev );
pVDev->DrawBitmap( Point(), aSize, rGraphic.GetBitmap() );
aMtf.Stop();
aMtf.WindStart();
- aMtf.SetPrefMapMode( MAP_100TH_MM );
+ aMtf.SetPrefMapMode( MapUnit::Map100thMM );
aMtf.SetPrefSize( aSize );
rGraphic = aMtf;
}
@@ -514,7 +514,7 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
pVDev->Pop();
aMtf.Stop();
aMtf.WindStart();
- aMtf.SetPrefMapMode( MAP_POINT );
+ aMtf.SetPrefMapMode( MapUnit::MapPoint );
aMtf.SetPrefSize( Size( nWidth, nHeight ) );
rGraphic = aMtf;
}
@@ -680,13 +680,13 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
aMtf.Record( pVDev );
aSize = aBitmap.GetPrefSize();
if( !aSize.Width() || !aSize.Height() )
- aSize = Application::GetDefaultDevice()->PixelToLogic( aBitmap.GetSizePixel(), MAP_100TH_MM );
+ aSize = Application::GetDefaultDevice()->PixelToLogic( aBitmap.GetSizePixel(), MapUnit::Map100thMM );
else
- aSize = OutputDevice::LogicToLogic( aSize, aBitmap.GetPrefMapMode(), MAP_100TH_MM );
+ aSize = OutputDevice::LogicToLogic( aSize, aBitmap.GetPrefMapMode(), MapUnit::Map100thMM );
pVDev->DrawBitmap( Point(), aSize, aBitmap );
aMtf.Stop();
aMtf.WindStart();
- aMtf.SetPrefMapMode( MAP_100TH_MM );
+ aMtf.SetPrefMapMode( MapUnit::Map100thMM );
aMtf.SetPrefSize( aSize );
aGraphic = aMtf;
bHasPreview = bRetValue = true;
@@ -735,7 +735,7 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
aGfxLink, aGraphic.GetGDIMetaFile() ) ) );
CreateMtfReplacementAction( aMtf, rStream, nOrigPos, nPSSize, nPosWMF, nSizeWMF, nPosTIFF, nSizeTIFF );
aMtf.WindStart();
- aMtf.SetPrefMapMode( MAP_POINT );
+ aMtf.SetPrefMapMode( MapUnit::MapPoint );
aMtf.SetPrefSize( Size( nWidth, nHeight ) );
rGraphic = aMtf;
bRetValue = true;
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 20f367a6e2dc..6e09ee464b2b 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -2162,9 +2162,9 @@ void OS2METReader::ReadDsc(sal_uInt16 nDscID, sal_uInt16 /*nDscLen*/)
ReadCoord(b32);
if (nUnitType==0x00 && xr>0 && yr>0)
- aGlobMapMode=MapMode(MAP_INCH,Point(0,0),Fraction(10,xr),Fraction(10,yr));
+ aGlobMapMode=MapMode(MapUnit::MapInch,Point(0,0),Fraction(10,xr),Fraction(10,yr));
else if (nUnitType==0x01 && xr>0 && yr>0)
- aGlobMapMode=MapMode(MAP_CM,Point(0,0),Fraction(10,xr),Fraction(10,yr));
+ aGlobMapMode=MapMode(MapUnit::MapCM,Point(0,0),Fraction(10,xr),Fraction(10,yr));
else
aGlobMapMode=MapMode();
diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx
index 2aa8c6f2a5df..9e10aad98498 100644
--- a/filter/source/graphicfilter/ipcx/ipcx.cxx
+++ b/filter/source/graphicfilter/ipcx/ipcx.cxx
@@ -132,7 +132,7 @@ bool PCXReader::ReadPCX(Graphic & rGraphic)
/*
// set resolution:
if (nResX!=0 && nResY!=0) {
- MapMode aMapMode(MAP_INCH,Point(0,0),Fraction(1,nResX),Fraction(1,nResY));
+ MapMode aMapMode(MapUnit::MapInch,Point(0,0),Fraction(1,nResX),Fraction(1,nResY));
rBitmap.SetPrefMapMode(aMapMode);
rBitmap.SetPrefSize(Size(nWidth,nHeight));
}
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index a5c5a96ea915..916258c344c2 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -1965,7 +1965,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
rGDIMetaFile.Stop();
pVirDev.disposeAndClear();
- rGDIMetaFile.SetPrefMapMode( MapMode( MAP_INCH, Point(), aHRes, aVRes ) );
+ rGDIMetaFile.SetPrefMapMode( MapMode( MapUnit::MapInch, Point(), aHRes, aVRes ) );
rGDIMetaFile.SetPrefSize( aBoundingRect.GetSize() );
pPict->SetEndian(nOrigNumberFormat);
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx
index 7f763836f614..a1cd3ab26007 100644
--- a/filter/source/graphicfilter/ipsd/ipsd.cxx
+++ b/filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -151,10 +151,10 @@ bool PSDReader::ReadPSD(Graphic & rGraphic )
Point aEmptyPoint;
Fraction aFractX( 1, mnXResFixed >> 16 );
Fraction aFractY( 1, mnYResFixed >> 16 );
- MapMode aMapMode( MAP_INCH, aEmptyPoint, aFractX, aFractY );
- Size aPrefSize = OutputDevice::LogicToLogic( aBitmapSize, aMapMode, MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::MapInch, aEmptyPoint, aFractX, aFractY );
+ Size aPrefSize = OutputDevice::LogicToLogic( aBitmapSize, aMapMode, MapUnit::Map100thMM );
rGraphic.SetPrefSize( aPrefSize );
- rGraphic.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
+ rGraphic.SetPrefMapMode( MapMode( MapUnit::Map100thMM ) );
}
}
else
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 39f733648247..f7956310a646 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -1131,7 +1131,7 @@ void TIFFReader::MakePalCol()
nRX=(sal_uLong)(fXResolution*2.54+0.5);
nRY=(sal_uLong)(fYResolution*2.54+0.5);
}
- MapMode aMapMode(MAP_INCH,Point(0,0),Fraction(1,nRX),Fraction(1,nRY));
+ MapMode aMapMode(MapUnit::MapInch,Point(0,0),Fraction(1,nRX),Fraction(1,nRY));
aBitmap.SetPrefMapMode(aMapMode);
aBitmap.SetPrefSize(Size(nImageWidth,nImageLength));
}
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index f46aa331fc1a..da6a5cf1168d 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1131,10 +1131,10 @@ void EscherPropertyContainer::CreateLineProperties(
static Size lcl_SizeToEmu(Size aPrefSize, const MapMode& aPrefMapMode)
{
Size aRetSize;
- if (aPrefMapMode == MAP_PIXEL)
- aRetSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM );
+ if (aPrefMapMode == MapUnit::MapPixel)
+ aRetSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM );
else
- aRetSize = OutputDevice::LogicToLogic( aPrefSize, aPrefMapMode, MAP_100TH_MM );
+ aRetSize = OutputDevice::LogicToLogic( aPrefSize, aPrefMapMode, MapUnit::Map100thMM );
return aRetSize;
}
@@ -1384,7 +1384,7 @@ GraphicObject lclDrawHatch( const css::drawing::Hatch& rHatch, const Color& rBac
pVDev->SetOutputSizePixel(Size(2, 2));
pVDev->EnableOutput(false);
- pVDev->SetMapMode(MapMode(MAP_100TH_MM));
+ pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
aMtf.Clear();
aMtf.Record(pVDev);
pVDev->SetLineColor();
@@ -1393,7 +1393,7 @@ GraphicObject lclDrawHatch( const css::drawing::Hatch& rHatch, const Color& rBac
pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch((HatchStyle)rHatch.Style, Color(rHatch.Color), rHatch.Distance, (sal_uInt16)rHatch.Angle));
aMtf.Stop();
aMtf.WindStart();
- aMtf.SetPrefMapMode(MapMode(MAP_100TH_MM));
+ aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
aMtf.SetPrefSize(rRect.GetSize());
return GraphicObject(Graphic(aMtf));
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index c80b387e9aed..010fadfd57f8 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -63,9 +63,9 @@ using namespace ::com::sun::star::style;
ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx )
: mpEscherEx(&rEx)
- , maMapModeSrc(MAP_100TH_MM)
+ , maMapModeSrc(MapUnit::Map100thMM)
// PowerPoint: 576 dpi, WinWord: 1440 dpi, Excel: 1440 dpi
- , maMapModeDest( MAP_INCH, Point(), Fraction( 1, EES_MAP_FRACTION ), Fraction( 1, EES_MAP_FRACTION ) )
+ , maMapModeDest( MapUnit::MapInch, Point(), Fraction( 1, EES_MAP_FRACTION ), Fraction( 1, EES_MAP_FRACTION ) )
, mpPicStrm(nullptr)
, mpHostAppData(nullptr)
, mbIsTitlePossible(false)
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 77595942c545..4d0fa1222b50 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -189,15 +189,15 @@ void Impl_OlePres::Write( SvStream & rStm )
DBG_ASSERT( pMtf->GetPrefMapMode().GetOrigin() == Point(),
"Origin-Verschiebung im Mtf" );
MapUnit nMU = pMtf->GetPrefMapMode().GetMapUnit();
- if( MAP_100TH_MM != nMU )
+ if( MapUnit::Map100thMM != nMU )
{
Size aPrefS( pMtf->GetPrefSize() );
Size aS( aPrefS );
- aS = OutputDevice::LogicToLogic( aS, nMU, MAP_100TH_MM );
+ aS = OutputDevice::LogicToLogic( aS, nMU, MapUnit::Map100thMM );
pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ),
Fraction( aS.Height(), aPrefS.Height() ) );
- pMtf->SetPrefMapMode( MAP_100TH_MM );
+ pMtf->SetPrefMapMode( MapUnit::Map100thMM );
pMtf->SetPrefSize( aS );
}
WriteWindowMetafileBits( rStm, *pMtf );
@@ -1018,7 +1018,7 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
if ( nLineFlags & 0x10 )
{
- bool bScaleArrows = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP;
+ bool bScaleArrows = rManager.pSdrModel->GetScaleUnit() == MapUnit::MapTwip;
// LineStart
@@ -2628,7 +2628,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
if( eShadowType != mso_shadowOffset && !bNonZeroShadowOffset )
{
//0.12" == 173 twip == 302 100mm
- sal_uInt32 nDist = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP ? 173: 302;
+ sal_uInt32 nDist = rManager.pSdrModel->GetScaleUnit() == MapUnit::MapTwip ? 173: 302;
rSet.Put( makeSdrShadowXDistItem( nDist ) );
rSet.Put( makeSdrShadowYDistItem( nDist ) );
}
@@ -3138,7 +3138,7 @@ void SvxMSDffManager::ScaleEmu( sal_Int32& rVal ) const
sal_uInt32 SvxMSDffManager::ScalePt( sal_uInt32 nVal ) const
{
MapUnit eMap = pSdrModel->GetScaleUnit();
- Fraction aFact( GetMapFactor( MAP_POINT, eMap ).X() );
+ Fraction aFact( GetMapFactor( MapUnit::MapPoint, eMap ).X() );
long aMul = aFact.GetNumerator();
long aDiv = aFact.GetDenominator() * 65536;
aFact = Fraction( aMul, aDiv ); // try again to shorten it
@@ -3158,7 +3158,7 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
// PPT works in units of 576DPI
// WW on the other side uses twips, i.e. 1440DPI.
MapUnit eMap = pSdrModel->GetScaleUnit();
- Fraction aFact( GetMapFactor(MAP_INCH, eMap).X() );
+ Fraction aFact( GetMapFactor(MapUnit::MapInch, eMap).X() );
long nMul=aFact.GetNumerator();
long nDiv=aFact.GetDenominator()*nApplicationScale;
aFact=Fraction(nMul,nDiv); // try again to shorten it
@@ -3170,7 +3170,7 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
// MS-DFF-Properties are mostly given in EMU (English Metric Units)
// 1mm=36000emu, 1twip=635emu
- aFact=GetMapFactor(MAP_100TH_MM,eMap).X();
+ aFact=GetMapFactor(MapUnit::Map100thMM,eMap).X();
nMul=aFact.GetNumerator();
nDiv=aFact.GetDenominator()*360;
aFact=Fraction(nMul,nDiv); // try again to shorten it
@@ -3180,7 +3180,7 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
nEmuDiv=aFact.GetDenominator();
// And something for typographic Points
- aFact=GetMapFactor(MAP_POINT,eMap).X();
+ aFact=GetMapFactor(MapUnit::MapPoint,eMap).X();
nPntMul=aFact.GetNumerator();
nPntDiv=aFact.GetDenominator();
}
@@ -3691,7 +3691,7 @@ static Size lcl_GetPrefSize(const Graphic& rGraf, const MapMode& aWanted)
if (aPrefMapMode == aWanted)
return rGraf.GetPrefSize();
Size aRetSize;
- if (aPrefMapMode == MAP_PIXEL)
+ if (aPrefMapMode == MapUnit::MapPixel)
{
aRetSize = Application::GetDefaultDevice()->PixelToLogic(
rGraf.GetPrefSize(), aWanted);
@@ -3721,7 +3721,7 @@ static void lcl_ApplyCropping( const DffPropSet& rPropSet, SfxItemSet* pSet, Gra
sal_uInt32 nTop( 0 ), nBottom( 0 ), nLeft( 0 ), nRight( 0 );
if ( pSet ) // use crop attributes ?
- aCropSize = lcl_GetPrefSize( rGraf, MAP_100TH_MM );
+ aCropSize = lcl_GetPrefSize( rGraf, MapUnit::Map100thMM );
else
{
aCropBitmap = rGraf.GetBitmapEx();
@@ -4423,7 +4423,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
rOutliner.SetUpdateMode( false );
rOutliner.SetText( *pParaObj );
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK);
- pVirDev->SetMapMode( MAP_100TH_MM );
+ pVirDev->SetMapMode( MapUnit::Map100thMM );
sal_Int32 i, nParagraphs = rOutliner.GetParagraphCount();
if ( nParagraphs )
{
@@ -6479,7 +6479,7 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect
aMtf.Scale( (double) aMtfSize100.Width() / aOldSize.Width(),
(double) aMtfSize100.Height() / aOldSize.Height() );
aMtf.SetPrefSize( aMtfSize100 );
- aMtf.SetPrefMapMode( MAP_100TH_MM );
+ aMtf.SetPrefMapMode( MapUnit::Map100thMM );
rData = aMtf;
}
}
@@ -6584,7 +6584,7 @@ bool SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile &
// SV tries to guess a best match for the right value
Size aSize = rMtf.GetPrefSize();
const MapMode& aMMSrc = rMtf.GetPrefMapMode();
- MapMode aMMDst( MAP_100TH_MM );
+ MapMode aMMDst( MapUnit::Map100thMM );
aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
aEle.SetSize( aSize );
aEle.SetAspect( nAspect );
@@ -7031,7 +7031,7 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo
else
{
aSz = rVisArea.GetSize();
- aSz = OutputDevice::LogicToLogic( aSz, MapMode( MAP_100TH_MM ), aMapMode );
+ aSz = OutputDevice::LogicToLogic( aSz, MapMode( MapUnit::Map100thMM ), aMapMode );
}
// don't modify the object
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index f9a2c19e21db..01b3366e2fd1 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2503,7 +2503,7 @@ Size SdrPowerPointImport::GetPageSize() const
long nInchMul = 1, nInchDiv = 1;
if ( bInch )
{ // temporarily convert size (for rounding it) from inch to metric units
- Fraction aFact(GetMapFactor(eMap,MAP_100TH_MM).X());
+ Fraction aFact(GetMapFactor(eMap,MapUnit::Map100thMM).X());
nInchMul = aFact.GetNumerator();
nInchDiv = aFact.GetDenominator();
aRet.Width() = BigMulDiv( aRet.Width(), nInchMul, nInchDiv );
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index df7de8f45f9a..a4efda00bff6 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1621,7 +1621,7 @@ ImplErrorDialog::ImplErrorDialog(const std::set< vcl::PDFWriter::ErrorCode >& rE
get(m_pErrors, "errors");
get(m_pExplanation, "message");
- Size aSize(LogicToPixel(Size(100, 75), MapMode(MAP_APPFONT)));
+ Size aSize(LogicToPixel(Size(100, 75), MapMode(MapUnit::MapAppFont)));
m_pErrors->set_width_request(aSize.Width());
m_pErrors->set_height_request(aSize.Height());
m_pExplanation->set_width_request(aSize.Width());
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 14840bd92f3c..c36be38c62c9 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -199,7 +199,7 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter,
rPDFExtOutDevData.SetCurrentPageNumber( nCurrentPage );
GDIMetaFile aMtf;
- const MapMode aMapMode( MAP_100TH_MM );
+ const MapMode aMapMode( MapUnit::Map100thMM );
const Size aMtfSize( aPageSize.Width, aPageSize.Height );
pOut->Push();
@@ -241,7 +241,7 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter,
{
bRet = true; // #i18334# nPageCount == 0,
rPDFWriter.NewPage( 10000, 10000 ); // creating dummy page
- rPDFWriter.SetMapMode( MAP_100TH_MM );
+ rPDFWriter.SetMapMode( MapUnit::Map100thMM );
}
}
}
@@ -1014,7 +1014,7 @@ void PDFExport::showErrors( const std::set< vcl::PDFWriter::ErrorCode >& rErrors
bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& rPDFExtOutDevData, const GDIMetaFile& rMtf )
{
- const Size aSizePDF( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_POINT ) );
+ const Size aSizePDF( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::MapPoint ) );
Point aOrigin;
Rectangle aPageRect( aOrigin, rMtf.GetPrefSize() );
bool bRet = true;
@@ -1071,7 +1071,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi
OutputDevice* pDev = rWriter.GetReferenceDevice();
pDev->Push();
pDev->SetFont( aFont );
- pDev->SetMapMode( MapMode( MAP_POINT ) );
+ pDev->SetMapMode( MapMode( MapUnit::MapPoint ) );
int w = 0;
while( ( w = pDev->GetTextWidth( msWatermark ) ) > nTextWidth )
{
@@ -1094,7 +1094,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi
pDev->Pop();
rWriter.Push();
- rWriter.SetMapMode( MapMode( MAP_POINT ) );
+ rWriter.SetMapMode( MapMode( MapUnit::MapPoint ) );
rWriter.SetFont( aFont );
rWriter.SetTextColor( COL_LIGHTGREEN );
Point aTextPoint;
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index cce9f68d88cd..1cd7fa3ddc9c 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1967,7 +1967,7 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag
aMtf.AddAction( new MetaBmpExScaleAction( aNullPt, aSize, aGraphic.GetBitmapEx() ) );
aMtf.SetPrefSize( aSize );
- aMtf.SetPrefMapMode( MAP_100TH_MM );
+ aMtf.SetPrefMapMode( MapUnit::Map100thMM );
(*mpObjects)[ rxShape ] = ObjectRepresentation( rxShape, aMtf );
}
@@ -2032,14 +2032,14 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag
pAction->Duplicate();
aEmbeddedBitmapMtf.AddAction( pAction );
aEmbeddedBitmapMtf.SetPrefSize( aSize );
- aEmbeddedBitmapMtf.SetPrefMapMode( MAP_100TH_MM );
+ aEmbeddedBitmapMtf.SetPrefMapMode( MapUnit::Map100thMM );
mEmbeddedBitmapActionSet.insert( ObjectRepresentation( rxShape, aEmbeddedBitmapMtf ) );
pAction->Duplicate();
aMtf.AddAction( pAction );
}
}
aMtf.SetPrefSize( aSize );
- aMtf.SetPrefMapMode( MAP_100TH_MM );
+ aMtf.SetPrefMapMode( MapUnit::Map100thMM );
mEmbeddedBitmapActionMap[ rxShape ] = ObjectRepresentation( rxShape, aMtf );
}
}
@@ -2324,7 +2324,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void )
void SVGExport::writeMtf( const GDIMetaFile& rMtf )
{
- const Size aSize( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_MM ) );
+ const Size aSize( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::MapMM ) );
rtl::OUString aAttr;
Reference< XExtendedDocumentHandler> xExtDocHandler( GetDocHandler(), UNO_QUERY );
@@ -2363,8 +2363,8 @@ void SVGExport::writeMtf( const GDIMetaFile& rMtf )
aObjects.push_back( ObjectRepresentation( Reference< XInterface >(), rMtf ) );
SVGFontExport aSVGFontExport( *this, aObjects );
- Point aPoint100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefMapMode().GetOrigin(), rMtf.GetPrefMapMode(), MAP_100TH_MM ) );
- Size aSize100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_100TH_MM ) );
+ Point aPoint100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefMapMode().GetOrigin(), rMtf.GetPrefMapMode(), MapUnit::Map100thMM ) );
+ Size aSize100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::Map100thMM ) );
SVGActionWriter aWriter( *this, aSVGFontExport );
aWriter.WriteMetaFile( aPoint100thmm, aSize100thmm, rMtf,
diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx
index 366c673bbb79..39b7276f3f7f 100644
--- a/filter/source/svg/svgfontexport.cxx
+++ b/filter/source/svg/svgfontexport.cxx
@@ -190,7 +190,7 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont )
aFont.SetFontSize( Size( 0, nFontEM ) );
aFont.SetAlignment( ALIGN_BASELINE );
- pVDev->SetMapMode( MAP_100TH_MM );
+ pVDev->SetMapMode( MapUnit::Map100thMM );
pVDev->SetFont( aFont );
mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", aCurIdStr += OUString::number( ++mnCurFontId ) );
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 4e6bb1d71677..e3c74c743ba5 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1768,7 +1768,7 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport
{
mpVDev = VclPtr<VirtualDevice>::Create();
mpVDev->EnableOutput( false );
- maTargetMapMode = MAP_100TH_MM;
+ maTargetMapMode = MapUnit::Map100thMM;
maTextWriter.setVirtualDevice( mpVDev, maTargetMapMode );
}
@@ -3773,11 +3773,11 @@ void SVGActionWriter::WriteMetaFile( const Point& rPos100thmm,
mpVDev->Push();
- Size aSize( OutputDevice::LogicToLogic( rSize100thmm, MAP_100TH_MM, aMapMode ) );
+ Size aSize( OutputDevice::LogicToLogic( rSize100thmm, MapUnit::Map100thMM, aMapMode ) );
aMapMode.SetScaleX( aFractionX *= Fraction( aSize.Width(), aPrefSize.Width() ) );
aMapMode.SetScaleY( aFractionY *= Fraction( aSize.Height(), aPrefSize.Height() ) );
- Point aOffset( OutputDevice::LogicToLogic( rPos100thmm, MAP_100TH_MM, aMapMode ) );
+ Point aOffset( OutputDevice::LogicToLogic( rPos100thmm, MapUnit::Map100thMM, aMapMode ) );
aMapMode.SetOrigin( aOffset += aMapMode.GetOrigin() );
mpVDev->SetMapMode( aMapMode );
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index d8a7aef7d3ca..1c5a411e567b 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -1353,13 +1353,13 @@ void SvxPathControl::Resize()
m_pHeaderBar->SetItemSize(ITEMID_NAME, nFirstColumnWidth);
m_pHeaderBar->SetItemSize(ITEMID_TYPE, 0xFFFF);
long nTabs[] = {2, 0, nFirstColumnWidth};
- m_pFocusCtrl->SetTabs(&nTabs[0], MAP_PIXEL);
+ m_pFocusCtrl->SetTabs(&nTabs[0], MapUnit::MapPixel);
}
}
Size SvxPathControl::GetOptimalSize() const
{
- Size aDefSize(LogicToPixel(Size(150, 0), MapMode(MAP_APPFONT)));
+ Size aDefSize(LogicToPixel(Size(150, 0), MapMode(MapUnit::MapAppFont)));
Size aOptSize(m_pVBox->GetOptimalSize());
long nRowHeight(GetTextHeight());
aOptSize.Height() = nRowHeight * 10;
@@ -1413,7 +1413,7 @@ XMLFilterListBox::XMLFilterListBox(Window* pParent, SvxPathControl* pPathControl
static long nTabs[] = {2, 0, nTabSize };
SetSelectionMode( SelectionMode::Multiple );
- SetTabs( &nTabs[0], MAP_PIXEL );
+ SetTabs( &nTabs[0], MapUnit::MapPixel );
SetScrolledHdl( LINK( this, XMLFilterListBox, TabBoxScrollHdl_Impl ) );
SetHighlightRange();
Show();
@@ -1464,7 +1464,7 @@ IMPL_LINK( XMLFilterListBox, HeaderEndDrag_Impl, HeaderBar*, pBar, void )
long nW = m_pHeaderBar->GetItemSize(i);
aSz.Width() = nW + nTmpSz;
nTmpSz += nW;
- SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width() );
+ SetTab( i, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() );
}
}
}
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx
index 2ce0db903d7f..b961a320d638 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -345,12 +345,12 @@ namespace frm
::Size aSize = pControl->GetSizePixel();
const MapUnit eTargetUnit = pTargetDevice->GetMapMode().GetMapUnit();
- if ( eTargetUnit != MAP_PIXEL )
+ if ( eTargetUnit != MapUnit::MapPixel )
aSize = pTargetDevice->PixelToLogic( aSize );
::Point aPos( _nX, _nY );
// the XView::draw API talks about pixels, always ...
- if ( eTargetUnit != MAP_PIXEL )
+ if ( eTargetUnit != MapUnit::MapPixel )
aPos = pTargetDevice->PixelToLogic( aPos );
pControl->Draw( pTargetDevice, aPos, aSize, DrawFlags::NoControls );
diff --git a/forms/source/richtext/richtextengine.cxx b/forms/source/richtext/richtextengine.cxx
index 21fce972d948..4a9a217253ef 100644
--- a/forms/source/richtext/richtextengine.cxx
+++ b/forms/source/richtext/richtextengine.cxx
@@ -63,7 +63,7 @@ namespace frm
pPool->SetPoolDefaultItem( SvxFontItem( aFont.GetFamilyType(), aFont.GetFamilyName(), OUString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO ) );
// 12 pt font size
- MapMode aPointMapMode( MAP_POINT );
+ MapMode aPointMapMode( MapUnit::MapPoint );
Size a12PointSize( OutputDevice::LogicToLogic( Size( 12, 0 ), aPointMapMode, aDeviceMapMode ) );
pPool->SetPoolDefaultItem( SvxFontHeightItem( a12PointSize.Width(), 100, EE_CHAR_FONTHEIGHT ) );
diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx
index ca1bda40792f..3bc77a4d52c4 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -581,7 +581,7 @@ namespace frm
// translate coordinates
Point aPos( _rPos );
Size aSize( _rSize );
- if ( aOriginalMapMode.GetMapUnit() == MAP_PIXEL )
+ if ( aOriginalMapMode.GetMapUnit() == MapUnit::MapPixel )
{
aPos = _pDev->PixelToLogic( _rPos, aNormalizedMapMode );
aSize = _pDev->PixelToLogic( _rSize, aNormalizedMapMode );
diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx
index 1e9998700cfa..19eaa93fc898 100644
--- a/forms/source/richtext/rtattributehandler.cxx
+++ b/forms/source/richtext/rtattributehandler.cxx
@@ -326,12 +326,12 @@ namespace frm
{
// by definition, the item should have the unit twip
sal_uLong nHeight = pFontHeightItem->GetHeight();
- if ( _rAttribs.GetPool()->GetMetric( getWhich() ) != MAP_TWIP )
+ if ( _rAttribs.GetPool()->GetMetric( getWhich() ) != MapUnit::MapTwip )
{
nHeight = OutputDevice::LogicToLogic(
Size( 0, nHeight ),
MapMode( (MapUnit)( _rAttribs.GetPool()->GetMetric( getWhich() ) ) ),
- MapMode( MAP_TWIP )
+ MapMode( MapUnit::MapTwip )
).Height();
}
@@ -354,11 +354,11 @@ namespace frm
// correct measurement units
MapUnit eItemMapUnit = pFontHeightItem->GetPropUnit(); (void)eItemMapUnit;
sal_uLong nHeight = pFontHeightItem->GetHeight();
- if ( _rNewAttribs.GetPool()->GetMetric( getWhich() ) != MAP_TWIP )
+ if ( _rNewAttribs.GetPool()->GetMetric( getWhich() ) != MapUnit::MapTwip )
{
nHeight = OutputDevice::LogicToLogic(
Size( 0, nHeight ),
- MapMode( (MapUnit)( MAP_TWIP ) ),
+ MapMode( (MapUnit)( MapUnit::MapTwip ) ),
MapMode( (MapUnit)( _rNewAttribs.GetPool()->GetMetric( getWhich() ) ) )
).Height();
}
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index b758523ae951..913106c07500 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -272,7 +272,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
m_pFtFuncName->SetText("");
pParent->get(m_pMEFormula, "ed_formula");
- Size aSize(pParent->LogicToPixel(Size(203, 43), MAP_APPFONT));
+ Size aSize(pParent->LogicToPixel(Size(203, 43), MapUnit::MapAppFont));
m_pMEFormula->set_height_request(aSize.Height());
m_pMEFormula->set_width_request(aSize.Width());
pParent->get(m_pBtnMatrix, "array");
diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx
index 42dd5adc1656..9a20545c9228 100644
--- a/formula/source/ui/dlg/funcpage.cxx
+++ b/formula/source/ui/dlg/funcpage.cxx
@@ -65,7 +65,7 @@ FuncPage::FuncPage(vcl::Window* pParent,const IFunctionManager* _pFunctionManage
get(m_pLbCategory, "category");
get(m_pLbFunction, "function");
m_pLbFunction->SetStyle(m_pLbFunction->GetStyle() | WB_SORT);
- Size aSize(LogicToPixel(Size(86 , 162), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(86 , 162), MapUnit::MapAppFont));
m_pLbFunction->set_height_request(aSize.Height());
m_pLbFunction->set_width_request(aSize.Width());
m_aHelpId = m_pLbFunction->GetHelpId();
diff --git a/formula/source/ui/dlg/structpg.cxx b/formula/source/ui/dlg/structpg.cxx
index 7b5c4bcd7ca0..f60862c5c6b5 100644
--- a/formula/source/ui/dlg/structpg.cxx
+++ b/formula/source/ui/dlg/structpg.cxx
@@ -87,7 +87,7 @@ StructPage::StructPage(vcl::Window* pParent):
pSelectedToken ( nullptr )
{
get(m_pTlbStruct, "struct");
- Size aSize(LogicToPixel(Size(86, 162), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(86, 162), MapUnit::MapAppFont));
m_pTlbStruct->set_height_request(aSize.Height());
m_pTlbStruct->set_width_request(aSize.Width());
m_pTlbStruct->SetStyle(m_pTlbStruct->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index c146c5756c06..e3a832bc7a09 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -28,7 +28,7 @@ PlacesListBox_Impl::PlacesListBox_Impl( PlacesListBox* pParent, const OUString&
mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( 600, 16 ) );
long pTabs[] = { 2, 20, 600 };
- SetTabs( &pTabs[0], MAP_PIXEL );
+ SetTabs( &pTabs[0], MapUnit::MapPixel );
mpHeaderBar->InsertItem( COLUMN_NAME, rTitle, 600, HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER );
Size aHeadSize = mpHeaderBar->GetSizePixel();
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 9eab3c15cd6f..10140e0d371d 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -603,7 +603,7 @@ void SvtFileDialog::Init_Impl
_pImp->_bMultiSelection = true;
_pContainer.reset(VclPtr<CustomContainer>::Create(get<vcl::Window>("container")));
- Size aSize(LogicToPixel(Size(270, 85), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(270, 85), MapUnit::MapAppFont));
_pContainer->set_height_request(aSize.Height());
_pContainer->set_width_request(aSize.Width());
_pContainer->set_hexpand(true);
@@ -2542,7 +2542,7 @@ void SvtFileDialog::AddControls_Impl( )
_pImp->_pPlaces = VclPtr<PlacesListBox>::Create(_pContainer, this, SVT_RESSTR(STR_PLACES_TITLE), WB_BORDER);
_pImp->_pPlaces->SetHelpId("SVT_HID_FILESAVE_PLACES_LISTBOX");
- Size aSize(LogicToPixel(Size(50, 85), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(50, 85), MapUnit::MapAppFont));
_pImp->_pPlaces->set_height_request(aSize.Height());
_pImp->_pPlaces->set_width_request(aSize.Width());
_pImp->_pPlaces->SetSizePixel(aSize);
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index 9cee811117a2..7d07f6e620f7 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -199,7 +199,7 @@ void SvtUpButton_Impl::Click()
Size SvtUpButton_Impl::GetOptimalSize() const
{
- return LogicToPixel(Size(12, 12), MAP_APPFONT);
+ return LogicToPixel(Size(12, 12), MapUnit::MapAppFont);
}
// SvtExpFileDlg_Impl
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index eef9ac9bf288..416c2f86e7da 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -139,7 +139,7 @@ ComboboxToolbarController::ComboboxToolbarController(
// default dropdown size
::Size aLogicalSize( 8, 160 );
- ::Size aPixelSize = m_pComboBox->LogicToPixel( aLogicalSize, MAP_APPFONT );
+ ::Size aPixelSize = m_pComboBox->LogicToPixel( aLogicalSize, MapUnit::MapAppFont );
m_pComboBox->SetSizePixel( ::Size( nWidth, aPixelSize.Height() ));
m_pToolbar->SetItemWindow( m_nID, m_pComboBox );
diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx
index 0831d254237a..fc8003ce58dd 100644
--- a/framework/source/uielement/complextoolbarcontroller.cxx
+++ b/framework/source/uielement/complextoolbarcontroller.cxx
@@ -271,7 +271,7 @@ sal_Int32 ComplexToolbarController::getFontSizePixel( const vcl::Window* pWindow
// Calculate height of the application font used by window
sal_Int32 nHeight = sal_Int32( rFont.GetFontHeight() );
- ::Size aPixelSize = pWindow->LogicToPixel( ::Size( 0, nHeight ), MAP_APPFONT );
+ ::Size aPixelSize = pWindow->LogicToPixel( ::Size( 0, nHeight ), MapUnit::MapAppFont );
return aPixelSize.Height();
}
diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
index e0de120fd08b..dc66c3a93e03 100644
--- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
@@ -130,7 +130,7 @@ DropdownToolbarController::DropdownToolbarController(
// default dropdown size
::Size aLogicalSize( 0, 160 );
- ::Size aPixelSize = m_pListBoxControl->LogicToPixel( aLogicalSize, MAP_APPFONT );
+ ::Size aPixelSize = m_pListBoxControl->LogicToPixel( aLogicalSize, MapUnit::MapAppFont );
m_pListBoxControl->SetSizePixel( ::Size( nWidth, aPixelSize.Height() ));
m_pToolbar->SetItemWindow( m_nID, m_pListBoxControl );
diff --git a/include/editeng/fhgtitem.hxx b/include/editeng/fhgtitem.hxx
index b27f9985ab06..552f7807b13a 100644
--- a/include/editeng/fhgtitem.hxx
+++ b/include/editeng/fhgtitem.hxx
@@ -74,7 +74,7 @@ public:
}
void SetHeight( sal_uInt32 nNewHeight, const sal_uInt16 nNewProp = 100,
- MapUnit eUnit = MAP_RELATIVE );
+ MapUnit eUnit = MapUnit::MapRelative );
void SetHeight( sal_uInt32 nNewHeight, sal_uInt16 nNewProp,
MapUnit eUnit, MapUnit eCoreUnit );
diff --git a/include/editeng/paperinf.hxx b/include/editeng/paperinf.hxx
index 566e741b81e0..8b0d45469454 100644
--- a/include/editeng/paperinf.hxx
+++ b/include/editeng/paperinf.hxx
@@ -36,8 +36,8 @@ class Size;
class EDITENG_DLLPUBLIC SvxPaperInfo
{
public:
- static Size GetDefaultPaperSize( MapUnit eUnit = MAP_TWIP );
- static Size GetPaperSize( Paper ePaper, MapUnit eUnit = MAP_TWIP );
+ static Size GetDefaultPaperSize( MapUnit eUnit = MapUnit::MapTwip );
+ static Size GetPaperSize( Paper ePaper, MapUnit eUnit = MapUnit::MapTwip );
static Size GetPaperSize( const Printer* pPrinter );
static Paper GetSvxPaper( const Size &rSize, MapUnit eUnit, bool bSloppy = false );
static long GetSloppyPaperDimension( long nSize );
diff --git a/include/svtools/simptabl.hxx b/include/svtools/simptabl.hxx
index 500d23868c89..3890e44b6784 100644
--- a/include/svtools/simptabl.hxx
+++ b/include/svtools/simptabl.hxx
@@ -99,7 +99,7 @@ public:
sal_uInt16 nCol=HEADERBAR_APPEND,
HeaderBarItemBits nBits = HeaderBarItemBits::STDSTYLE);
- void SetTabs(const long* pTabs, MapUnit = MAP_APPFONT);
+ void SetTabs(const long* pTabs, MapUnit = MapUnit::MapAppFont);
void ClearHeader();
diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
index c1cd12fcd1f9..b779494300a3 100644
--- a/include/svtools/svtabbx.hxx
+++ b/include/svtools/svtabbx.hxx
@@ -66,11 +66,11 @@ public:
SvTabListBox( vcl::Window* pParent, WinBits = WB_BORDER );
virtual ~SvTabListBox() override;
virtual void dispose() override;
- void SetTabs(const long* pTabs, MapUnit = MAP_APPFONT);
+ void SetTabs(const long* pTabs, MapUnit = MapUnit::MapAppFont);
sal_uInt16 TabCount() const { return (sal_uInt16)nTabCount; }
using SvTreeListBox::GetTab;
long GetTab( sal_uInt16 nTab ) const;
- void SetTab( sal_uInt16 nTab, long nValue, MapUnit = MAP_APPFONT );
+ void SetTab( sal_uInt16 nTab, long nValue, MapUnit = MapUnit::MapAppFont );
long GetLogicTab( sal_uInt16 nTab );
virtual SvTreeListEntry* InsertEntry( const OUString& rText, SvTreeListEntry* pParent = nullptr,
diff --git a/include/svx/nbdtmg.hxx b/include/svx/nbdtmg.hxx
index 0a1d716b4c03..e87b9b8fba72 100644
--- a/include/svx/nbdtmg.hxx
+++ b/include/svx/nbdtmg.hxx
@@ -186,7 +186,7 @@ class SVX_DLLPUBLIC NBOTypeMgrBase
public:
NBOTypeMgrBase()
: pSet(nullptr)
- , eCoreUnit(MAP_TWIP)
+ , eCoreUnit(MapUnit::MapTwip)
, aNumCharFmtName(OUString())
, bIsLoading(false)
{}
diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx
index 8b3c01e3054e..0ed14863454c 100644
--- a/include/svx/svdetc.hxx
+++ b/include/svx/svdetc.hxx
@@ -80,14 +80,14 @@ public:
// Default FontHeight is 847. The font height uses logical units (MapUnit/MapFraction
// see below for further details). The default setting 847/100mm corresponds to about
- // 24 Point. If e.g. one would use Twips (SetMapUnit(MAP_TWIP)) (20 Twip = 1 Point)
+ // 24 Point. If e.g. one would use Twips (SetMapUnit(MapUnit::MapTwip)) (20 Twip = 1 Point)
// instead, one would need to set the font height to 480, in order to get a 24 Point height.
static size_t GetFontHeight() { return GetDefaults().nFontHeight; }
// The MapMode is needed for the global Outliner.
// Incidentally, every newly instantiated SdrModel is assigned this MapMode by default.
- // Default MapUnit is MAP_100TH_MM
- static MapUnit GetMapUnit() { return MAP_100TH_MM; }
+ // Default MapUnit is MapUnit::Map100thMM
+ static MapUnit GetMapUnit() { return MapUnit::Map100thMM; }
// Default MapFraction is 1/1.
static Fraction GetMapFraction() { return GetDefaults().aMapFraction; }
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index e07d8e754883..4518a83d1a85 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -328,15 +328,15 @@ public:
void SetPersist( ::comphelper::IEmbeddedHelper *p ) { m_pEmbeddedHelper = p; }
// Unit for the symbol coordination
- // Default is 1 logical unit = 1/100mm (Unit=MAP_100TH_MM, Fract=(1,1)).
+ // Default is 1 logical unit = 1/100mm (Unit=MapUnit::Map100thMM, Fract=(1,1)).
// Examples:
- // MAP_POINT, Fraction(72,1) : 1 log Einh = 72 Point = 1 Inch
- // MAP_POINT, Fraction(1,20) : 1 log Einh = 1/20 Point = 1 Twip
- // MAP_TWIP, Fraction(1,1) : 1 log Einh = 1 Twip
- // MAP_100TH_MM, Fraction(1,10) : 1 log Einh = 1/1000mm
- // MAP_MM, Fraction(1000,1) : 1 log Einh = 1000mm = 1m
- // MAP_CM, Fraction(100,1) : 1 log Einh = 100cm = 1m
- // MAP_CM, Fraction(100000,1): 1 log Einh = 100000cm = 1km
+ // MapUnit::MapPoint, Fraction(72,1) : 1 log Einh = 72 Point = 1 Inch
+ // MapUnit::MapPoint, Fraction(1,20) : 1 log Einh = 1/20 Point = 1 Twip
+ // MapUnit::MapTwip, Fraction(1,1) : 1 log Einh = 1 Twip
+ // MapUnit::Map100thMM, Fraction(1,10) : 1 log Einh = 1/1000mm
+ // MapUnit::MapMM, Fraction(1000,1) : 1 log Einh = 1000mm = 1m
+ // MapUnit::MapCM, Fraction(100,1) : 1 log Einh = 100cm = 1m
+ // MapUnit::MapCM, Fraction(100000,1): 1 log Einh = 100000cm = 1km
// (FWIW: you cannot represent light years).
// The scaling unit is needed for the Engine to serve the Clipboard
// with the correct sizes.
diff --git a/include/svx/svdtrans.hxx b/include/svx/svdtrans.hxx
index 440c821ffcd5..2c96e13916b6 100644
--- a/include/svx/svdtrans.hxx
+++ b/include/svx/svdtrans.hxx
@@ -261,12 +261,12 @@ SVX_DLLPUBLIC FrPair GetMapFactor(MapUnit eS, MapUnit eD);
FrPair GetMapFactor(FieldUnit eS, FieldUnit eD);
inline bool IsMetric(MapUnit eU) {
- return (eU==MAP_100TH_MM || eU==MAP_10TH_MM || eU==MAP_MM || eU==MAP_CM);
+ return (eU==MapUnit::Map100thMM || eU==MapUnit::Map10thMM || eU==MapUnit::MapMM || eU==MapUnit::MapCM);
}
inline bool IsInch(MapUnit eU) {
- return (eU==MAP_1000TH_INCH || eU==MAP_100TH_INCH || eU==MAP_10TH_INCH || eU==MAP_INCH ||
- eU==MAP_POINT || eU==MAP_TWIP);
+ return (eU==MapUnit::Map1000thInch || eU==MapUnit::Map100thInch || eU==MapUnit::Map10thInch || eU==MapUnit::MapInch ||
+ eU==MapUnit::MapPoint || eU==MapUnit::MapTwip);
}
inline bool IsMetric(FieldUnit eU) {
diff --git a/include/tools/mapunit.hxx b/include/tools/mapunit.hxx
index 660db9183e6f..334e2f5202bf 100644
--- a/include/tools/mapunit.hxx
+++ b/include/tools/mapunit.hxx
@@ -22,10 +22,17 @@
#include <sal/types.h>
-enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
- MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
- MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT,
- MAP_RELATIVE, MAP_LASTENUMDUMMY };
+enum class MapUnit
+{
+ Map100thMM, Map10thMM, MapMM, MapCM,
+ Map1000thInch, Map100thInch, Map10thInch, MapInch,
+ MapPoint, MapTwip,
+ MapPixel,
+ MapSysFont, MapAppFont,
+ MapRelative,
+ LAST = MapRelative,
+ LASTENUMDUMMY // used as an error return
+};
inline sal_Int64 convertTwipToMm100(sal_Int64 n)
{
diff --git a/include/tools/rc.h b/include/tools/rc.h
index 4566203adeda..8a0428f35a60 100644
--- a/include/tools/rc.h
+++ b/include/tools/rc.h
@@ -23,11 +23,6 @@
#include <tools/rcid.h>
#include <o3tl/typed_flags_set.hxx>
-// Defines for all "Window" resources.
-// (Here are all window styles that are not in WinBits)
-#define RSC_EXTRAMAPUNIT 0xFFFF // do not change that value!
-
-
// Attributes in *.src files
enum class RSWND {
NONE = 0x00,
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 61d5a44feeb1..882f6fb3187a 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -114,7 +114,7 @@ public:
void Clear();
bool Mirror( BmpMirrorFlags nMirrorFlags );
void Move( long nX, long nY );
- // additional Move method getting specifics how to handle MapMode( MAP_PIXEL )
+ // additional Move method getting specifics how to handle MapMode( MapUnit::MapPixel )
void Move( long nX, long nY, long nDPIX, long nDPIY );
void Scale( double fScaleX, double fScaleY );
void Scale( const Fraction& rScaleX, const Fraction& rScaleY );
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index f03822f142a1..9ccfb6700c2d 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1658,11 +1658,11 @@ public:
pixel, i.e. some output modes such as metafile recordings
might be completely unaffected by this method! Use with
care. Furthermore, if the OutputDevice's MapMode is the
- default (that's MAP_PIXEL), then any pixel offset set is
+ default (that's MapUnit::MapPixel), then any pixel offset set is
ignored also. This might be unintuitive for cases, but would
have been far more fragile to implement. What's more, the
reason why the pixel offset was introduced (avoiding rounding
- errors) does not apply for MAP_PIXEL, because one can always
+ errors) does not apply for MapUnit::MapPixel, because one can always
use the MapMode origin then.
@param rOffset
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 7775ba406f6c..6b0da676108c 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -608,7 +608,7 @@ The following structure describes the permissions used in PDF security
OUString SignReason;
OUString SignContact;
css::lang::Locale DocumentLocale; // defines the document default language
- sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
+ sal_uInt32 DPIx, DPIy; // how to handle MapMode( MapUnit::MapPixel )
// 0 here specifies a default handling
PDFWriter::ColorMode ColorMode;
css::uno::Reference< css::security::XCertificate> SignCertificate;
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx
index 3a0fd641a92f..ee2868f47ff3 100644
--- a/lotuswordpro/source/filter/lwppagelayout.cxx
+++ b/lotuswordpro/source/filter/lwppagelayout.cxx
@@ -644,7 +644,7 @@ void LwpPageLayout::GetWidthAndHeight(double& fWidth, double& fHeight)
if (!bScreen)//Printer available
{
Size aPaperSize = pPrinter->GetPaperSize();
- aPaperSize = pPrinter->PixelToLogic( aPaperSize, MapMode( MAP_10TH_MM ) );
+ aPaperSize = pPrinter->PixelToLogic( aPaperSize, MapMode( MapUnit::Map10thMM ) );
fWidth = static_cast<double>(aPaperSize.Width())/100; //cm unit
fHeight = static_cast<double>(aPaperSize.Height())/100;
}
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 3fbe3515bd1b..83a02d4d439b 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1231,7 +1231,7 @@ Reference < XShape > Shape::renderDiagramToGraphic( XmlFilterBase& rFilterBase )
// Size of the rendering
awt::Size aActualSize = mxShape->getSize();
- Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MAP_CM ) );
+ Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MapUnit::MapCM ) );
double fPixelsPer100thmm = static_cast < double > ( aResolution.Width() ) / 100000.0;
awt::Size aSize = awt::Size( static_cast < sal_Int32 > ( ( fPixelsPer100thmm * aActualSize.Width ) + 0.5 ),
static_cast < sal_Int32 > ( ( fPixelsPer100thmm * aActualSize.Height ) + 0.5 ) );
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 3670664d7aac..a70b8d6f1dcf 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1090,8 +1090,8 @@ void DrawingML::WriteSrcRect( const Reference< XPropertySet >& rXPropSet, const
const MapMode& rMapMode = aGraphicObject.GetPrefMapMode();
// GraphicCrop is in mm100, so in case the original size is in pixels, convert it over.
- if (rMapMode.GetMapUnit() == MAP_PIXEL)
- aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, MapMode(MAP_100TH_MM));
+ if (rMapMode.GetMapUnit() == MapUnit::MapPixel)
+ aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, MapMode(MapUnit::Map100thMM));
if ( GetProperty( rXPropSet, "GraphicCrop" ) )
{
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index d61635991cd6..62b8b34aa2c7 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -364,8 +364,8 @@ ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, ShapeHashMap
, mnPictureIdMax( 1 )
, mnXmlNamespace( nXmlNamespace )
, maFraction( 1, 576 )
- , maMapModeSrc( MAP_100TH_MM )
- , maMapModeDest( MAP_INCH, Point(), maFraction, maFraction )
+ , maMapModeSrc( MapUnit::Map100thMM )
+ , maMapModeDest( MapUnit::MapInch, Point(), maFraction, maFraction )
, mpShapeMap( pShapeMap ? pShapeMap : &maShapeMap )
{
mpURLTransformer.reset(new URLTransformer);
diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx
index 5e9d43293b8a..f4ac89353b57 100644
--- a/oox/source/helper/graphichelper.cxx
+++ b/oox/source/helper/graphichelper.cxx
@@ -116,7 +116,7 @@ GraphicHelper::GraphicHelper( const Reference< XComponentContext >& rxContext, c
// get the metric of the output device
OSL_ENSURE( xFrame.is(), "GraphicHelper::GraphicHelper - cannot get target frame" );
// some default just in case, 100 000 is 1 meter in MM100
- Size aDefault = Application::GetDefaultDevice()->LogicToPixel(Size(100000, 100000), MapMode(MAP_100TH_MM));
+ Size aDefault = Application::GetDefaultDevice()->LogicToPixel(Size(100000, 100000), MapMode(MapUnit::Map100thMM));
maDeviceInfo.PixelPerMeterX = aDefault.Width();
maDeviceInfo.PixelPerMeterY = aDefault.Height();
if( xFrame.is() ) try
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 925141580f18..9f4998fb7807 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -280,7 +280,7 @@ OStyle::OStyle()
:OStyle_PBASE(m_aBHelper)
,m_aSize(21000,29700)
{
- const ::Size aDefaultSize = SvxPaperInfo::GetDefaultPaperSize( MAP_100TH_MM );
+ const ::Size aDefaultSize = SvxPaperInfo::GetDefaultPaperSize( MapUnit::Map100thMM );
m_aSize.Height = aDefaultSize.Height();
m_aSize.Width = aDefaultSize.Width();
@@ -591,7 +591,7 @@ void OReportDefinition::init()
{
m_pImpl->m_pReportModel.reset(new OReportModel(this));
m_pImpl->m_pReportModel->GetItemPool().FreezeIdRanges();
- m_pImpl->m_pReportModel->SetScaleUnit( MAP_100TH_MM );
+ m_pImpl->m_pReportModel->SetScaleUnit( MapUnit::Map100thMM );
SdrLayerAdmin& rAdmin = m_pImpl->m_pReportModel->GetLayerAdmin();
rAdmin.NewStandardLayer(RPT_LAYER_FRONT);
rAdmin.NewLayer("back", RPT_LAYER_BACK);
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx
index b0a67b116efe..9907c4f6342f 100644
--- a/reportdesign/source/ui/dlg/Condition.cxx
+++ b/reportdesign/source/ui/dlg/Condition.cxx
@@ -518,7 +518,7 @@ void Condition::updateToolbar(const uno::Reference< report::XReportControlFormat
{
vcl::Font aBaseFont( Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont() );
SvxFont aFont( VCLUnoHelper::CreateFont( _xReportControlFormat->getFontDescriptor(), aBaseFont ) );
- aFont.SetFontHeight( OutputDevice::LogicToLogic( Size( 0, (sal_Int32)aFont.GetFontHeight() ), MAP_POINT, MAP_TWIP ).Height());
+ aFont.SetFontHeight( OutputDevice::LogicToLogic( Size( 0, (sal_Int32)aFont.GetFontHeight() ), MapUnit::MapPoint, MapUnit::MapTwip ).Height());
aFont.SetEmphasisMark( static_cast< FontEmphasisMark >( _xReportControlFormat->getControlTextEmphasis() ) );
aFont.SetRelief( static_cast< FontRelief >( _xReportControlFormat->getCharRelief() ) );
aFont.SetColor( _xReportControlFormat->getCharColor() );
diff --git a/reportdesign/source/ui/dlg/DateTime.cxx b/reportdesign/source/ui/dlg/DateTime.cxx
index b8d8a1fa7d0c..1ebefd570628 100644
--- a/reportdesign/source/ui/dlg/DateTime.cxx
+++ b/reportdesign/source/ui/dlg/DateTime.cxx
@@ -156,12 +156,12 @@ short ODateTimeDialog::Execute()
if ( m_pDate->IsChecked() )
{
OUString sDateFormat = m_pDateListBox->GetSelectEntry();
- nWidth = LogicToLogic(PixelToLogic(Size(GetCtrlTextWidth(sDateFormat),0)).Width(),GetMapMode().GetMapUnit(),MAP_100TH_MM);
+ nWidth = LogicToLogic(PixelToLogic(Size(GetCtrlTextWidth(sDateFormat),0)).Width(),GetMapMode().GetMapUnit(),MapUnit::Map100thMM);
}
if ( m_pTime->IsChecked() )
{
OUString sDateFormat = m_pTimeListBox->GetSelectEntry();
- nWidth = ::std::max<sal_Int32>(LogicToLogic(PixelToLogic(Size(GetCtrlTextWidth(sDateFormat),0)).Width(),GetMapMode().GetMapUnit(),MAP_100TH_MM),nWidth);
+ nWidth = ::std::max<sal_Int32>(LogicToLogic(PixelToLogic(Size(GetCtrlTextWidth(sDateFormat),0)).Width(),GetMapMode().GetMapUnit(),MapUnit::Map100thMM),nWidth);
}
if ( nWidth > 4000 )
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index c3a6b2b84c83..5475a1977987 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -923,7 +923,7 @@ void OFieldExpressionControl::InsertRows( long nRow )
Size OFieldExpressionControl::GetOptimalSize() const
{
- return LogicToPixel(Size(106, 75), MAP_APPFONT);
+ return LogicToPixel(Size(106, 75), MapUnit::MapAppFont);
}
// class OGroupsSortingDialog
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
index 2b1290c7b578..082c544de07a 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -865,7 +865,7 @@ void NavigatorTree::UserData::_disposing(const lang::EventObject& _rSource)
Size NavigatorTree::GetOptimalSize() const
{
- return LogicToPixel(Size(100, 70), MAP_APPFONT);
+ return LogicToPixel(Size(100, 70), MapUnit::MapAppFont);
}
// class ONavigatorImpl
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 101b30173c7f..5ddd32dead06 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -239,7 +239,7 @@ namespace
aFontItem.PutValue( uno::makeAny( aControlFont ), 0 );
_rItemSet.Put(aFontItem);
- _rItemSet.Put(SvxFontHeightItem(OutputDevice::LogicToLogic(Size(0, (sal_Int32)aFont.GetFontHeight()), MAP_POINT, MAP_TWIP).Height(),100,_nFontHeight));
+ _rItemSet.Put(SvxFontHeightItem(OutputDevice::LogicToLogic(Size(0, (sal_Int32)aFont.GetFontHeight()), MapUnit::MapPoint, MapUnit::MapTwip).Height(),100,_nFontHeight));
lang::Locale aLocale;
switch(_nWhich)
{
@@ -390,7 +390,7 @@ namespace
if ( SfxItemState::SET == _rItemSet.GetItemState( _nFontHeight,true,&pItem) && dynamic_cast< const SvxFontHeightItem *>( pItem ) != nullptr)
{
const SvxFontHeightItem* pFontItem = static_cast<const SvxFontHeightItem*>(pItem);
- aNewFont.SetFontHeight(OutputDevice::LogicToLogic(Size(0, pFontItem->GetHeight()), MAP_TWIP, MAP_POINT).Height());
+ aNewFont.SetFontHeight(OutputDevice::LogicToLogic(Size(0, pFontItem->GetHeight()), MapUnit::MapTwip, MapUnit::MapPoint).Height());
}
if ( SfxItemState::SET == _rItemSet.GetItemState( _nPosture,true,&pItem) && dynamic_cast< const SvxPostureItem *>( pItem ) != nullptr)
{
@@ -703,7 +703,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
};
SfxItemPool* pPool( new SfxItemPool(OUString("ReportCharProperties"), ITEMID_FONT,ITEMID_WEIGHT_COMPLEX, aItemInfos, pDefaults) );
- // not needed for font height pPool->SetDefaultMetric( MAP_100TH_MM ); // ripped, don't understand why
+ // not needed for font height pPool->SetDefaultMetric( MapUnit::Map100thMM ); // ripped, don't understand why
pPool->FreezeIdRanges(); // the same
bool bSuccess = false;
try
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx
index eb4383f9a612..6b21aec80a9f 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -103,7 +103,7 @@ ODesignView::ODesignView( vcl::Window* pParent,
SetHelpId(UID_RPT_RPT_APP_VIEW);
ImplInitSettings();
- SetMapMode( MapMode( MAP_100TH_MM ) );
+ SetMapMode( MapMode( MapUnit::Map100thMM ) );
// now create the task pane on the right side :-)
m_pTaskPane = VclPtr<OTaskWindow>::Create(this);
@@ -161,7 +161,7 @@ void ODesignView::dispose()
void ODesignView::initialize()
{
- SetMapMode( MapMode( MAP_100TH_MM ) );
+ SetMapMode( MapMode( MapUnit::Map100thMM ) );
m_aScrollWindow->initialize();
m_aScrollWindow->Show();
}
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 453dce3c726a..dbdadccecd50 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2420,7 +2420,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
pPool->SetDefaults(pDefaults);
- pPool->SetDefaultMetric( MAP_100TH_MM ); // ripped, don't understand why
+ pPool->SetDefaultMetric( MapUnit::Map100thMM ); // ripped, don't understand why
pPool->FreezeIdRanges(); // the same
try
@@ -4217,7 +4217,7 @@ void OReportController::openZoomDialog()
0
};
SfxItemPool* pPool( new SfxItemPool(OUString("ZoomProperties"), SID_ATTR_ZOOM,SID_ATTR_ZOOM, aItemInfos, pDefaults) );
- pPool->SetDefaultMetric( MAP_100TH_MM ); // ripped, don't understand why
+ pPool->SetDefaultMetric( MapUnit::Map100thMM ); // ripped, don't understand why
pPool->FreezeIdRanges(); // the same
try
{
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 07c604f43971..ebc995e2b74a 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -90,7 +90,7 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re
{
//EnableChildTransparentMode();
SetHelpId(HID_REPORTSECTION);
- SetMapMode(MapMode(MAP_100TH_MM));
+ SetMapMode(MapMode(MapUnit::Map100thMM));
SetParentClipMode(ParentClipMode::Clip);
EnableChildTransparentMode( false );
SetPaintTransparent( false );
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
index b1bcc1429459..949a83289c3b 100644
--- a/reportdesign/source/ui/report/ReportWindow.cxx
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -64,7 +64,7 @@ OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView)
,m_pObjFac( new DlgEdFactory() )
{
SetHelpId(UID_RPT_REPORTWINDOW);
- SetMapMode( MapMode( MAP_100TH_MM ) );
+ SetMapMode( MapMode( MapUnit::Map100thMM ) );
m_aViewsWindow->Show();
@@ -174,7 +174,7 @@ void OReportWindow::Resize()
const Size aTotalOutputSize = GetOutputSizePixel();
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100);
- const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 0 ), MAP_APPFONT );
+ const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 0 ), MapUnit::MapAppFont );
Point aStartPoint((long)aStartWidth + aOffset.X(),0);
uno::Reference<report::XReportDefinition> xReportDefinition = getReportView()->getController().getReportDefinition();
const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
@@ -397,7 +397,7 @@ void OReportWindow::fillControlModelSelection(::std::vector< uno::Reference< uno
sal_Int32 OReportWindow::impl_getRealPixelWidth() const
{
const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_pView->getController().getReportDefinition(),PROPERTY_PAPERSIZE).Width;
- MapMode aMap( MAP_100TH_MM );
+ MapMode aMap( MapUnit::Map100thMM );
const Size aPageSize = LogicToPixel(Size(nPaperWidth,0),aMap);
return aPageSize.Width() + REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH + SECTION_OFFSET;
}
@@ -416,7 +416,7 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const
case SvxZoomType::WHOLEPAGE:
{
nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth());
- MapMode aMap( MAP_100TH_MM );
+ MapMode aMap( MapUnit::Map100thMM );
const Size aHeight = m_aViewsWindow->LogicToPixel(m_aViewsWindow->PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler->GetSizePixel().Height())),aMap);
nZoom = ::std::min(nZoom,(sal_uInt16)(long)Fraction(aSize.Height()*100,aHeight.Height()));
}
diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx
index e80990dc0d80..55cf12a58eb8 100644
--- a/reportdesign/source/ui/report/ScrollHelper.cxx
+++ b/reportdesign/source/ui/report/ScrollHelper.cxx
@@ -53,12 +53,12 @@ OScrollWindowHelper::OScrollWindowHelper( ODesignView* _pDesignView)
,m_aReportWindow(VclPtr<rptui::OReportWindow>::Create(this,m_pParent))
,m_pReportDefinitionMultiPlexer(nullptr)
{
- SetMapMode( MapMode( MAP_100TH_MM ) );
+ SetMapMode( MapMode( MapUnit::Map100thMM ) );
impl_initScrollBar( *m_aHScroll.get() );
impl_initScrollBar( *m_aVScroll.get() );
- m_aReportWindow->SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_aReportWindow->SetMapMode( MapMode( MapUnit::Map100thMM ) );
m_aReportWindow->Show();
// normally we should be SCROLL_PANE
@@ -170,7 +170,7 @@ Size OScrollWindowHelper::ResizeScrollBars()
else
m_aCornerWin->Hide();
- const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, SECTION_OFFSET ), MAP_APPFONT );
+ const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, SECTION_OFFSET ), MapUnit::MapAppFont );
// resize scrollbars and set their ranges
{
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100);
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index c94d04032432..9d9230c17835 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -57,7 +57,7 @@ OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< rep
SetMapMode( rMapMode );
ImplInitSettings();
// TRY
- m_aSplitter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_aSplitter->SetMapMode( MapMode( MapUnit::Map100thMM ) );
m_aSplitter->SetStartSplitHdl(LINK(this, OSectionWindow,StartSplitHdl));
m_aSplitter->SetSplitHdl(LINK(this, OSectionWindow,SplitHdl));
m_aSplitter->SetEndSplitHdl(LINK(this, OSectionWindow,EndSplitHdl));
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 561676a843cd..6e2be36bc776 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -173,7 +173,7 @@ OViewsWindow::OViewsWindow( OReportWindow* _pReportWindow)
, m_bInUnmark(false)
{
SetPaintTransparent(true);
- SetMapMode(MapMode(MAP_100TH_MM));
+ SetMapMode(MapMode(MapUnit::Map100thMM));
m_aColorConfig.AddListener(this);
ImplInitSettings();
}
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 4a31d1421a7c..4edcf4adf6f9 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -46,6 +46,7 @@ enum class ButtonType;
enum class WindowAlign;
enum class SfxStyleFamily;
enum class RSWND;
+enum class MapUnit;
struct WriteRcContext
{
@@ -154,6 +155,7 @@ class RscTypCont
inline void SETCONST( RscConst *p1, const char * p2, ButtonType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, const char * p2, WindowAlign p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, const char * p2, SfxStyleFamily p3 ) { SETCONST(p1, p2, static_cast<sal_uInt16>(p3)); }
+ inline void SETCONST( RscConst *p1, const char * p2, MapUnit p3 ) { SETCONST(p1, p2, static_cast<sal_uInt16>(p3)); }
void InitLangType();
RscEnum * InitFieldUnitsType();
RscEnum * InitColor();
diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx
index c397ae4ff823..e035ea97405d 100644
--- a/rsc/source/parser/rscibas.cxx
+++ b/rsc/source/parser/rscibas.cxx
@@ -228,20 +228,19 @@ RscEnum * RscTypCont::InitMapUnit()
RscEnum * pMapUnit;
pMapUnit = new RscEnum( pHS->getID( "EnumMapUnit" ), RSC_NOTYPE );
- SETCONST( pMapUnit, "MAP_PIXEL", MAP_PIXEL );
- SETCONST( pMapUnit, "MAP_SYSFONT", MAP_SYSFONT );
- SETCONST( pMapUnit, "MAP_100TH_MM", MAP_100TH_MM );
- SETCONST( pMapUnit, "MAP_10TH_MM", MAP_10TH_MM );
- SETCONST( pMapUnit, "MAP_MM", MAP_MM );
- SETCONST( pMapUnit, "MAP_CM", MAP_CM );
- SETCONST( pMapUnit, "MAP_1000TH_INCH", MAP_1000TH_INCH );
- SETCONST( pMapUnit, "MAP_100TH_INCH", MAP_100TH_INCH );
- SETCONST( pMapUnit, "MAP_10TH_INCH", MAP_10TH_INCH );
- SETCONST( pMapUnit, "MAP_INCH", MAP_INCH );
- SETCONST( pMapUnit, "MAP_POINT", MAP_POINT );
- SETCONST( pMapUnit, "MAP_TWIP", MAP_TWIP );
- SETCONST( pMapUnit, "MAP_APPFONT", MAP_APPFONT );
- SETCONST( pMapUnit, "MAP_SV", RSC_EXTRAMAPUNIT );
+ SETCONST( pMapUnit, "MAP_PIXEL", MapUnit::MapPixel );
+ SETCONST( pMapUnit, "MAP_SYSFONT", MapUnit::MapSysFont );
+ SETCONST( pMapUnit, "MAP_100TH_MM", MapUnit::Map100thMM );
+ SETCONST( pMapUnit, "MAP_10TH_MM", MapUnit::Map10thMM );
+ SETCONST( pMapUnit, "MAP_MM", MapUnit::MapMM );
+ SETCONST( pMapUnit, "MAP_CM", MapUnit::MapCM );
+ SETCONST( pMapUnit, "MAP_1000TH_INCH", MapUnit::Map1000thInch );
+ SETCONST( pMapUnit, "MAP_100TH_INCH", MapUnit::Map100thInch );
+ SETCONST( pMapUnit, "MAP_10TH_INCH", MapUnit::Map10thInch );
+ SETCONST( pMapUnit, "MAP_INCH", MapUnit::MapInch );
+ SETCONST( pMapUnit, "MAP_POINT", MapUnit::MapPoint );
+ SETCONST( pMapUnit, "MAP_TWIP", MapUnit::MapTwip );
+ SETCONST( pMapUnit, "MAP_APPFONT", MapUnit::MapAppFont );
return pMapUnit;
}
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 3cc09b014f2b..85ab7e6cb719 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -357,7 +357,7 @@ long ScColumn::GetNeededSize(
// the font is not reset each time with !bEditEngine
vcl::Font aOldFont = pDev->GetFont();
- MapMode aHMMMode( MAP_100TH_MM, Point(), rZoomX, rZoomY );
+ MapMode aHMMMode( MapUnit::Map100thMM, Point(), rZoomX, rZoomY );
// save in document ?
ScFieldEditEngine* pEngine = pDocument->CreateFieldEditEngine();
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 94d177cac43e..1dedbae775a9 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -920,9 +920,9 @@ MapUnit ScDocumentPool::GetMetric( sal_uInt16 nWhich ) const
{
// Own attributes in Twips, everything else in 1/100 mm
if ( nWhich >= ATTR_STARTINDEX && nWhich <= ATTR_ENDINDEX )
- return MAP_TWIP;
+ return MapUnit::MapTwip;
else
- return MAP_100TH_MM;
+ return MapUnit::Map100thMM;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index de91bf751f79..d2af6d209bd7 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -504,7 +504,7 @@ ScFieldEditEngine& ScDocument::GetEditEngine()
pEditEngine = new ScFieldEditEngine(this, GetEnginePool(), GetEditPool());
pEditEngine->SetUpdateMode( false );
pEditEngine->EnableUndo( false );
- pEditEngine->SetRefMapMode( MAP_100TH_MM );
+ pEditEngine->SetRefMapMode( MapUnit::Map100thMM );
ApplyAsianEditSettings( *pEditEngine );
}
return *pEditEngine;
@@ -517,7 +517,7 @@ ScNoteEditEngine& ScDocument::GetNoteEngine()
pNoteEngine = new ScNoteEditEngine( GetEnginePool(), GetEditPool() );
pNoteEngine->SetUpdateMode( false );
pNoteEngine->EnableUndo( false );
- pNoteEngine->SetRefMapMode( MAP_100TH_MM );
+ pNoteEngine->SetRefMapMode( MapUnit::Map100thMM );
ApplyAsianEditSettings( *pNoteEngine );
const SfxItemSet& rItemSet = GetDefPattern()->GetItemSet();
SfxItemSet* pEEItemSet = new SfxItemSet( pNoteEngine->GetEmptyItemSet() );
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index e0992b534b6c..e99e32f9df70 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -137,7 +137,7 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) );
pPrinter = VclPtr<SfxPrinter>::Create( pSet );
- pPrinter->SetMapMode( MAP_100TH_MM );
+ pPrinter->SetMapMode( MapUnit::Map100thMM );
UpdateDrawPrinter();
pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
}
@@ -197,7 +197,7 @@ VirtualDevice* ScDocument::GetVirtualDevice_100th_mm()
#endif
pVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::RefDevMode::MSO1);
MapMode aMapMode( pVirtualDevice_100th_mm->GetMapMode() );
- aMapMode.SetMapUnit( MAP_100TH_MM );
+ aMapMode.SetMapUnit( MapUnit::Map100thMM );
pVirtualDevice_100th_mm->SetMapMode( aMapMode );
}
return pVirtualDevice_100th_mm;
@@ -591,9 +591,9 @@ bool ScDocument::IdleCalcTextWidth() // true = try next again
{
pDev = GetPrinter();
aScope.setOldMapMode(pDev->GetMapMode());
- pDev->SetMapMode( MAP_PIXEL ); // Important for GetNeededSize
+ pDev->SetMapMode( MapUnit::MapPixel ); // Important for GetNeededSize
- Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
nPPTX = aPix1000.X() / 1000.0;
nPPTY = aPix1000.Y() / 1000.0;
}
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 711d0a03c532..8cdf00e9eb47 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -505,7 +505,7 @@ bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
pThis->ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab ); // no Refresh, incl. Attrs
OutputDevice* pDev = pThis->GetPrinter();
- pDev->SetMapMode( MAP_PIXEL ); // Important for GetNeededSize
+ pDev->SetMapMode( MapUnit::MapPixel ); // Important for GetNeededSize
ExtendPrintArea( pDev, nTab, 0, nStartRow, nExtendCol, nEndRow );
if ( nExtendCol >= nStartCol )
return false;
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index d9ef0b5659a0..1396caa9861c 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -268,9 +268,9 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const OUString& rName ) :
SetSwapGraphics();
- SetScaleUnit(MAP_100TH_MM);
+ SetScaleUnit(MapUnit::Map100thMM);
SfxItemPool& rPool = GetItemPool();
- rPool.SetDefaultMetric(MAP_100TH_MM);
+ rPool.SetDefaultMetric(MapUnit::Map100thMM);
SvxFrameDirectionItem aModeItem( FRMDIR_ENVIRONMENT, EE_PARA_WRITINGDIR );
rPool.SetPoolDefaultItem( aModeItem );
@@ -2042,7 +2042,7 @@ ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj )
IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
const Point& rWinPoint, const vcl::Window& rCmpWnd )
{
- const MapMode aMap100( MAP_100TH_MM );
+ const MapMode aMap100( MapUnit::Map100thMM );
MapMode aWndMode = rCmpWnd.GetMapMode();
Point aRelPoint( rCmpWnd.LogicToLogic( rWinPoint, &aWndMode, &aMap100 ) );
Rectangle aLogRect = rCmpWnd.LogicToLogic( pObj->GetLogicRect(), &aWndMode, &aMap100 );
@@ -2073,7 +2073,7 @@ IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
if ( rGeo.nShearAngle )
ShearPoint( aRelPoint, aLogRect.TopLeft(), -rGeo.nTan );
- if ( rGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ if ( rGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
aGraphSize = rCmpWnd.PixelToLogic( rGraphic.GetPrefSize(),
aMap100 );
else
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 9966874e313d..1436ecf2a587 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -530,7 +530,7 @@ void ScGlobal::Init()
void ScGlobal::InitPPT()
{
OutputDevice* pDev = Application::GetDefaultDevice();
- Point aPix1000 = pDev->LogicToPixel( Point(100000,100000), MAP_TWIP );
+ Point aPix1000 = pDev->LogicToPixel( Point(100000,100000), MapUnit::MapTwip );
nScreenPPTX = aPix1000.X() / 100000.0;
nScreenPPTY = aPix1000.Y() / 100000.0;
}
@@ -562,12 +562,12 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool)
OutputDevice* pDefaultDev = Application::GetDefaultDevice();
ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *pDefaultDev );
- pVirtWindow->SetMapMode(MAP_PIXEL);
+ pVirtWindow->SetMapMode(MapUnit::MapPixel);
vcl::Font aDefFont;
pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // Font color doesn't matter here
pVirtWindow->SetFont(aDefFont);
sal_uInt16 nTest = static_cast<sal_uInt16>(
- pVirtWindow->PixelToLogic(Size(0, pVirtWindow->GetTextHeight()), MAP_TWIP).Height());
+ pVirtWindow->PixelToLogic(Size(0, pVirtWindow->GetTextHeight()), MapUnit::MapTwip).Height());
if (nTest > nDefFontHeight)
nDefFontHeight = nTest;
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 57e66f692a9a..449071a2cff7 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -391,8 +391,8 @@ void ScPatternAttr::GetFont(
aFraction = *pScale;
Size aSize( 0, (long) nFontHeight );
MapMode aDestMode = pOutDev->GetMapMode();
- MapMode aSrcMode( MAP_TWIP, Point(), aFraction, aFraction );
- if (aDestMode.GetMapUnit() == MAP_PIXEL && pOutDev->GetDPIX() > 0)
+ MapMode aSrcMode( MapUnit::MapTwip, Point(), aFraction, aFraction );
+ if (aDestMode.GetMapUnit() == MapUnit::MapPixel && pOutDev->GetDPIX() > 0)
aEffSize = pOutDev->LogicToPixel( aSize, aSrcMode );
else
{
diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx
index 02a29c377dae..28b5ae0a9cb8 100644
--- a/sc/source/core/data/poolhelp.cxx
+++ b/sc/source/core/data/poolhelp.cxx
@@ -51,7 +51,7 @@ SfxItemPool* ScPoolHelper::GetEditPool() const
if ( !pEditPool )
{
pEditPool = EditEngine::CreatePool();
- pEditPool->SetDefaultMetric( MAP_100TH_MM );
+ pEditPool->SetDefaultMetric( MapUnit::Map100thMM );
pEditPool->FreezeIdRanges();
pEditPool->SetFileFormatVersion( SOFFICE_FILEFORMAT_50 ); // used in ScGlobal::EETextObjEqual
}
@@ -62,7 +62,7 @@ SfxItemPool* ScPoolHelper::GetEnginePool() const
if ( !pEnginePool )
{
pEnginePool = EditEngine::CreatePool();
- pEnginePool->SetDefaultMetric( MAP_100TH_MM );
+ pEnginePool->SetDefaultMetric( MapUnit::Map100thMM );
pEnginePool->FreezeIdRanges();
} // ifg ( pEnginePool )
return pEnginePool;
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index a38889d3a02f..1ad6ebe3c147 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1738,7 +1738,7 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev,
return;
}
- Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
double nPPTX = aPix1000.X() / 1000.0;
double nPPTY = aPix1000.Y() / 1000.0;
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index c2d1d72ebfc4..0922d00741dd 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -331,7 +331,7 @@ Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bForceToT
else
{
MapMode aMode = pDev->GetMapMode();
- pDev->SetMapMode( MAP_PIXEL );
+ pDev->SetMapMode( MapUnit::MapPixel );
long nTextHeight = pDoc->GetNeededSize( nCol, nRow, nTab,
pDev, nPPTX, nPPTY, aZoomX, aZoomY, false );
@@ -711,7 +711,7 @@ ScTabEditEngine::ScTabEditEngine( const ScPatternAttr& rPattern,
void ScTabEditEngine::Init( const ScPatternAttr& rPattern )
{
- SetRefMapMode(MAP_100TH_MM);
+ SetRefMapMode(MapUnit::Map100thMM);
SfxItemSet* pEditDefaults = new SfxItemSet( GetEmptyItemSet() );
rPattern.FillEditItemSet( pEditDefaults );
SetDefaults( pEditDefaults );
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 87da7230f60c..aca7342beeab 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2246,7 +2246,7 @@ void ScInterpreter::ScCell()
vcl::Font aOldFont( pPrinter->GetFont() );
vcl::Font aDefFont;
- pPrinter->SetMapMode( MAP_TWIP );
+ pPrinter->SetMapMode( MapUnit::MapTwip );
// font color doesn't matter here
pDok->GetDefPattern()->GetFont( aDefFont, SC_AUTOCOL_BLACK, pPrinter );
pPrinter->SetFont( aDefFont );
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 1c03ccec29d6..181eb60dc20e 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -3311,7 +3311,7 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
Reference< XChartDocument > const & xChartDoc, const Rectangle& rChartRect ) :
XclExpChGroupBase( XclExpChRoot( rRoot, *this ), EXC_CHFRBLOCK_TYPE_CHART, EXC_ID_CHCHART, 16 )
{
- Size aPtSize = OutputDevice::LogicToLogic( rChartRect.GetSize(), MapMode( MAP_100TH_MM ), MapMode( MAP_POINT ) );
+ Size aPtSize = OutputDevice::LogicToLogic( rChartRect.GetSize(), MapMode( MapUnit::Map100thMM ), MapMode( MapUnit::MapPoint ) );
// rectangle is stored in 16.16 fixed-point format
maRect.mnX = maRect.mnY = 0;
maRect.mnWidth = static_cast< sal_Int32 >( aPtSize.Width() << 16 );
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 6e2ee0622e64..c5a66a5a2e5b 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -258,7 +258,7 @@ void XclExpDffAnchorBase::SetFlags( const SdrObject& rSdrObj )
void XclExpDffAnchorBase::SetSdrObject( const SdrObject& rSdrObj )
{
ImplSetFlags( rSdrObj );
- ImplCalcAnchorRect( rSdrObj.GetCurrentBoundRect(), MAP_100TH_MM );
+ ImplCalcAnchorRect( rSdrObj.GetCurrentBoundRect(), MapUnit::Map100thMM );
}
void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const
@@ -271,7 +271,7 @@ void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const
void XclExpDffAnchorBase::WriteData( EscherEx& rEscherEx, const Rectangle& rRect )
{
// the passed rectangle is in twips
- ImplCalcAnchorRect( rRect, MAP_TWIP );
+ ImplCalcAnchorRect( rRect, MapUnit::MapTwip );
WriteDffData( rEscherEx );
}
@@ -327,7 +327,7 @@ void XclExpDffEmbeddedAnchor::ImplCalcAnchorRect( const Rectangle& rRect, MapUni
XclExpDffNoteAnchor::XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect ) :
XclExpDffAnchorBase( rRoot, EXC_ESC_ANCHOR_SIZELOCKED )
{
- maAnchor.SetRect( rRoot, rRoot.GetCurrScTab(), rRect, MAP_100TH_MM );
+ maAnchor.SetRect( rRoot, rRoot.GetCurrScTab(), rRect, MapUnit::Map100thMM );
}
XclExpDffDropDownAnchor::XclExpDffDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos ) :
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 0ae25f02a302..9a1484d0ac55 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -1703,7 +1703,7 @@ SdrObjectPtr XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const
inserted into the draw page. */
sal_Int64 nAspect = css::embed::Aspects::MSOLE_CONTENT;
MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xEmbObj->getMapUnit( nAspect ) );
- Size aSize( vcl::Window::LogicToLogic( rAnchorRect.GetSize(), MapMode( MAP_100TH_MM ), MapMode( aUnit ) ) );
+ Size aSize( vcl::Window::LogicToLogic( rAnchorRect.GetSize(), MapMode( MapUnit::Map100thMM ), MapMode( aUnit ) ) );
css::awt::Size aAwtSize( aSize.Width(), aSize.Height() );
xEmbObj->setVisualAreaSize( nAspect, aAwtSize );
@@ -1766,7 +1766,7 @@ void XclImpChartObj::FinalizeTabChart()
// create the object anchor
XclObjAnchor aAnchor;
- aAnchor.SetRect( GetRoot(), GetCurrScTab(), Rectangle( 1000, 500, nWidth, nHeight ), MAP_100TH_MM );
+ aAnchor.SetRect( GetRoot(), GetCurrScTab(), Rectangle( 1000, 500, nWidth, nHeight ), MapUnit::Map100thMM );
SetAnchor( aAnchor );
}
@@ -4131,7 +4131,7 @@ void XclImpSheetDrawing::ConvertObjects( XclImpDffConverter& rDffConv )
Rectangle XclImpSheetDrawing::CalcAnchorRect( const XclObjAnchor& rAnchor, bool /*bDffAnchor*/ ) const
{
- return rAnchor.GetRect( GetRoot(), maScUsedArea.aStart.Tab(), MAP_100TH_MM );
+ return rAnchor.GetRect( GetRoot(), maScUsedArea.aStart.Tab(), MapUnit::Map100thMM );
}
void XclImpSheetDrawing::OnObjectInserted( const XclImpDrawObjBase& rDrawObj )
diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx
index 70a4d79dcb15..de02aaab6ac0 100644
--- a/sc/source/filter/excel/xlescher.cxx
+++ b/sc/source/filter/excel/xlescher.cxx
@@ -45,13 +45,13 @@ double lclGetTwipsScale( MapUnit eMapUnit )
Calc's strange definition of a point (1 inch == 72.27 points, instead
of 72 points).
NOTE: Calc's definition changed from TeX points (72.27) to PS points
- (72), so the MAP_TWIP case now actually also delivers a scale of 1.0
+ (72), so the MapUnit::MapTwip case now actually also delivers a scale of 1.0
*/
double fScale = 1.0;
switch( eMapUnit )
{
- case MAP_TWIP: fScale = 1; break; // Calc twips <-> real twips
- case MAP_100TH_MM: fScale = HMM_PER_TWIPS; break; // Calc twips <-> 1/100mm
+ case MapUnit::MapTwip: fScale = 1; break; // Calc twips <-> real twips
+ case MapUnit::Map100thMM: fScale = HMM_PER_TWIPS; break; // Calc twips <-> 1/100mm
default: OSL_FAIL( "lclGetTwipsScale - map unit not implemented" );
}
return fScale;
@@ -183,8 +183,8 @@ void XclObjAnchor::SetRect( const Size& rPageSize, sal_Int32 nScaleX, sal_Int32
double fScale = 1.0;
switch( eMapUnit )
{
- case MAP_TWIP: fScale = HMM_PER_TWIPS; break; // Calc twips -> 1/100mm
- case MAP_100TH_MM: fScale = 1.0; break; // Calc 1/100mm -> 1/100mm
+ case MapUnit::MapTwip: fScale = HMM_PER_TWIPS; break; // Calc twips -> 1/100mm
+ case MapUnit::Map100thMM: fScale = 1.0; break; // Calc 1/100mm -> 1/100mm
default: OSL_FAIL( "XclObjAnchor::SetRect - map unit not implemented" );
}
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index a1d9a20cd703..97ece71e8236 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -344,7 +344,7 @@ ScEditEngineDefaulter& XclRoot::GetEditEngine() const
{
mrData.mxEditEngine.reset( new ScEditEngineDefaulter( GetDoc().GetEnginePool() ) );
ScEditEngineDefaulter& rEE = *mrData.mxEditEngine;
- rEE.SetRefMapMode( MAP_100TH_MM );
+ rEE.SetRefMapMode( MapUnit::Map100thMM );
rEE.SetEditTextObjectPool( GetDoc().GetEditPool() );
rEE.SetUpdateMode( false );
rEE.EnableUndo( false );
@@ -359,7 +359,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const
{
mrData.mxHFEditEngine.reset( new ScHeaderEditEngine( EditEngine::CreatePool() ) );
ScHeaderEditEngine& rEE = *mrData.mxHFEditEngine;
- rEE.SetRefMapMode( MAP_TWIP ); // headers/footers use twips as default metric
+ rEE.SetRefMapMode( MapUnit::MapTwip ); // headers/footers use twips as default metric
rEE.SetUpdateMode( false );
rEE.EnableUndo( false );
rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS );
@@ -386,7 +386,7 @@ EditEngine& XclRoot::GetDrawEditEngine() const
{
mrData.mxDrawEditEng.reset( new EditEngine( &GetDoc().GetDrawLayer()->GetItemPool() ) );
EditEngine& rEE = *mrData.mxDrawEditEng;
- rEE.SetRefMapMode( MAP_100TH_MM );
+ rEE.SetRefMapMode( MapUnit::Map100thMM );
rEE.SetUpdateMode( false );
rEE.EnableUndo( false );
rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS );
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index ac29f3d31184..d30ed4f0b7b8 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -284,7 +284,7 @@ sal_uInt16 ScHTMLExport::ToPixel( sal_uInt16 nVal )
if( nVal )
{
nVal = (sal_uInt16)pAppWin->LogicToPixel(
- Size( nVal, nVal ), MapMode( MAP_TWIP ) ).Width();
+ Size( nVal, nVal ), MapMode( MapUnit::MapTwip ) ).Width();
if( !nVal ) // If there's a Twip there should also be a Pixel
nVal = 1;
}
@@ -294,7 +294,7 @@ sal_uInt16 ScHTMLExport::ToPixel( sal_uInt16 nVal )
Size ScHTMLExport::MMToPixel( const Size& rSize )
{
Size aSize( rSize );
- aSize = pAppWin->LogicToPixel( rSize, MapMode( MAP_100TH_MM ) );
+ aSize = pAppWin->LogicToPixel( rSize, MapMode( MapUnit::Map100thMM ) );
// If there's something there should also be a Pixel
if ( !aSize.Width() && rSize.Width() )
aSize.Width() = 1;
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx
index f57b19734922..7af6d8fe928c 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -84,13 +84,13 @@ ScHTMLImport::ScHTMLImport( ScDocument* pDocP, const OUString& rBaseURL, const S
}
aPageSize.Width() -= nLeftMargin + nRightMargin;
aPageSize.Height() -= nTopMargin + nBottomMargin;
- aPageSize = pDefaultDev->LogicToPixel( aPageSize, MapMode( MAP_TWIP ) );
+ aPageSize = pDefaultDev->LogicToPixel( aPageSize, MapMode( MapUnit::MapTwip ) );
}
else
{
OSL_FAIL("no StyleSheet?!?");
aPageSize = pDefaultDev->LogicToPixel(
- SvxPaperInfo::GetPaperSize( PAPER_A4 ), MapMode( MAP_TWIP ) );
+ SvxPaperInfo::GetPaperSize( PAPER_A4 ), MapMode( MapUnit::MapTwip ) );
}
if( bCalcWidthHeight )
mpParser = new ScHTMLLayoutParser( mpEngine, rBaseURL, aPageSize, pDocP );
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 11ce7137cb43..11e6fe9f131c 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -299,7 +299,7 @@ sal_uLong ScHTMLLayoutParser::Read( SvStream& rStream, const OUString& rBaseURL
for ( sal_uInt16 j = 1; j < nCount; j++ )
{
aSize.Width() = (*pColOffset)[j] - nOff;
- aSize = pDefaultDev->PixelToLogic( aSize, MapMode( MAP_TWIP ) );
+ aSize = pDefaultDev->PixelToLogic( aSize, MapMode( MapUnit::MapTwip ) );
maColWidths[ j-1 ] = aSize.Width();
nOff = (*pColOffset)[j];
}
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index cc8bd240afa0..44425e3cdb13 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -577,7 +577,7 @@ void WorkbookGlobals::initialize()
// initialise edit engine
ScDocument& rDoc = getScDocument();
mxEditEngine.reset( new ScEditEngineDefaulter( rDoc.GetEnginePool() ) );
- mxEditEngine->SetRefMapMode( MAP_100TH_MM );
+ mxEditEngine->SetRefMapMode( MapUnit::Map100thMM );
mxEditEngine->SetEditTextObjectPool( rDoc.GetEditPool() );
mxEditEngine->SetUpdateMode( false );
mxEditEngine->EnableUndo( false );
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index bd03be374b5a..bb04088163fb 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1189,14 +1189,14 @@ sal_Int32 getColumnWidth(UnitConverter& rConverter, double nWidth)
double nCoeff = rConverter.getCoefficient(UNIT_DIGIT);
ScopedVclPtrInstance<VirtualDevice> aDev;
- long nPixel = aDev->LogicToPixel(Point(nCoeff, 0), MapMode(MAP_100TH_MM)).getX();
+ long nPixel = aDev->LogicToPixel(Point(nCoeff, 0), MapMode(MapUnit::Map100thMM)).getX();
// the 1.047 has been experimentally chosen based on measurements with a screen ruler
// TODO: fix the display of cells so that it no longer requires this hack
// algorithm from OOXML spec part1: 18.3.1.13
sal_Int32 nColWidthPixel= std::floor( ( ( 256 * nWidth + std::floor( 128.0 / nPixel ) ) / 256.0 ) * nPixel ) * 1.047;
- return aDev->PixelToLogic(Point(nColWidthPixel, 0), MapMode(MAP_100TH_MM)).getX();
+ return aDev->PixelToLogic(Point(nColWidthPixel, 0), MapMode(MapUnit::Map100thMM)).getX();
}
}
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 97b2e3204577..87018f11e8b5 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -496,7 +496,7 @@ bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, SCTAB /*nTab*/, ScEEParseE
Size aSizePix = pI->aSize;
aSizePix.Width() += 2 * pI->aSpace.X();
aSizePix.Height() += 2 * pI->aSpace.Y();
- Size aLogicSize = pDefaultDev->PixelToLogic( aSizePix, MapMode( MAP_TWIP ) );
+ Size aLogicSize = pDefaultDev->PixelToLogic( aSizePix, MapMode( MapUnit::MapTwip ) );
if ( nDir & nHorizontal )
nWidth += aLogicSize.Width();
else if ( nWidth < aLogicSize.Width() )
@@ -580,11 +580,11 @@ void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab,
aInsertPos.Y() += aSpace.Y();
}
// Add offset of Spacing
- aSpace = pDefaultDev->PixelToLogic( pI->aSpace, MapMode( MAP_100TH_MM ) );
+ aSpace = pDefaultDev->PixelToLogic( pI->aSpace, MapMode( MapUnit::Map100thMM ) );
aInsertPos += aSpace;
Size aSizePix = pI->aSize;
- aLogicSize = pDefaultDev->PixelToLogic( aSizePix, MapMode( MAP_100TH_MM ) );
+ aLogicSize = pDefaultDev->PixelToLogic( aSizePix, MapMode( MapUnit::Map100thMM ) );
// Limit size
::ScLimitSizeOnDrawPage( aLogicSize, aInsertPos, pPage->GetSize() );
diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx
index 923e69d8ba9b..b6b7a70fad9a 100644
--- a/sc/source/filter/rtf/rtfparse.cxx
+++ b/sc/source/filter/rtf/rtfparse.cxx
@@ -43,7 +43,7 @@ ScRTFParser::ScRTFParser( EditEngine* pEditP ) :
bNewDef( false )
{
// RTF default FontSize 12Pt
- long nMM = OutputDevice::LogicToLogic( 12, MAP_POINT, MAP_100TH_MM );
+ long nMM = OutputDevice::LogicToLogic( 12, MapUnit::MapPoint, MapUnit::Map100thMM );
pPool->SetPoolDefaultItem( SvxFontHeightItem( nMM, 100, EE_CHAR_FONTHEIGHT ) );
// Free-flying pInsDefault
pInsDefault = new ScRTFCellDefault( pPool );
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index e972a15a0853..b68e5db3bf2b 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -3430,7 +3430,7 @@ ScEditEngineDefaulter* ScXMLImport::GetEditEngine()
if (!mpEditEngine)
{
mpEditEngine.reset(new ScEditEngineDefaulter(pDoc->GetEnginePool()));
- mpEditEngine->SetRefMapMode(MAP_100TH_MM);
+ mpEditEngine->SetRefMapMode(MapUnit::Map100thMM);
mpEditEngine->SetEditTextObjectPool(pDoc->GetEditPool());
mpEditEngine->SetUpdateMode(false);
mpEditEngine->EnableUndo(false);
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 2b3fdcfa2b19..d8387a755ec0 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -1096,7 +1096,7 @@ SvxTextForwarder* ScAccessibleEditLineTextData::GetTextForwarder()
mpEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true);
mbEditEngineCreated = true;
mpEditEngine->EnableUndo( false );
- mpEditEngine->SetRefMapMode( MAP_100TH_MM );
+ mpEditEngine->SetRefMapMode( MapUnit::Map100thMM );
mpForwarder = new SvxEditEngineForwarder(*mpEditEngine);
mpEditEngine->SetText(pTxtWnd->GetTextString());
@@ -1309,7 +1309,7 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
if (pDocShell)
pEditEngine->SetRefDevice(pDocShell->GetRefDevice());
else
- pEditEngine->SetRefMapMode( MAP_100TH_MM );
+ pEditEngine->SetRefMapMode( MapUnit::Map100thMM );
pForwarder = new SvxEditEngineForwarder(*pEditEngine);
}
@@ -1412,7 +1412,7 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder()
ScHeaderEditEngine* pHdrEngine = new ScHeaderEditEngine( pEnginePool );
pHdrEngine->EnableUndo( false );
- pHdrEngine->SetRefMapMode( MAP_TWIP );
+ pHdrEngine->SetRefMapMode( MapUnit::MapTwip );
// default font must be set, independently of document
// -> use global pool from module
@@ -1535,7 +1535,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder()
if (mpDocSh)
mpEditEngine->SetRefDevice(mpDocSh->GetRefDevice());
else
- mpEditEngine->SetRefMapMode( MAP_100TH_MM );
+ mpEditEngine->SetRefMapMode( MapUnit::Map100thMM );
mpForwarder = new SvxEditEngineForwarder(*mpEditEngine);
}
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index e8deabcc36f0..83e9b922c30c 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -206,7 +206,7 @@ void ScClient::ViewChanged()
}
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( GetAspect() ) );
- Size aVisSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aMapUnit, MAP_100TH_MM );
+ Size aVisSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aMapUnit, MapUnit::Map100thMM );
// Take over position and size into document
SdrOle2Obj* pDrawObj = GetDrawObj();
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 43b3c5ed8210..834d4c4663ad 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -679,7 +679,7 @@ void ScInputHandler::SetRefScale( const Fraction& rX, const Fraction& rY )
aScaleY = rY;
if (pEngine)
{
- MapMode aMode( MAP_100TH_MM, Point(), aScaleX, aScaleY );
+ MapMode aMode( MapUnit::Map100thMM, Point(), aScaleX, aScaleY );
pEngine->SetRefMapMode( aMode );
}
}
@@ -703,7 +703,7 @@ void ScInputHandler::UpdateRefDevice()
else
pEngine->SetRefDevice( nullptr );
- MapMode aMode( MAP_100TH_MM, Point(), aScaleX, aScaleY );
+ MapMode aMode( MapUnit::Map100thMM, Point(), aScaleX, aScaleY );
pEngine->SetRefMapMode( aMode );
// SetRefDevice(NULL) uses VirtualDevice, SetRefMapMode forces creation of a local VDev,
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 7424fd3e70a0..5f875fb59d9d 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1397,7 +1397,7 @@ ScTextWnd::ScTextWnd(ScInputBarGroup* pParent, ScTabViewShell* pViewSh)
// always use application font, so a font with cjk chars can be installed
vcl::Font aAppFont = GetFont();
aTextFont = aAppFont;
- aTextFont.SetFontSize(PixelToLogic(aAppFont.GetFontSize(), MAP_TWIP)); // AppFont is in pixels
+ aTextFont.SetFontSize(PixelToLogic(aAppFont.GetFontSize(), MapUnit::MapTwip)); // AppFont is in pixels
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
@@ -1417,7 +1417,7 @@ ScTextWnd::ScTextWnd(ScInputBarGroup* pParent, ScTabViewShell* pViewSh)
SetSizePixel(aSize);
SetBackground(aBgColor);
SetLineColor(COL_BLACK);
- SetMapMode(MAP_TWIP);
+ SetMapMode(MapUnit::MapTwip);
SetPointer(PointerStyle::Text);
SetFont(aTextFont);
diff --git a/sc/source/ui/app/msgpool.cxx b/sc/source/ui/app/msgpool.cxx
index be2db5a53571..b981f01d7570 100644
--- a/sc/source/ui/app/msgpool.cxx
+++ b/sc/source/ui/app/msgpool.cxx
@@ -95,9 +95,9 @@ MapUnit ScMessagePool::GetMetric( sal_uInt16 nWhich ) const
{
// Own attributes: Twips, everything else 1/100 mm
if ( nWhich >= ATTR_STARTINDEX && nWhich <= ATTR_ENDINDEX )
- return MAP_TWIP;
+ return MapUnit::MapTwip;
else
- return MAP_100TH_MM;
+ return MapUnit::Map100thMM;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 59d285f27dbb..138abae2fc52 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -348,11 +348,11 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
aBlock.aEnd.Col(), aBlock.aEnd.Row(),
aBlock.aStart.Tab() );
ScopedVclPtrInstance< VirtualDevice > pVirtDev;
- pVirtDev->SetOutputSizePixel( pVirtDev->LogicToPixel( aMMRect.GetSize(), MAP_100TH_MM ) );
+ pVirtDev->SetOutputSizePixel( pVirtDev->LogicToPixel( aMMRect.GetSize(), MapUnit::Map100thMM ) );
PaintToDev( pVirtDev, pDoc, 1.0, aBlock );
- pVirtDev->SetMapMode( MapMode( MAP_PIXEL ) );
+ pVirtDev->SetMapMode( MapMode( MapUnit::MapPixel ) );
Bitmap aBmp = pVirtDev->GetBitmap( Point(), pVirtDev->GetOutputSize() );
bOK = SetBitmapEx( aBmp, rFlavor );
}
diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx
index 5a5a7008bfa8..f7d9729512d2 100644
--- a/sc/source/ui/cctrl/cbuttonw.cxx
+++ b/sc/source/ui/cctrl/cbuttonw.cxx
@@ -43,7 +43,7 @@ void ScDDComboBoxButton::SetOutputDevice( OutputDevice* pOutputDevice )
void ScDDComboBoxButton::SetOptSizePixel()
{
- aBtnSize = pOut->LogicToPixel( Size(0,11), MAP_APPFONT );
+ aBtnSize = pOut->LogicToPixel( Size(0,11), MapUnit::MapAppFont );
//aBtnSize.Width() = GetSystemMetrics( SM_CXVSCROLL ) - 1; // Win SDK-Funktion
aBtnSize.Width() = pOut->GetSettings().GetStyleSettings().GetScrollBarSize();
}
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 71a4a94af0e0..a380905b55ee 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -224,7 +224,7 @@ ScZoomSliderWnd::ScZoomSliderWnd( vcl::Window* pParent,
mpImpl->maSliderButton = Image( SVX_RES( RID_SVXBMP_SLIDERBUTTON ) );
mpImpl->maIncreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERINCREASE ) );
mpImpl->maDecreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERDECREASE ) );
- Size aSliderSize = LogicToPixel( Size( aLogicalSize), MapMode( MAP_10TH_MM ) );
+ Size aSliderSize = LogicToPixel( Size( aLogicalSize), MapMode( MapUnit::Map10thMM ) );
SetSizePixel( Size( aSliderSize.Width() * nSliderWidth-1, aSliderSize.Height() + nSliderHeight ) );
}
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 98bcc4adf03d..82fb4068e576 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -158,7 +158,7 @@ VCL_BUILDER_DECL_FACTORY(ScCondFormatList)
Size ScCondFormatList::GetOptimalSize() const
{
- return LogicToPixel(Size(290, 185), MAP_APPFONT);
+ return LogicToPixel(Size(290, 185), MapUnit::MapAppFont);
}
void ScCondFormatList::Resize()
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 216a0ef82f93..921f57899d70 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -94,7 +94,7 @@ void ScCondFrmtEntry::SetIndex(sal_Int32 nIndex)
void ScCondFrmtEntry::SetHeight()
{
- long nPad = LogicToPixel(Size(42,2), MapMode(MAP_APPFONT)).getHeight();
+ long nPad = LogicToPixel(Size(42,2), MapMode(MapUnit::MapAppFont)).getHeight();
// Calculate maximum height we need from visible widgets
sal_uInt16 nChildren = GetChildCount();
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index ba9df607709c..f8d7447c3bdd 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -99,7 +99,7 @@ void ScCondFormatManagerWindow::setColSizes()
return;
long aStaticTabs[]= { 2, 0, 0 };
aStaticTabs[2] = rBar.GetSizePixel().Width() / 2;
- SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL);
+ SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
}
ScCondFormatManagerDlg::ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList):
@@ -109,7 +109,7 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument*
mbModified(false)
{
SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("CONTAINER");
- Size aSize(LogicToPixel(Size(290, 220), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(290, 220), MapUnit::MapAppFont));
pContainer->set_width_request(aSize.Width());
pContainer->set_height_request(aSize.Height());
m_pCtrlManager = VclPtr<ScCondFormatManagerWindow>::Create(*pContainer, mpDoc, mpFormatList);
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index ad90f5da88ec..34cbd3222bd6 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -75,7 +75,7 @@ ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) :
mbMTSelecting( false )
{
mpEditEngine->SetRefDevice( mpBackgrDev.get() );
- mpEditEngine->SetRefMapMode( MapMode( MAP_PIXEL ) );
+ mpEditEngine->SetRefMapMode( MapMode( MapUnit::MapPixel ) );
maEdEngSize = mpEditEngine->GetPaperSize();
mpPopup->SetMenuFlags( mpPopup->GetMenuFlags() | MenuFlags::NoAutoMnemonics );
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx
index aef45567bf95..cb23052062f4 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -74,7 +74,7 @@ VCL_BUILDER_FACTORY_ARGS(ScCsvTableBox, WB_BORDER)
Size ScCsvTableBox::GetOptimalSize() const
{
- Size aDefault(LogicToPixel(Size(243, 82), MapMode(MAP_APPFONT)));
+ Size aDefault(LogicToPixel(Size(243, 82), MapMode(MapUnit::MapAppFont)));
return aDefault;
}
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index 675fdce1d82b..3cd9044ca12d 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -45,7 +45,7 @@ ScNewScenarioDlg::ScNewScenarioDlg( vcl::Window* pParent, const OUString& rName,
{
get(m_pEdName, "name");
get(m_pEdComment, "comment");
- Size aSize(m_pEdComment->LogicToPixel(Size(183, 46), MAP_APPFONT));
+ Size aSize(m_pEdComment->LogicToPixel(Size(183, 46), MapUnit::MapAppFont));
m_pEdComment->set_width_request(aSize.Width());
m_pEdComment->set_height_request(aSize.Height());
get(m_pCbShowFrame, "showframe");
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 8add8fcba032..3be6e95a88bc 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -338,7 +338,7 @@ ScTPValidationValue::ScTPValidationValue( vcl::Window* pParent, const SfxItemSet
get(m_pEdMin, "min");
m_pEdMin->SetReferences(nullptr, m_pFtMin);
get(m_pEdList, "minlist");
- Size aSize(LogicToPixel(Size(174, 105), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(174, 105), MapUnit::MapAppFont));
m_pEdList->set_width_request(aSize.Width());
m_pEdList->set_height_request(aSize.Height());
get(m_pFtMax, "maxft");
diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx
index 243fb2a61549..3cd86fac9b8b 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -28,7 +28,7 @@ SearchResultsDlg::SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* pParen
{
SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("results");
Size aControlSize(150, 120);
- aControlSize = pContainer->LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = pContainer->LogicToPixel(aControlSize, MapUnit::MapAppFont);
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(aControlSize.Height());
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 880b2fb58abd..dcb08bad4ca6 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -377,15 +377,15 @@ void ScDocShell::CalcOutputFactor()
MapMode aOldMode = pRefDev->GetMapMode();
vcl::Font aOldFont = pRefDev->GetFont();
- pRefDev->SetMapMode(MAP_PIXEL);
+ pRefDev->SetMapMode(MapUnit::MapPixel);
pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pRefDev); // font color doesn't matter here
pRefDev->SetFont(aDefFont);
- nPrinterWidth = pRefDev->PixelToLogic( Size( pRefDev->GetTextWidth(aTestString), 0 ), MAP_100TH_MM ).Width();
+ nPrinterWidth = pRefDev->PixelToLogic( Size( pRefDev->GetTextWidth(aTestString), 0 ), MapUnit::Map100thMM ).Width();
pRefDev->SetFont(aOldFont);
pRefDev->SetMapMode(aOldMode);
ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *Application::GetDefaultDevice() );
- pVirtWindow->SetMapMode(MAP_PIXEL);
+ pVirtWindow->SetMapMode(MapUnit::MapPixel);
pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // font color doesn't matter here
pVirtWindow->SetFont(aDefFont);
nWindowWidth = pVirtWindow->GetTextWidth(aTestString);
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index d4b1af7047f5..a33c47d486b5 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -111,7 +111,7 @@ void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea )
if (pEnv)
{
vcl::Window* pWin = pEnv->GetEditWin();
- pEnv->MakeScale( aArea.GetSize(), MAP_100TH_MM,
+ pEnv->MakeScale( aArea.GetSize(), MapUnit::Map100thMM,
pWin->LogicToPixel( aArea.GetSize() ) );
} */
diff --git a/sc/source/ui/docshell/sizedev.cxx b/sc/source/ui/docshell/sizedev.cxx
index 90bca78f619f..aaa37e1971a2 100644
--- a/sc/source/ui/docshell/sizedev.cxx
+++ b/sc/source/ui/docshell/sizedev.cxx
@@ -34,7 +34,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh )
bOwner = false;
aOldMapMode = pDevice->GetMapMode();
- pDevice->SetMapMode( MAP_PIXEL ); // GetNeededSize needs pixel MapMode
+ pDevice->SetMapMode( MapUnit::MapPixel ); // GetNeededSize needs pixel MapMode
// printer has right DigitLanguage already
}
else
@@ -44,7 +44,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh )
bOwner = true;
}
- Point aLogic = pDevice->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aLogic = pDevice->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
nPPTX = aLogic.X() / 1000.0;
nPPTY = aLogic.Y() / 1000.0;
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 9b1c8d01392a..4ae82e783ae7 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -127,8 +127,8 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
// at 100% view scale (as in SetMarkedOriginalSize),
// instead of respecting the current view scale
MapMode aSourceMap = rGraphic.GetPrefMapMode();
- MapMode aDestMap( MAP_100TH_MM );
- if ( aSourceMap.GetMapUnit() == MAP_PIXEL && pDrawView )
+ MapMode aDestMap( MapUnit::Map100thMM );
+ if ( aSourceMap.GetMapUnit() == MapUnit::MapPixel && pDrawView )
{
Fraction aScaleX, aScaleY;
pDrawView->CalcNormScale( aScaleX, aScaleY );
@@ -186,9 +186,9 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi,
if( rPrefSize.Width() && rPrefSize.Height() )
{
if( pWindow )
- aSize = pWindow->PixelToLogic( rPrefSize, MAP_100TH_MM );
+ aSize = pWindow->PixelToLogic( rPrefSize, MapUnit::Map100thMM );
else
- aSize = Application::GetDefaultDevice()->PixelToLogic( rPrefSize, MAP_100TH_MM );
+ aSize = Application::GetDefaultDevice()->PixelToLogic( rPrefSize, MapUnit::Map100thMM );
}
else
aSize = Size( 5000, 5000 );
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index bb949ce08ae2..2622d6102aec 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -273,8 +273,8 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView*
{
::svt::EmbeddedObjectRef aObjRef( xObj, nAspect );
Size aSize;
- MapMode aMap100( MAP_100TH_MM );
- MapUnit aMapUnit = MAP_100TH_MM;
+ MapMode aMap100( MapUnit::Map100thMM );
+ MapUnit aMapUnit = MapUnit::Map100thMM;
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
@@ -301,7 +301,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView*
// Rechteck mit ausgewogenem Kantenverhaeltnis
aSize.Width() = 5000;
aSize.Height() = 5000;
- Size aTmp = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aMapUnit );
+ Size aTmp = OutputDevice::LogicToLogic( aSize, MapUnit::Map100thMM, aMapUnit );
aSz.Width = aTmp.Width();
aSz.Height = aTmp.Height();
xObj->setVisualAreaSize( nAspect, aSz );
@@ -340,7 +340,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView*
awt::Size aSz = xObj->getVisualAreaSize( nAspect );
Size aNewSize( aSz.Width, aSz.Height );
- aNewSize = OutputDevice::LogicToLogic( aNewSize, aMapUnit, MAP_100TH_MM );
+ aNewSize = OutputDevice::LogicToLogic( aNewSize, aMapUnit, MapUnit::Map100thMM );
if ( aNewSize != aSize )
{
@@ -484,7 +484,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV
}
if (bSizeCh)
{
- aSize = vcl::Window::LogicToLogic( aSize, MapMode( MAP_100TH_MM ), MapMode( aMapUnit ) );
+ aSize = vcl::Window::LogicToLogic( aSize, MapMode( MapUnit::Map100thMM ), MapMode( aMapUnit ) );
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
xObj->setVisualAreaSize( nAspect, aSz );
diff --git a/sc/source/ui/drawfunc/futext2.cxx b/sc/source/ui/drawfunc/futext2.cxx
index 30f6e4f5fc40..3c096623e296 100644
--- a/sc/source/ui/drawfunc/futext2.cxx
+++ b/sc/source/ui/drawfunc/futext2.cxx
@@ -38,7 +38,7 @@ SdrOutliner* FuText::MakeOutliner()
// so the device must be taken from the model here.
OutputDevice* pRef = pDrDoc->GetRefDevice();
if (pRef && pRef != pWindow)
- pRef->SetMapMode( MapMode(MAP_100TH_MM) );
+ pRef->SetMapMode( MapMode(MapUnit::Map100thMM) );
return pOutl;
}
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index c07e7c35e3f4..7180c3c05a3b 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1772,7 +1772,7 @@ void ScAcceptChgDlg::Initialize(SfxChildWinInfo *pInfo)
{
sal_Int32 n1 = aStr.indexOf(';');
aStr = aStr.copy( n1+1 );
- pTheView->SetTab(i, (sal_uInt16)aStr.toInt32(), MAP_PIXEL);
+ pTheView->SetTab(i, (sal_uInt16)aStr.toInt32(), MapUnit::MapPixel);
}
}
}
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx
index 9f128e5c42ff..1a9a8e166f33 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.cxx
+++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx
@@ -40,7 +40,7 @@ ScRetypePassDlg::ScRetypePassDlg(vcl::Window* pParent) :
get(mpTextDocStatus, "docStatusLabel");
get(mpBtnRetypeDoc, "retypeDocButton");
vcl::Window *pScrolledWindow = get<vcl::Window>("scrolledwindow");
- Size aSize(LogicToPixel(Size(190, 90), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(190, 90), MapUnit::MapAppFont));
pScrolledWindow->set_width_request(aSize.Width());
pScrolledWindow->set_height_request(aSize.Height());
get(mpSheetsBox, "sheetsBox");
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index 91b4de526591..4add1fb94faf 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -63,7 +63,7 @@ public:
GetSizePixel().Width() - nAccessedWidth);
long aStaticTabs[]= { 2, 0, 0 };
aStaticTabs[2] = nWebSiteWidth;
- SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL);
+ SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
}
};
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx
index a1ee00b1c441..99689657e747 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -44,7 +44,7 @@ ScRangeManagerTable::ScRangeManagerTable(SvSimpleTableContainer& rParent,
, mpInitListener(nullptr)
{
static long aStaticTabs[] = {3, 0, 0, 0 };
- SetTabs( &aStaticTabs[0], MAP_PIXEL );
+ SetTabs( &aStaticTabs[0], MapUnit::MapPixel );
OUString aNameStr(ScGlobal::GetRscString(STR_HEADER_NAME));
OUString aRangeStr(ScGlobal::GetRscString(STR_HEADER_RANGE_OR_EXPR));
@@ -99,7 +99,7 @@ void ScRangeManagerTable::setColWidths()
rHeaderBar.SetItemSize( ITEMID_RANGE, nTabSize);
rHeaderBar.SetItemSize( ITEMID_SCOPE, nTabSize);
static long aStaticTabs[] = {3, 0, nTabSize, 2*nTabSize };
- SetTabs( &aStaticTabs[0], MAP_PIXEL );
+ SetTabs( &aStaticTabs[0], MapUnit::MapPixel );
HeaderEndDragHdl(nullptr);
}
@@ -295,9 +295,9 @@ IMPL_LINK_NOARG(ScRangeManagerTable, HeaderEndDragHdl, HeaderBar*, void)
rHeaderBar.SetItemSize(ITEMID_SCOPE, nItemScopeSize);
SetTab(0, 0);
- SetTab(1, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width() );
+ SetTab(1, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() );
aSz.Width() += nItemRangeSize;
- SetTab(2, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width() );
+ SetTab(2, PixelToLogic( aSz, MapMode(MapUnit::MapAppFont) ).Width() );
}
IMPL_LINK_NOARG(ScRangeManagerTable, ScrollHdl, SvTreeListBox*, void)
diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx
index 48bb5888301a..c47b56a14de2 100644
--- a/sc/source/ui/namedlg/namepast.cxx
+++ b/sc/source/ui/namedlg/namepast.cxx
@@ -49,7 +49,7 @@ ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool
ScAddress aPos(pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo());
SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("ctrl");
Size aControlSize(210, 0);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(10 * GetTextHeight());
mpTable = VclPtr<ScRangeManagerTable>::Create(*pContainer, m_RangeMap, aPos);
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index b1e2bdd6b534..67e3b226780d 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -130,7 +130,7 @@ ScHFEditPage::ScHFEditPage( vcl::Window* pParent,
m_pWndRight->SetFont( aPatAttr );
// Set size request for all 3 widgets
- Size aSize = LogicToPixel(Size(80, 120), MAP_APPFONT);
+ Size aSize = LogicToPixel(Size(80, 120), MapUnit::MapAppFont);
VclPtr<ScEditWindow> aEditWindows[] = {m_pWndLeft, m_pWndCenter, m_pWndRight};
for (auto &pEditWindow : aEditWindows)
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 248fae39f890..4face4a60e86 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -72,7 +72,7 @@ ScEditWindow::ScEditWindow( vcl::Window* pParent, WinBits nBits, ScEditWindowLoc
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
Color aBgColor = rStyleSettings.GetWindowColor();
- SetMapMode( MAP_TWIP );
+ SetMapMode( MapUnit::MapTwip );
SetPointer( PointerStyle::Text );
SetBackground( aBgColor );
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index e1b0993ab03f..24f3f9538766 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -195,7 +195,7 @@ IMPL_LINK_NOARG(AlignmentPropertyPanel, MFLeftIndentMdyHdl, Edit&, void)
{
mpCBXWrapText->EnableTriState(false);
sal_uInt16 nVal = (sal_uInt16)mpMFLeftIndent->GetValue();
- SfxUInt16Item aItem( SID_ATTR_ALIGN_INDENT, (sal_uInt16)CalcToUnit( nVal, MAP_TWIP ) );
+ SfxUInt16Item aItem( SID_ATTR_ALIGN_INDENT, (sal_uInt16)CalcToUnit( nVal, MapUnit::MapTwip ) );
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_ALIGN_INDENT,
SfxCallMode::RECORD, { &aItem });
@@ -297,7 +297,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate(
{
const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pState);
sal_uInt16 nVal = pItem->GetValue();
- mpMFLeftIndent->SetValue( CalcToPoint(nVal, MAP_TWIP, 1) );
+ mpMFLeftIndent->SetValue( CalcToPoint(nVal, MapUnit::MapTwip, 1) );
}
else
{
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index aaf2541462f7..a021422bdf25 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -91,7 +91,7 @@ static void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, bo
//! move to document or docshell
ScopedVclPtrInstance< VirtualDevice > pVDev;
- Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 8cb4a28ff5c2..f604e9dfc574 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -231,7 +231,7 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName,
sal_Int64 nAspect(embed::Aspects::MSOLE_CONTENT);
MapUnit aMapUnit(VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ));
Size aSize(aInsRect.GetSize());
- aSize = vcl::Window::LogicToLogic( aSize, MapMode( MAP_100TH_MM ), MapMode( aMapUnit ) );
+ aSize = vcl::Window::LogicToLogic( aSize, MapMode( MapUnit::Map100thMM ), MapMode( aMapUnit ) );
awt::Size aSz;
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 03679b621c7c..763ff041b097 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -744,7 +744,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName )
{
// wie ScViewFunc::RemoveStyleSheetInUse
ScopedVclPtrInstance< VirtualDevice > pVDev;
- Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
@@ -1084,7 +1084,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
// update lineheight
ScopedVclPtrInstance< VirtualDevice > pVDev;
- Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
@@ -1450,7 +1450,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault()
// row heights
ScopedVclPtrInstance< VirtualDevice > pVDev;
- Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
@@ -1830,7 +1830,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt
{
// update lineheight
ScopedVclPtrInstance< VirtualDevice > pVDev;
- Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 041ac3d4e747..ddf83ee1b8cf 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -211,7 +211,7 @@ SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder()
ScHeaderEditEngine* pHdrEngine = new ScHeaderEditEngine( pEnginePool );
pHdrEngine->EnableUndo( false );
- pHdrEngine->SetRefMapMode( MAP_TWIP );
+ pHdrEngine->SetRefMapMode( MapUnit::MapTwip );
// default font must be set, independently of document
// -> use global pool from module
@@ -859,7 +859,7 @@ ScDrawTextCursor* ScDrawTextCursor::getImplementation(const uno::Reference<uno::
ScSimpleEditSourceHelper::ScSimpleEditSourceHelper()
{
SfxItemPool* pEnginePool = EditEngine::CreatePool();
- pEnginePool->SetDefaultMetric( MAP_100TH_MM );
+ pEnginePool->SetDefaultMetric( MapUnit::Map100thMM );
pEnginePool->FreezeIdRanges();
pEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); // TRUE: become owner of pool
@@ -960,7 +960,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder()
if (pDocShell)
pEditEngine->SetRefDevice(pDocShell->GetRefDevice());
else
- pEditEngine->SetRefMapMode( MAP_100TH_MM );
+ pEditEngine->SetRefMapMode( MapUnit::Map100thMM );
pForwarder = new SvxEditEngineForwarder(*pEditEngine);
}
diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx
index ea4a83fa0d37..5f5c969c27ce 100644
--- a/sc/source/ui/view/drawutil.cxx
+++ b/sc/source/ui/view/drawutil.cxx
@@ -56,7 +56,7 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab,
nPixelY += ScViewData::ToPixel(nHeight, nPPTY);
}
- MapMode aHMMMode( MAP_100TH_MM, Point(), rZoomX, rZoomY );
+ MapMode aHMMMode( MapUnit::Map100thMM, Point(), rZoomX, rZoomY );
Point aPixelLog = pDev->PixelToLogic( Point( nPixelX,nPixelY ), aHMMMode );
// Fraction(double) ctor can be used here (and avoid overflows of PixelLog * Zoom)
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index d0f51dfeb725..839f47d7bc7c 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -472,7 +472,7 @@ void ScDrawView::SetMarkedOriginalSize()
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
aOriginalSize = static_cast<SdrOle2Obj*>(pObj)->GetOrigObjSize( &aMapMode );
bDo = true;
}
@@ -485,7 +485,7 @@ void ScDrawView::SetMarkedOriginalSize()
aSz = xObj->getVisualAreaSize( static_cast<SdrOle2Obj*>(pObj)->GetAspect() );
aOriginalSize = OutputDevice::LogicToLogic(
Size( aSz.Width, aSz.Height ),
- aUnit, MAP_100TH_MM );
+ aUnit, MapUnit::Map100thMM );
bDo = true;
} catch( embed::NoVisualAreaSizeException& )
{
@@ -499,8 +499,8 @@ void ScDrawView::SetMarkedOriginalSize()
const Graphic& rGraphic = static_cast<SdrGrafObj*>(pObj)->GetGraphic();
MapMode aSourceMap = rGraphic.GetPrefMapMode();
- MapMode aDestMap( MAP_100TH_MM );
- if (aSourceMap.GetMapUnit() == MAP_PIXEL)
+ MapMode aDestMap( MapUnit::Map100thMM );
+ if (aSourceMap.GetMapUnit() == MapUnit::MapPixel)
{
// consider pixel correction, so that the bitmap is correct on the screen
Fraction aNormScaleX, aNormScaleY;
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index f39da944547d..9bf969152c6b 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -313,7 +313,7 @@ void ScDrawView::RecalcScale()
}
else
{
- Point aLogic = pDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
+ Point aLogic = pDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip );
nPPTX = aLogic.X() / 1000.0;
nPPTY = aLogic.Y() / 1000.0;
//! Zoom, handed over ???
@@ -559,8 +559,8 @@ bool ScDrawView::SdrBeginTextEdit(
if (OutlinerView* pView = GetTextEditOutlinerView())
{
Rectangle aRectangle = pView->GetOutputArea();
- if (pWinL && pWinL->GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP);
+ if (pWinL && pWinL->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip);
OString sRectangle = aRectangle.toString();
SfxLokHelper::notifyOtherViews(pViewSh, LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle);
}
diff --git a/sc/source/ui/view/gridmerg.cxx b/sc/source/ui/view/gridmerg.cxx
index 6ccc18170f2f..c7cf899953f9 100644
--- a/sc/source/ui/view/gridmerg.cxx
+++ b/sc/source/ui/view/gridmerg.cxx
@@ -35,7 +35,7 @@ ScGridMerger::ScGridMerger( OutputDevice* pOutDev, long nOnePixelX, long nOnePix
// optimize (DrawGrid) only for pixel MapMode,
// to avoid rounding errors
- bOptimize = ( pDev->GetMapMode().GetMapUnit() == MAP_PIXEL );
+ bOptimize = ( pDev->GetMapMode().GetMapUnit() == MapUnit::MapPixel );
}
ScGridMerger::~ScGridMerger()
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 5ffad27f03ec..667bc3eee40c 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -978,7 +978,7 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange )
vcl::Font aOldFont = GetFont();
SetFont(mpFilterBox->GetFont());
MapMode aOldMode = GetMapMode();
- SetMapMode( MAP_PIXEL );
+ SetMapMode( MapUnit::MapPixel );
nHeight = GetTextHeight();
nHeight *= SC_FILTERLISTBOX_LINES;
@@ -1104,7 +1104,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
vcl::Font aOldFont = GetFont();
SetFont(mpFilterBox->GetFont());
MapMode aOldMode = GetMapMode();
- SetMapMode(MAP_PIXEL);
+ SetMapMode(MapUnit::MapPixel);
nHeight = GetTextHeight();
nHeight *= SC_FILTERLISTBOX_LINES;
@@ -1584,7 +1584,7 @@ bool ScGridWindow::IsCellCoveredByText(SCsCOL nPosX, SCsROW nPosY, SCTAB nTab, S
&aZoomX, &aZoomY);
MapMode aCurrentMapMode(GetMapMode());
- SetMapMode(MAP_PIXEL);
+ SetMapMode(MapUnit::MapPixel);
// obtain the bounding box of the text in first non-empty cell
// to the left
@@ -4614,7 +4614,7 @@ void ScGridWindow::ScrollPixel( long nDifX, long nDifY )
bIsInScroll = true;
- SetMapMode(MAP_PIXEL);
+ SetMapMode(MapUnit::MapPixel);
Scroll( nDifX, nDifY, ScrollFlags::Children );
SetMapMode( GetDrawMapMode() ); // generated shifted MapMode
@@ -5194,7 +5194,7 @@ std::shared_ptr<ScFieldEditEngine> createEditEngine( ScDocShell* pDocSh, const S
std::shared_ptr<ScFieldEditEngine> pEngine(new ScFieldEditEngine(&rDoc, rDoc.GetEditPool()));
ScSizeDeviceProvider aProv(pDocSh);
pEngine->SetRefDevice(aProv.GetDevice());
- pEngine->SetRefMapMode(MAP_100TH_MM);
+ pEngine->SetRefMapMode(MapUnit::Map100thMM);
SfxItemSet aDefault = pEngine->GetEmptyItemSet();
rPat.FillEditItemSet(&aDefault);
aDefault.Put( SvxAdjustItem(toSvxAdjust(rPat), EE_PARA_JUST) );
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 2e66fef6464f..27a7d24d4359 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -498,7 +498,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
// use a virtual device with 1/100th mm as text formatting reference
xFmtVirtDev.disposeAndReset( VclPtr<VirtualDevice>::Create() );
- xFmtVirtDev->SetMapMode( MAP_100TH_MM );
+ xFmtVirtDev->SetMapMode( MapUnit::Map100thMM );
aOutputData.SetFmtDevice( xFmtVirtDev.get() );
bLogicText = true; // use logic MapMode
@@ -670,7 +670,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
{
// save MapMode and set to pixel
MapMode aCurrentMapMode(pContentDev->GetMapMode());
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(MapUnit::MapPixel);
Rectangle aPixRect = Rectangle( Point(), GetOutputSizePixel() );
pContentDev->SetFillColor( rColorCfg.GetColorValue(svtools::APPBACKGROUND).nColor );
@@ -707,7 +707,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
if ( rDoc.HasBackgroundDraw( nTab, aDrawingRectLogic ) )
{
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(MapUnit::MapPixel);
aOutputData.DrawClear();
// drawing background
@@ -728,7 +728,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
if ( !bGridFirst && ( bGrid || bPage ) )
aOutputData.DrawGrid(*pContentDev, bGrid, bPage);
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(MapUnit::MapPixel);
if ( bPageMode )
{
@@ -762,18 +762,18 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
if (bIsTiledRendering)
{
// Tiled offset nScrX, nScrY
- MapMode aMap( MAP_PIXEL );
+ MapMode aMap( MapUnit::MapPixel );
aMap.SetOrigin(Point(nScrX, nScrY));
pContentDev->SetMapMode(aMap);
}
else
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(MapUnit::MapPixel);
// Autofilter- and Pivot-Buttons
DrawButtons(nX1, nX2, rTableInfo, pContentDev); // Pixel
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(MapUnit::MapPixel);
aOutputData.DrawClipMarks();
@@ -847,7 +847,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
}
}
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(MapUnit::MapPixel);
if ( pViewData->IsRefMode() && nTab >= pViewData->GetRefStartZ() && nTab <= pViewData->GetRefEndZ() )
{
@@ -965,7 +965,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
// paint the editeng text
Rectangle aEditRect(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH()));
pEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice);
- rDevice.SetMapMode(MAP_PIXEL);
+ rDevice.SetMapMode(MapUnit::MapPixel);
// restore the cursor it was originally visible
if (bVisCursor)
@@ -1036,7 +1036,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
Rectangle aEditRect(Point(nScreenX, nScreenY), Size(nScreenW, nScreenH));
pOtherEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice);
- rDevice.SetMapMode(MAP_PIXEL);
+ rDevice.SetMapMode(MapUnit::MapPixel);
}
}
}
@@ -1226,11 +1226,11 @@ void ScGridWindow::LogicInvalidate(const Rectangle* pRectangle)
// When dragging shapes the map mode is disabled.
if (IsMapModeEnabled())
{
- if (GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP);
+ if (GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip);
}
else
- aRectangle = PixelToLogic(aRectangle, MapMode(MAP_TWIP));
+ aRectangle = PixelToLogic(aRectangle, MapMode(MapUnit::MapTwip));
sRectangle = aRectangle.toString();
}
diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx
index 10b67ca1aa1f..42762835f100 100644
--- a/sc/source/ui/view/gridwin_dbgutil.cxx
+++ b/sc/source/ui/view/gridwin_dbgutil.cxx
@@ -46,7 +46,7 @@ void ScGridWindow::dumpColumnInformationPixel()
for (SCCOL nCol = 0; nCol <= 20; ++nCol)
{
sal_uInt16 nWidth = pDoc->GetColWidth(nCol, nTab);
- long nPixel = LogicToPixel(Point(nWidth, 0), MapMode(MAP_TWIP)).getX();
+ long nPixel = LogicToPixel(Point(nWidth, 0), MapMode(MapUnit::MapTwip)).getX();
std::cout << "Column: " << nCol << ", Width: " << nPixel << "px" << std::endl;
}
}
@@ -58,7 +58,7 @@ void ScGridWindow::dumpColumnInformationHmm()
for (SCCOL nCol = 0; nCol <= 20; ++nCol)
{
sal_uInt16 nWidth = pDoc->GetColWidth(nCol, nTab);
- long nPixel = LogicToLogic(Point(nWidth, 0), MAP_TWIP, MAP_100TH_MM).getX();
+ long nPixel = LogicToLogic(Point(nWidth, 0), MapUnit::MapTwip, MapUnit::Map100thMM).getX();
std::cout << "Column: " << nCol << ", Width: " << nPixel << "hmm" << std::endl;
}
}
diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index 41bce2332042..32f71131717c 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -44,7 +44,7 @@ ScOverlayHint::ScOverlayHint(const OUString& rTit, const OUString& rMsg, const C
, m_aTitle(rTit)
, m_aMessage(convertLineEnd(rMsg, LINEEND_CR))
, m_aTextFont(rFont)
- , m_aMapMode(MAP_PIXEL)
+ , m_aMapMode(MapUnit::MapPixel)
, m_nLeft(0)
, m_nTop(0)
{
@@ -158,7 +158,7 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlayObje
Size ScOverlayHint::GetSizePixel() const
{
basegfx::B2DRange aRange;
- createOverlaySequence(0, 0, MAP_PIXEL, aRange);
+ createOverlaySequence(0, 0, MapUnit::MapPixel, aRange);
return Size(aRange.getWidth(), aRange.getHeight());
}
diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx
index 818f9fc76a12..9d5282e58a77 100644
--- a/sc/source/ui/view/notemark.cxx
+++ b/sc/source/ui/view/notemark.cxx
@@ -78,9 +78,9 @@ IMPL_LINK_NOARG(ScNoteMarker, TimeHdl, Timer *, void)
SvtPathOptions aPathOpt;
OUString aPath = aPathOpt.GetPalettePath();
pModel = new SdrModel(aPath, nullptr, nullptr, false);
- pModel->SetScaleUnit(MAP_100TH_MM);
+ pModel->SetScaleUnit(MapUnit::Map100thMM);
SfxItemPool& rPool = pModel->GetItemPool();
- rPool.SetDefaultMetric(MAP_100TH_MM);
+ rPool.SetDefaultMetric(MapUnit::Map100thMM);
rPool.FreezeIdRanges();
OutputDevice* pPrinter = pDoc->GetRefDevice();
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index b9a5e462dce1..5c8a05ff2ee9 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -339,7 +339,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
//
// This is where all the confusion comes from, ultimately we want them
// always in the logic units (100th of millimiters), but we need to get
- // there gradually (get rid of setting MAP_PIXEL first), otherwise we'd
+ // there gradually (get rid of setting MapUnit::MapPixel first), otherwise we'd
// break all the drawing by one change.
// So until that happens, we need to special case.
bool bWorksInPixels = bMetaFile;
diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index 42eeeace7160..56a360e3e8b2 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -82,7 +82,7 @@ Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY )
// #i76114# MapMode has to be set because BeginDrawLayers uses GetPaintRegion
MapMode aOldMode = mpDev->GetMapMode();
if (!bMetaFile)
- mpDev->SetMapMode( MapMode( MAP_100TH_MM, aMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) );
+ mpDev->SetMapMode( MapMode( MapUnit::Map100thMM, aMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) );
// #i74769# work with SdrPaintWindow directly
// #i76114# pass bDisableIntersect = true, because the intersection of the table area
@@ -108,7 +108,7 @@ void ScOutputData::PostPrintDrawingLayer(const Point& rMMOffset) // #i74768#
if (!bMetaFile)
{
- mpDev->SetMapMode( MapMode( MAP_100TH_MM, rMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) );
+ mpDev->SetMapMode( MapMode( MapUnit::Map100thMM, rMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) );
}
if(pViewShell || pDrawView)
@@ -155,7 +155,7 @@ void ScOutputData::PrintDrawingLayer(const sal_uInt16 nLayer, const Point& rMMOf
if (!bMetaFile)
{
- mpDev->SetMapMode( MapMode( MAP_100TH_MM, rMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) );
+ mpDev->SetMapMode( MapMode( MapUnit::Map100thMM, rMMOffset, aOldMode.GetScaleX(), aOldMode.GetScaleY() ) );
}
DrawSelectiveObjects( nLayer );
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 1e916697ae2f..7099142c5dc9 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -354,7 +354,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
Fraction aPreviewZoom( nZoom, 100 );
Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
- MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom );
+ MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
bool bDoPrint = ( pFillLocation == nullptr );
bool bValidPage = ( nPageNo < nTotalPages );
@@ -559,7 +559,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
DrawInvert( nPageEndY - nFooterHeight, PointerStyle::VSizeBar );
}
- SetMapMode( MapMode( MAP_PIXEL ) );
+ SetMapMode( MapMode( MapUnit::MapPixel ) );
for( int i= aPageArea.aStart.Col(); i<= aPageArea.aEnd.Col(); i++ )
{
Point aColumnTop = LogicToPixel( Point( 0, -aOffset.Y() ) ,aMMMode );
@@ -742,7 +742,7 @@ void ScPreview::SetZoom(sal_uInt16 nNewZoom)
Fraction aPreviewZoom( nZoom, 100 );
Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
- MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom );
+ MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
SetMapMode( aMMMode );
bInSetZoom = true; // don't scroll during SetYOffset in UpdateScrollBars
@@ -817,7 +817,7 @@ sal_uInt16 ScPreview::GetOptimalZoom(bool bWidthOnly)
// desired margin is 0.25cm in default MapMode (like Writer),
// but some additional margin is introduced by integer scale values
// -> add only 0.10cm, so there is some margin in all cases.
- Size aMarginSize( LogicToPixel( Size( 100, 100 ), MAP_100TH_MM ) );
+ Size aMarginSize( LogicToPixel( Size( 100, 100 ), MapUnit::Map100thMM ) );
aWinSize.Width() -= 2 * aMarginSize.Width();
aWinSize.Height() -= 2 * aMarginSize.Height();
@@ -853,7 +853,7 @@ void ScPreview::SetXOffset( long nX )
aOffset.X() = nX;
if (nDif && !bInSetZoom)
{
- MapMode aOldMode = GetMapMode(); SetMapMode(MAP_PIXEL);
+ MapMode aOldMode = GetMapMode(); SetMapMode(MapUnit::MapPixel);
Scroll( nDif, 0 );
SetMapMode(aOldMode);
}
@@ -879,7 +879,7 @@ void ScPreview::SetYOffset( long nY )
aOffset.Y() = nY;
if (nDif && !bInSetZoom)
{
- MapMode aOldMode = GetMapMode(); SetMapMode(MAP_PIXEL);
+ MapMode aOldMode = GetMapMode(); SetMapMode(MapUnit::MapPixel);
Scroll( 0, nDif );
SetMapMode(aOldMode);
}
@@ -968,7 +968,7 @@ void ScPreview::MouseButtonDown( const MouseEvent& rMEvt )
{
Fraction aPreviewZoom( nZoom, 100 );
Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
- MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom );
+ MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
aButtonDownChangePoint = PixelToLogic( rMEvt.GetPosPixel(),aMMMode );
aButtonDownPt = PixelToLogic( rMEvt.GetPosPixel(),aMMMode );
@@ -1051,7 +1051,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt )
{
Fraction aPreviewZoom( nZoom, 100 );
Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
- MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom );
+ MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
aButtonUpPt = PixelToLogic( rMEvt.GetPosPixel(),aMMMode );
@@ -1301,7 +1301,7 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt )
{
Fraction aPreviewZoom( nZoom, 100 );
Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
- MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom );
+ MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
Point aMouseMovePoint = PixelToLogic( rMEvt.GetPosPixel(), aMMMode );
long nLeftMargin = 0;
@@ -1538,7 +1538,7 @@ void ScPreview::DragMove( long nDragMovePos, PointerStyle nFlags )
{
Fraction aPreviewZoom( nZoom, 100 );
Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 );
- MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom );
+ MapMode aMMMode( MapUnit::Map100thMM, Point(), aHorPrevZoom, aPreviewZoom );
SetMapMode( aMMMode );
long nPos = nDragMovePos;
if( nFlags == PointerStyle::HSizeBar || nFlags == PointerStyle::HSplit )
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 300affff95f9..83d763432837 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -191,7 +191,7 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions )
// unified MapMode for all calls (e.g. Repaint!!!)
// else, EditEngine outputs different text heights
- pDev->SetMapMode(MAP_PIXEL);
+ pDev->SetMapMode(MapUnit::MapPixel);
pBorderItem = nullptr;
pBackgroundItem = nullptr;
@@ -248,7 +248,7 @@ ScPrintFunc::ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTa
pPageData ( pData )
{
pDev = pPrinter.get();
- aSrcOffset = pPrinter->PixelToLogic( pPrinter->GetPageOffsetPixel(), MAP_100TH_MM );
+ aSrcOffset = pPrinter->PixelToLogic( pPrinter->GetPageOffsetPixel(), MapUnit::Map100thMM );
Construct( pOptions );
}
@@ -547,7 +547,7 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
if ( bMetaFile && pDev->GetOutDevType() == OUTDEV_VIRDEV )
aOutputData.SetSnapPixel();
- Point aLogStart = pDev->PixelToLogic( Point(nScrX,nScrY), MAP_100TH_MM );
+ Point aLogStart = pDev->PixelToLogic( Point(nScrX,nScrY), MapUnit::Map100thMM );
long nLogStX = aLogStart.X();
long nLogStY = aLogStart.Y();
@@ -713,7 +713,7 @@ bool ScPrintFunc::AdjustPrintArea( bool bNew )
if ( bChangeCol )
{
OutputDevice* pRefDev = pDoc->GetPrinter(); // use the printer also for Preview
- pRefDev->SetMapMode( MAP_PIXEL ); // important for GetNeededSize
+ pRefDev->SetMapMode( MapUnit::MapPixel ); // important for GetNeededSize
pDoc->ExtendPrintArea( pRefDev,
nPrintTab, nStartCol, nStartRow, nEndCol, nEndRow );
@@ -1114,8 +1114,8 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext *pOu
SvxGraphicPosition ePos;
if ( pGraphic && pGraphic->IsSupportedGraphic() )
{
- const MapMode aMapMM( MAP_100TH_MM );
- if ( pGraphic->GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ const MapMode aMapMM( MapUnit::Map100thMM );
+ if ( pGraphic->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
aGrfSize = pRefDev->PixelToLogic( pGraphic->GetPrefSize(), aMapMM );
else
aGrfSize = OutputDevice::LogicToLogic( pGraphic->GetPrefSize(),
@@ -1519,7 +1519,7 @@ void ScPrintFunc::LocateArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
aMMOffset.X() = (long)(aMMOffset.X() * HMM_PER_TWIPS);
aMMOffset.Y() = (long)(aMMOffset.Y() * HMM_PER_TWIPS);
aMMOffset += Point( nLogStX, nLogStY );
- MapMode aDrawMapMode( MAP_100TH_MM, aMMOffset, aLogicMode.GetScaleX(), aLogicMode.GetScaleY() );
+ MapMode aDrawMapMode( MapUnit::Map100thMM, aMMOffset, aLogicMode.GetScaleX(), aLogicMode.GetScaleY() );
// get pixel rectangle
@@ -1609,7 +1609,7 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
OutputDevice* pRefDev = pDoc->GetPrinter(); // use the printer also for Preview
Fraction aPrintFrac( nZoom, 100 ); // without nManualZoom
// MapMode, as it would arrive at the printer:
- pRefDev->SetMapMode( MapMode( MAP_100TH_MM, Point(), aPrintFrac, aPrintFrac ) );
+ pRefDev->SetMapMode( MapMode( MapUnit::Map100thMM, Point(), aPrintFrac, aPrintFrac ) );
// when rendering (PDF), don't use printer as ref device, but printer's MapMode
// has to be set anyway, as charts still use it (#106409#)
@@ -2569,13 +2569,13 @@ void ScPrintFunc::InitModes() // set MapModes from nZoom etc.
aHorFract = Fraction( (long)( nEffZoom / nFact ), 10000 );
}
- aLogicMode = MapMode( MAP_100TH_MM, Point(), aHorFract, aZoomFract );
+ aLogicMode = MapMode( MapUnit::Map100thMM, Point(), aHorFract, aZoomFract );
Point aLogicOfs( -aOffset.X(), -aOffset.Y() );
- aOffsetMode = MapMode( MAP_100TH_MM, aLogicOfs, aHorFract, aZoomFract );
+ aOffsetMode = MapMode( MapUnit::Map100thMM, aLogicOfs, aHorFract, aZoomFract );
Point aTwipsOfs( (long) ( -aOffset.X() / nScaleX + 0.5 ), (long) ( -aOffset.Y() / nScaleY + 0.5 ) );
- aTwipMode = MapMode( MAP_TWIP, aTwipsOfs, aHorFract, aZoomFract );
+ aTwipMode = MapMode( MapUnit::MapTwip, aTwipsOfs, aHorFract, aZoomFract );
}
void ScPrintFunc::ApplyPrintSettings()
@@ -2597,14 +2597,14 @@ void ScPrintFunc::ApplyPrintSettings()
aEnumSize.Width() = aEnumSize.Height();
aEnumSize.Height() = nTemp;
}
- Paper ePaper = SvxPaperInfo::GetSvxPaper( aEnumSize, MAP_TWIP, true );
+ Paper ePaper = SvxPaperInfo::GetSvxPaper( aEnumSize, MapUnit::MapTwip, true );
sal_uInt16 nPaperBin = static_cast<const SvxPaperBinItem&>(pParamSet->Get(ATTR_PAGE_PAPERBIN)).GetValue();
pPrinter->SetPaper( ePaper );
if ( PAPER_USER == ePaper )
{
MapMode aPrinterMode = pPrinter->GetMapMode();
- MapMode aLocalMode( MAP_TWIP );
+ MapMode aLocalMode( MapUnit::MapTwip );
pPrinter->SetMapMode( aLocalMode );
pPrinter->SetPaperSizeUser( aEnumSize );
pPrinter->SetMapMode( aPrinterMode );
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index c6b1673a0464..c83ddd442d30 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1841,7 +1841,7 @@ Point ScTabView::GetChartDialogPos( const Size& rDialogSize, const Rectangle& rL
pWin->OutputToAbsoluteScreenPixel( aObjPixel.BottomRight() ) );
Rectangle aDesktop = pWin->GetDesktopRectPixel();
- Size aSpace = pWin->LogicToPixel( Size( 8, 12 ), MAP_APPFONT );
+ Size aSpace = pWin->LogicToPixel( Size( 8, 12 ), MapUnit::MapAppFont );
ScDocument* pDoc = aViewData.GetDocument();
SCTAB nTab = aViewData.GetTabNo();
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 3b1e33411b0b..f574b0988949 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1819,7 +1819,7 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSa
if ( pDrawObj )
{
Rectangle aRect = pDrawObj->GetLogicRect();
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
Size aOleSize = pDrawObj->GetOrigObjSize( &aMapMode );
aRect.SetSize( aOleSize );
aObjArea = aRect;
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 160dc436c9d5..892b7c71d354 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -332,7 +332,7 @@ void ScTabViewShell::UpdateOleZoom()
if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 )
{
vcl::Window* pWin = GetActiveWin();
- Size aWinHMM = pWin->PixelToLogic( pWin->GetOutputSizePixel(), MAP_100TH_MM );
+ Size aWinHMM = pWin->PixelToLogic( pWin->GetOutputSizePixel(), MapUnit::Map100thMM );
SetZoomFactor( Fraction( aWinHMM.Width(),aObjSize.Width() ),
Fraction( aWinHMM.Height(),aObjSize.Height() ) );
}
@@ -361,7 +361,7 @@ void ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &rSize )
if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 )
{
- Size aLogicSize = GetWindow()->PixelToLogic( aSize, MAP_100TH_MM );
+ Size aLogicSize = GetWindow()->PixelToLogic( aSize, MapUnit::Map100thMM );
SfxViewShell::SetZoomFactor( Fraction( aLogicSize.Width(),aObjSize.Width() ),
Fraction( aLogicSize.Height(),aObjSize.Height() ) );
}
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index d16e7e84caf3..35ca636fcd77 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -127,7 +127,7 @@ void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb )
Size aDrawSize = aRect.GetSize();
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
Size aOleSize = pObj->GetOrigObjSize( &aMapMode );
if ( pClient->GetAspect() != embed::Aspects::MSOLE_ICON
@@ -139,7 +139,7 @@ void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb )
{
MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( pClient->GetAspect() ) );
aOleSize = OutputDevice::LogicToLogic( aDrawSize,
- MAP_100TH_MM, aUnit );
+ MapUnit::Map100thMM, aUnit );
awt::Size aSz( aOleSize.Width(), aOleSize.Height() );
xObj->setVisualAreaSize( pClient->GetAspect(), aSz );
}
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 8e2dd1592d00..34aa647f7da0 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -330,7 +330,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) :
pViewShell ( pViewSh ),
pOptions ( new ScViewOptions ),
pSpellingView ( nullptr ),
- aLogicMode ( MAP_100TH_MM ),
+ aLogicMode ( MapUnit::Map100thMM ),
eDefZoomType( SvxZoomType::PERCENT ),
aDefZoomX ( 1,1 ),
aDefZoomY ( 1,1 ),
@@ -2473,7 +2473,7 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const
{
Point& rSplitPos = rTabSett.maSplitPos;
rSplitPos = Point( bHSplit ? pViewTab->nHSplitPos : 0, bVSplit ? pViewTab->nVSplitPos : 0 );
- rSplitPos = Application::GetDefaultDevice()->PixelToLogic( rSplitPos, MapMode( MAP_TWIP ) );
+ rSplitPos = Application::GetDefaultDevice()->PixelToLogic( rSplitPos, MapMode( MapUnit::MapTwip ) );
if( pDocShell )
rSplitPos.X() = (long)((double)rSplitPos.X() / pDocShell->GetOutputFactor());
}
@@ -2609,7 +2609,7 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt )
else
{
Point aPixel = Application::GetDefaultDevice()->LogicToPixel(
- rTabSett.maSplitPos, MapMode( MAP_TWIP ) ); //! Zoom?
+ rTabSett.maSplitPos, MapMode( MapUnit::MapTwip ) ); //! Zoom?
// the test for use of printer metrics for text formatting here
// effectively results in the nFactor = 1.0 regardless of the Option setting.
if( pDocShell && SC_MOD()->GetInputOptions().GetTextWysiwyg())
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 5e769f87c7bd..680fcb77e9fd 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -88,7 +88,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
if (pRef)
{
aOldMapMode = pRef->GetMapMode();
- pRef->SetMapMode( MapMode(MAP_100TH_MM) );
+ pRef->SetMapMode( MapMode(MapUnit::Map100thMM) );
}
bool bNegativePage = GetViewData().GetDocument()->IsNegativePage( GetViewData().GetTabNo() );
@@ -301,14 +301,14 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X
Size aSize;
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
aSize = aObjRef.GetSize( &aMapMode );
}
else
{
// working with visual area can switch object to running state
MapUnit aMapObj = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
- MapUnit aMap100 = MAP_100TH_MM;
+ MapUnit aMap100 = MapUnit::Map100thMM;
if ( pDescSize && pDescSize->Width() && pDescSize->Height() )
{
@@ -413,9 +413,9 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
Point aPos( rPos );
vcl::Window* pWin = GetActiveWin();
MapMode aSourceMap = rGraphic.GetPrefMapMode();
- MapMode aDestMap( MAP_100TH_MM );
+ MapMode aDestMap( MapUnit::Map100thMM );
- if (aSourceMap.GetMapUnit() == MAP_PIXEL)
+ if (aSourceMap.GetMapUnit() == MapUnit::MapPixel)
{
// consider pixel correction, so bitmap fits to screen
Fraction aScaleX, aScaleY;
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index efedb2e0803b..23d738f45c69 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1404,7 +1404,7 @@ void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
ScDocShellModificator aModificator( *pDocSh );
ScopedVclPtrInstance< VirtualDevice > pVirtDev;
- pVirtDev->SetMapMode(MAP_PIXEL);
+ pVirtDev->SetMapMode(MapUnit::MapPixel);
pDoc->StyleSheetChanged( pStyleSheet, true, pVirtDev,
rViewData.GetPPTX(),
rViewData.GetPPTY(),
@@ -1430,7 +1430,7 @@ void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
ScDocShellModificator aModificator( *pDocSh );
ScopedVclPtrInstance< VirtualDevice > pVirtDev;
- pVirtDev->SetMapMode(MAP_PIXEL);
+ pVirtDev->SetMapMode(MapUnit::MapPixel);
pDoc->StyleSheetChanged( pStyleSheet, false, pVirtDev,
rViewData.GetPPTX(),
rViewData.GetPPTY(),
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 435e81b58254..bbadc7f03704 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -78,7 +78,7 @@ ScXMLSourceDlg::ScXMLSourceDlg(
get(mpFtSourceFile, "sourcefile");
get(mpMapGrid, "mapgrid");
get(mpLbTree, "tree");
- Size aTreeSize(mpLbTree->LogicToPixel(Size(130, 120), MAP_APPFONT));
+ Size aTreeSize(mpLbTree->LogicToPixel(Size(130, 120), MapUnit::MapAppFont));
mpLbTree->set_width_request(aTreeSize.Width());
mpLbTree->set_height_request(aTreeSize.Height());
get(mpRefEdit, "edit");
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 3df30906acf2..6726f3736d9e 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -200,11 +200,11 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
else
SetUIUnit( (FieldUnit)pOptions->GetMetric(), Fraction( 1, 1 ) ); // default
- SetScaleUnit(MAP_100TH_MM);
+ SetScaleUnit(MapUnit::Map100thMM);
SetScaleFraction(Fraction(1, 1));
SetDefaultFontHeight(847); // 24p
- pItemPool->SetDefaultMetric(MAP_100TH_MM);
+ pItemPool->SetDefaultMetric(MapUnit::Map100thMM);
pItemPool->FreezeIdRanges();
SetTextDefaults();
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 601b4bb90939..3ee8be97e24b 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -492,7 +492,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
if (nPageCount <= 1)
{
// #i57181# Paper size depends on Language, like in Writer
- Size aDefSize = SvxPaperInfo::GetDefaultPaperSize( MAP_100TH_MM );
+ Size aDefSize = SvxPaperInfo::GetDefaultPaperSize( MapUnit::Map100thMM );
// Insert handout page
SdPage* pHandoutPage = AllocSdPage(false);
@@ -579,7 +579,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
else
{
// Impress: always use screen format, landscape.
- Size aSz( SvxPaperInfo::GetPaperSize(PAPER_SCREEN_4_3, MAP_100TH_MM) );
+ Size aSz( SvxPaperInfo::GetPaperSize(PAPER_SCREEN_4_3, MapUnit::Map100thMM) );
pPage->SetSize( Size( aSz.Height(), aSz.Width() ) );
pPage->SetBorder(0, 0, 0, 0);
}
@@ -1008,7 +1008,7 @@ IMapObject* SdDrawDocument::GetHitIMapObject( SdrObject* pObj,
if ( pIMapInfo )
{
- const MapMode aMap100( MAP_100TH_MM );
+ const MapMode aMap100( MapUnit::Map100thMM );
Size aGraphSize;
Point aRelPoint( rWinPoint );
ImageMap& rImageMap = (ImageMap&) pIMapInfo->GetImageMap();
@@ -1034,7 +1034,7 @@ IMapObject* SdDrawDocument::GetHitIMapObject( SdrObject* pObj,
if ( rGeo.nShearAngle )
ShearPoint( aRelPoint, rRect.TopLeft(), -rGeo.nTan );
- if ( pGrafObj->GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ if ( pGrafObj->GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
aGraphSize = Application::GetDefaultDevice()->PixelToLogic( pGrafObj->GetGrafPrefSize(), aMap100 );
else
aGraphSize = OutputDevice::LogicToLogic( pGrafObj->GetGrafPrefSize(),
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 733ab02a982d..801016472376 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -303,7 +303,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const Rec
aOutDev.SetMapMode( aGraphic.GetPrefMapMode() );
Size aSizePix = aOutDev.LogicToPixel( aGraphic.GetPrefSize() );
- aOutDev.SetMapMode(MAP_100TH_MM);
+ aOutDev.SetMapMode(MapUnit::Map100thMM);
Size aSize = aOutDev.PixelToLogic(aSizePix);
Point aPnt (0, 0);
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 380e0bc3afbc..8d6cf4d51988 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -1080,9 +1080,9 @@ void ImplExportComments( const uno::Reference< drawing::XDrawPage >& xPage, SvMe
uno::Reference< office::XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement() );
geometry::RealPoint2D aRealPoint2D( xAnnotation->getPosition() );
- MapMode aMapDest( MAP_INCH, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) );
+ MapMode aMapDest( MapUnit::MapInch, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) );
Point aPoint( OutputDevice::LogicToLogic( Point( static_cast< sal_Int32 >( aRealPoint2D.X * 100.0 ),
- static_cast< sal_Int32 >( aRealPoint2D.Y * 100.0 ) ), MAP_100TH_MM, aMapDest ) );
+ static_cast< sal_Int32 >( aRealPoint2D.Y * 100.0 ) ), MapUnit::Map100thMM, aMapDest ) );
OUString sAuthor( xAnnotation->getAuthor() );
uno::Reference< text::XText > xText( xAnnotation->getTextRange() );
diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx
index 350337653598..bd4b23235550 100644
--- a/sd/source/filter/eppt/pptx-epptbase.cxx
+++ b/sd/source/filter/eppt/pptx-epptbase.cxx
@@ -128,8 +128,8 @@ PPTWriterBase::PPTWriterBase()
, mnPages(0)
, mnMasterPages(0)
, maFraction(1, 576)
- , maMapModeSrc(MAP_100TH_MM)
- , maMapModeDest(MAP_INCH, Point(), maFraction, maFraction)
+ , maMapModeSrc(MapUnit::Map100thMM)
+ , maMapModeDest(MapUnit::MapInch, Point(), maFraction, maFraction)
, meLatestPageType(NORMAL)
, mpStyleSheet(nullptr)
{
@@ -148,8 +148,8 @@ PPTWriterBase::PPTWriterBase( const Reference< XModel > & rXModel,
, mnPages(0)
, mnMasterPages(0)
, maFraction(1, 576)
- , maMapModeSrc(MAP_100TH_MM)
- , maMapModeDest(MAP_INCH, Point(), maFraction, maFraction)
+ , maMapModeSrc(MapUnit::Map100thMM)
+ , maMapModeDest(MapUnit::MapInch, Point(), maFraction, maFraction)
, meLatestPageType (NORMAL)
, mpStyleSheet(nullptr)
{
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index 9e4bb2f706ca..f0137e847837 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -194,7 +194,7 @@ bool SdGRFFilter::Import()
Point aPos;
Size aPagSize( pPage->GetSize() );
Size aGrfSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(),
- aGraphic.GetPrefMapMode(), MAP_100TH_MM ) );
+ aGraphic.GetPrefMapMode(), MapUnit::Map100thMM ) );
aPagSize.Width() -= pPage->GetLftBorder() + pPage->GetRgtBorder();
aPagSize.Height() -= pPage->GetUppBorder() + pPage->GetLwrBorder();
diff --git a/sd/source/filter/html/buttonset.cxx b/sd/source/filter/html/buttonset.cxx
index 1eed38115361..2aff0cd214b4 100644
--- a/sd/source/filter/html/buttonset.cxx
+++ b/sd/source/filter/html/buttonset.cxx
@@ -197,7 +197,7 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton
std::vector< Graphic > aGraphics;
ScopedVclPtrInstance< VirtualDevice > pDev;
- pDev->SetMapMode(MapMode(MAP_PIXEL));
+ pDev->SetMapMode(MapMode(MapUnit::MapPixel));
Size aSize;
std::vector< OUString >::const_iterator aIter( rButtons.begin() );
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index cb7dbd6d5e93..74d691031dba 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -366,7 +366,7 @@ SdPublishingDlg::SdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType)
m_bImpress = eDocType == DOCUMENT_TYPE_IMPRESS;
- Size aSize(LogicToPixel(Size(60, 50), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(60, 50), MapUnit::MapAppFont));
get(pPage2_Standard_FB, "standardFBImage");
pPage2_Standard_FB->set_width_request(aSize.Width());
pPage2_Standard_FB->set_height_request(aSize.Height());
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 2cbac3ec54cd..2baffb241b46 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -434,7 +434,7 @@ void CustomAnimationTriggerEntryItem::Paint(const Point& rPos, SvTreeListBox& rD
// draw the category title
int nVertBorder = ((aSize.Height() - rDev.GetTextHeight()) >> 1);
- int nHorzBorder = rRenderContext.LogicToPixel(Size(3, 3), MAP_APPFONT).Width();
+ int nHorzBorder = rRenderContext.LogicToPixel(Size(3, 3), MapUnit::MapAppFont).Width();
aOutRect.Left() += nHorzBorder;
aOutRect.Right() -= nHorzBorder;
@@ -969,7 +969,7 @@ void CustomAnimationList::Paint(vcl::RenderContext& rRenderContext, const Rectan
{
Color aOldColor(rRenderContext.GetTextColor());
rRenderContext.SetTextColor(rRenderContext.GetSettings().GetStyleSettings().GetDisableColor());
- ::Point aOffset(rRenderContext.LogicToPixel(Point(6, 6), MAP_APPFONT));
+ ::Point aOffset(rRenderContext.LogicToPixel(Point(6, 6), MapUnit::MapAppFont));
Rectangle aRect(Point(0,0), GetOutputSizePixel());
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 8da6e5a3e2a8..9689c54b1834 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -387,7 +387,7 @@ public:
virtual Size GetOptimalSize() const override
{
- return LogicToPixel(Size(70, 88), MAP_APPFONT);
+ return LogicToPixel(Size(70, 88), MapUnit::MapAppFont);
}
};
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index 90e5b78d6fc7..21cf13b5499c 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -368,7 +368,7 @@ void AnnotationWindow::StartEdit()
void AnnotationWindow::Rescale()
{
- MapMode aMode(MAP_100TH_MM);
+ MapMode aMode(MapUnit::Map100thMM);
aMode.SetOrigin( Point() );
mpOutliner->SetRefMapMode( aMode );
SetMapMode( aMode );
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index 5ecdd8dfa36c..2d6b184b7a64 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -93,7 +93,7 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
// set its resolution to 600 DPI. This leads to a visually better
// formatting of text in small sizes (6 point and below.)
mpVirtualRefDevice.reset(VclPtr<VirtualDevice>::Create());
- mpVirtualRefDevice->SetMapMode( MAP_100TH_MM );
+ mpVirtualRefDevice->SetMapMode( MapUnit::Map100thMM );
mpVirtualRefDevice->SetReferenceDevice ( VirtualDevice::RefDevMode::Dpi600 );
}
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index c61ebf90874c..fc4f5e76eb21 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -436,7 +436,7 @@ SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot )
// Pool has by default MapUnit Twips (Awgh!)
SfxItemPool& rPool = GetPool();
- rPool.SetDefaultMetric( MAP_100TH_MM );
+ rPool.SetDefaultMetric( MapUnit::Map100thMM );
SfxItemSet* pRet = new SfxItemSet( rPool,
SID_ATTR_METRIC, SID_ATTR_METRIC,
diff --git a/sd/source/ui/dlg/PaneDockingWindow.cxx b/sd/source/ui/dlg/PaneDockingWindow.cxx
index a76a2fe4afc5..2dbe88d41039 100644
--- a/sd/source/ui/dlg/PaneDockingWindow.cxx
+++ b/sd/source/ui/dlg/PaneDockingWindow.cxx
@@ -43,7 +43,7 @@ PaneDockingWindow::PaneDockingWindow(
: TitledDockingWindow(_pBindings, pChildWindow, pParent)
{
SetTitle(rsTitle);
- SetSizePixel(LogicToPixel(Size(80,200), MAP_APPFONT));
+ SetSizePixel(LogicToPixel(Size(80,200), MapUnit::MapAppFont));
}
PaneDockingWindow::~PaneDockingWindow()
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index e20fdec12faa..b1c466f8bc5e 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -119,7 +119,7 @@ VCL_BUILDER_DECL_FACTORY(ClientBox)
Size ClientBox::GetOptimalSize() const
{
- return LogicToPixel(Size(200, 140), MAP_APPFONT);
+ return LogicToPixel(Size(200, 140), MapUnit::MapAppFont);
}
ClientBox::~ClientBox()
@@ -167,7 +167,7 @@ void ClientBox::CalcActiveHeight( const long nPos )
aSize.Width() -= ICON_OFFSET;
aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
- MapMode( MAP_APPFONT ) );
+ MapMode( MapUnit::MapAppFont ) );
aTextHeight += aSize.Height();
if ( aTextHeight < m_nStdHeight )
@@ -356,7 +356,7 @@ void ClientBox::RecalcAll()
Size aPBSize = LogicToPixel(
Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
- MapMode( MAP_APPFONT ) );
+ MapMode( MapUnit::MapAppFont ) );
m_aPinBox->SetSizePixel( aPBSize );
m_aDeauthoriseButton->SetSizePixel( m_aDeauthoriseButton->GetOptimalSize() );
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index e7f2a837b49d..b40f032492c8 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -59,7 +59,7 @@ SdDisplay::SdDisplay(vcl::Window* pWin)
: Control(pWin, 0)
, aScale(1, 1)
{
- SetMapMode( MAP_PIXEL );
+ SetMapMode( MapUnit::MapPixel );
const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
SetBackground( Wallpaper( Color( rStyles.GetFieldColor() ) ) );
}
@@ -105,7 +105,7 @@ void SdDisplay::SetScale( const Fraction& rFrac )
Size SdDisplay::GetOptimalSize() const
{
- return LogicToPixel(Size(147, 87), MAP_APPFONT);
+ return LogicToPixel(Size(147, 87), MapUnit::MapAppFont);
}
void SdDisplay::DataChanged( const DataChangedEvent& rDCEvt )
@@ -534,7 +534,7 @@ void AnimationWindow::UpdateControl(bool const bDisableCtrls)
Size aObjSize( aObjRect.GetSize() );
Point aOrigin( Point( -aObjRect.Left(), -aObjRect.Top() ) );
MapMode aMap( pVD->GetMapMode() );
- aMap.SetMapUnit( MAP_100TH_MM );
+ aMap.SetMapUnit( MapUnit::Map100thMM );
aMap.SetOrigin( aOrigin );
pVD->SetMapMode( aMap );
pVD->SetOutputSize( aObjSize );
@@ -896,7 +896,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
DBG_ASSERT( pOutWin, "Window does not exist!" );
// find window center
- const MapMode aMap100( MAP_100TH_MM );
+ const MapMode aMap100( MapUnit::Map100thMM );
Size aMaxSizeLog;
Size aMaxSizePix;
Size aTemp( pOutWin->GetOutputSizePixel() );
@@ -913,7 +913,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
Size aTmpSizeLog;
const Size aTmpSizePix( rBmpEx.GetSizePixel() );
- if ( aGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ if ( aGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
aTmpSizeLog = pDefDev->PixelToLogic( aGraphic.GetPrefSize(), aMap100 );
else
aTmpSizeLog = OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), aMap100 );
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx
index e4ed8df8241d..f68e06c38293 100644
--- a/sd/source/ui/dlg/copydlg.cxx
+++ b/sd/source/ui/dlg/copydlg.cxx
@@ -118,12 +118,12 @@ void CopyDlg::Reset()
long nMoveX = 500L;
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) )
nMoveX = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
- SetMetricValue( *m_pMtrFldMoveX, Fraction(nMoveX) / maUIScale, MAP_100TH_MM);
+ SetMetricValue( *m_pMtrFldMoveX, Fraction(nMoveX) / maUIScale, MapUnit::Map100thMM);
long nMoveY = 500L;
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) )
nMoveY = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
- SetMetricValue( *m_pMtrFldMoveY, Fraction(nMoveY) / maUIScale, MAP_100TH_MM);
+ SetMetricValue( *m_pMtrFldMoveY, Fraction(nMoveY) / maUIScale, MapUnit::Map100thMM);
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) )
m_pMtrFldAngle->SetValue( static_cast<const SfxInt32Item*>( pPoolItem )->GetValue() );
@@ -133,12 +133,12 @@ void CopyDlg::Reset()
long nWidth = 0L;
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) )
nWidth = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
- SetMetricValue( *m_pMtrFldWidth, Fraction(nWidth) / maUIScale, MAP_100TH_MM);
+ SetMetricValue( *m_pMtrFldWidth, Fraction(nWidth) / maUIScale, MapUnit::Map100thMM);
long nHeight = 0L;
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) )
nHeight = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
- SetMetricValue( *m_pMtrFldHeight, Fraction(nHeight) / maUIScale, MAP_100TH_MM);
+ SetMetricValue( *m_pMtrFldHeight, Fraction(nHeight) / maUIScale, MapUnit::Map100thMM);
if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) )
{
@@ -189,10 +189,10 @@ void CopyDlg::Reset()
*/
void CopyDlg::GetAttr( SfxItemSet& rOutAttrs )
{
- long nMoveX = Fraction( GetCoreValue( *m_pMtrFldMoveX, MAP_100TH_MM) ) * maUIScale;
- long nMoveY = Fraction( GetCoreValue( *m_pMtrFldMoveY, MAP_100TH_MM) ) * maUIScale;
- long nHeight = Fraction( GetCoreValue( *m_pMtrFldHeight, MAP_100TH_MM) ) * maUIScale;
- long nWidth = Fraction( GetCoreValue( *m_pMtrFldWidth, MAP_100TH_MM) ) * maUIScale;
+ long nMoveX = Fraction( GetCoreValue( *m_pMtrFldMoveX, MapUnit::Map100thMM) ) * maUIScale;
+ long nMoveY = Fraction( GetCoreValue( *m_pMtrFldMoveY, MapUnit::Map100thMM) ) * maUIScale;
+ long nHeight = Fraction( GetCoreValue( *m_pMtrFldHeight, MapUnit::Map100thMM) ) * maUIScale;
+ long nWidth = Fraction( GetCoreValue( *m_pMtrFldWidth, MapUnit::Map100thMM) ) * maUIScale;
rOutAttrs.Put( SfxUInt16Item( ATTR_COPY_NUMBER, (sal_uInt16) m_pNumFldCopies->GetValue() ) );
rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_X, nMoveX ) );
@@ -239,9 +239,9 @@ IMPL_LINK_NOARG(CopyDlg, SetViewData, Button*, void)
Rectangle aRect = mpView->GetAllMarkedRect();
SetMetricValue( *m_pMtrFldMoveX, Fraction( aRect.GetWidth() ) /
- maUIScale, MAP_100TH_MM);
+ maUIScale, MapUnit::Map100thMM);
SetMetricValue( *m_pMtrFldMoveY, Fraction( aRect.GetHeight() ) /
- maUIScale, MAP_100TH_MM);
+ maUIScale, MapUnit::Map100thMM);
// sets color attribute
const SfxPoolItem* pPoolItem = nullptr;
@@ -260,13 +260,13 @@ IMPL_LINK_NOARG(CopyDlg, SetDefault, Button*, void)
m_pNumFldCopies->SetValue( 1L );
long nValue = 500L;
- SetMetricValue( *m_pMtrFldMoveX, Fraction(nValue) / maUIScale, MAP_100TH_MM);
- SetMetricValue( *m_pMtrFldMoveY, Fraction(nValue) / maUIScale, MAP_100TH_MM);
+ SetMetricValue( *m_pMtrFldMoveX, Fraction(nValue) / maUIScale, MapUnit::Map100thMM);
+ SetMetricValue( *m_pMtrFldMoveY, Fraction(nValue) / maUIScale, MapUnit::Map100thMM);
nValue = 0L;
m_pMtrFldAngle->SetValue( nValue );
- SetMetricValue( *m_pMtrFldWidth, Fraction(nValue) / maUIScale, MAP_100TH_MM);
- SetMetricValue( *m_pMtrFldHeight, Fraction(nValue) / maUIScale, MAP_100TH_MM);
+ SetMetricValue( *m_pMtrFldWidth, Fraction(nValue) / maUIScale, MapUnit::Map100thMM);
+ SetMetricValue( *m_pMtrFldHeight, Fraction(nValue) / maUIScale, MapUnit::Map100thMM);
// set color attribute
const SfxPoolItem* pPoolItem = nullptr;
diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx
index aa0d30375cde..1b9a51655c5a 100644
--- a/sd/source/ui/dlg/dlgsnap.cxx
+++ b/sd/source/ui/dlg/dlgsnap.cxx
@@ -105,8 +105,8 @@ SdSnapLineDlg::SdSnapLineDlg(
nYValue = static_cast<const SfxInt32Item&>( rInAttrs.Get(ATTR_SNAPLINE_Y)).GetValue();
nXValue = Fraction(nXValue) / aUIScale;
nYValue = Fraction(nYValue) / aUIScale;
- SetMetricValue( *m_pMtrFldX, nXValue, MAP_100TH_MM);
- SetMetricValue( *m_pMtrFldY, nYValue, MAP_100TH_MM);
+ SetMetricValue( *m_pMtrFldX, nXValue, MapUnit::Map100thMM);
+ SetMetricValue( *m_pMtrFldY, nYValue, MapUnit::Map100thMM);
m_pRbPoint->Check();
}
@@ -152,8 +152,8 @@ void SdSnapLineDlg::GetAttr(SfxItemSet& rOutAttrs)
else if ( m_pRbVert->IsChecked() ) eKind = SK_VERTICAL;
else eKind = SK_POINT;
- nXValue = Fraction( GetCoreValue( *m_pMtrFldX, MAP_100TH_MM) ) * aUIScale;
- nYValue = Fraction( GetCoreValue( *m_pMtrFldY, MAP_100TH_MM) ) * aUIScale;
+ nXValue = Fraction( GetCoreValue( *m_pMtrFldX, MapUnit::Map100thMM) ) * aUIScale;
+ nYValue = Fraction( GetCoreValue( *m_pMtrFldY, MapUnit::Map100thMM) ) * aUIScale;
rOutAttrs.Put(SfxAllEnumItem(ATTR_SNAPLINE_KIND, (sal_uInt16)eKind));
rOutAttrs.Put(SfxUInt32Item(ATTR_SNAPLINE_X, nXValue));
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index e141119de251..3158d48f47b5 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -89,7 +89,7 @@ void SdDocPreviewWin::dispose()
Size SdDocPreviewWin::GetOptimalSize() const
{
- return LogicToPixel(Size(122, 96), MAP_APPFONT);
+ return LogicToPixel(Size(122, 96), MapUnit::MapAppFont);
}
void SdDocPreviewWin::Resize()
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index e021b59a16e7..f369a613986d 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -703,7 +703,7 @@ PresLayoutPreview::~PresLayoutPreview()
Size PresLayoutPreview::GetOptimalSize() const
{
- return LogicToPixel(Size(80, 80), MAP_APPFONT);
+ return LogicToPixel(Size(80, 80), MapUnit::MapAppFont);
}
void PresLayoutPreview::init( SdPage *pMaster )
diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx
index a39c9fdc9fd9..8b9fba0396ad 100644
--- a/sd/source/ui/dlg/sdpreslt.cxx
+++ b/sd/source/ui/dlg/sdpreslt.cxx
@@ -40,7 +40,7 @@ SdPresLayoutDlg::SdPresLayoutDlg(::sd::DrawDocShell* pDocShell,
, maStrNone(SD_RESSTR(STR_NULL))
{
get(m_pVS, "select");
- Size aPref(LogicToPixel(Size(144 , 141), MAP_APPFONT));
+ Size aPref(LogicToPixel(Size(144 , 141), MapUnit::MapAppFont));
m_pVS->set_width_request(aPref.Width());
m_pVS->set_height_request(aPref.Height());
get(m_pCbxMasterPage, "masterpage");
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index 685658ae26db..54818e24a3be 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -45,7 +45,7 @@ SdVectorizeDlg::SdVectorizeDlg(vcl::Window* pParent, const Bitmap& rBmp, ::sd::D
get(m_pBmpWin, "source");
get(m_pMtfWin, "vectorized");
- Size aSize(LogicToPixel(Size(92, 100), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(92, 100), MapUnit::MapAppFont));
m_pBmpWin->set_width_request(aSize.Width());
m_pMtfWin->set_width_request(aSize.Width());
m_pBmpWin->set_height_request(aSize.Height());
diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx
index c10dbc1c2b34..058851baea1c 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -128,10 +128,10 @@ Rectangle DrawDocShell::GetVisArea(sal_uInt16 nAspect) const
if( ( ASPECT_THUMBNAIL == nAspect ) || ( ASPECT_DOCPRINT == nAspect ) )
{
// provide size of first page
- MapMode aSrcMapMode(MAP_PIXEL);
- MapMode aDstMapMode(MAP_100TH_MM);
+ MapMode aSrcMapMode(MapUnit::MapPixel);
+ MapMode aDstMapMode(MapUnit::Map100thMM);
Size aSize = mpDoc->GetSdPage(0, PK_STANDARD)->GetSize();
- aSrcMapMode.SetMapUnit(MAP_100TH_MM);
+ aSrcMapMode.SetMapUnit(MapUnit::Map100thMM);
aSize = Application::GetDefaultDevice()->LogicToLogic(aSize, &aSrcMapMode, &aDstMapMode);
aVisArea.SetSize(aSize);
@@ -190,7 +190,7 @@ Size DrawDocShell::GetFirstPageSize()
Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage)
{
const sal_uInt16 nMaxEdgePixel = 90;
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
const Size aSize( pPage->GetSize() );
const Point aNullPt;
ScopedVclPtrInstance< VirtualDevice > pVDev( *Application::GetDefaultDevice() );
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 63696aa45269..b6467f2dcd7e 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -126,7 +126,7 @@ SfxPrinter* DrawDocShell::GetPrinter(bool bCreate)
mpPrinter->SetDrawMode( nMode );
MapMode aMM (mpPrinter->GetMapMode());
- aMM.SetMapUnit(MAP_100TH_MM);
+ aMM.SetMapUnit(MapUnit::Map100thMM);
mpPrinter->SetMapMode(aMM);
UpdateRefDevice();
}
diff --git a/sd/source/ui/docshell/sdclient.cxx b/sd/source/ui/docshell/sdclient.cxx
index 1588c9f94a03..dfe544d35671 100644
--- a/sd/source/ui/docshell/sdclient.cxx
+++ b/sd/source/ui/docshell/sdclient.cxx
@@ -163,7 +163,7 @@ void Client::ViewChanged()
// TODO/LEAN: maybe we can do this without requesting the VisualArea?
// working with the visual area might need running state, so the object may switch itself to this state
- MapMode aMap100( MAP_100TH_MM );
+ MapMode aMap100( MapUnit::Map100thMM );
Rectangle aVisArea;
Size aSize = pSdrOle2Obj->GetOrigObjSize( &aMap100 );
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 720b1681f170..68a6f320218c 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -370,14 +370,14 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
// rectangle with balanced edge ratio
aSize.Width() = 14100;
aSize.Height() = 10000;
- Size aTmp = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aUnit );
+ Size aTmp = OutputDevice::LogicToLogic( aSize, MapUnit::Map100thMM, aUnit );
aSz.Width = aTmp.Width();
aSz.Height = aTmp.Height();
xObj->setVisualAreaSize( nAspect, aSz );
}
else
{
- aSize = OutputDevice::LogicToLogic(aSize, aUnit, MAP_100TH_MM);
+ aSize = OutputDevice::LogicToLogic(aSize, aUnit, MapUnit::Map100thMM);
}
Point aPos;
@@ -433,7 +433,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
}
pOleObj->SetLogicRect(aRect);
- Size aTmp( OutputDevice::LogicToLogic( aRect.GetSize(), MAP_100TH_MM, aUnit ) );
+ Size aTmp( OutputDevice::LogicToLogic( aRect.GetSize(), MapUnit::Map100thMM, aUnit ) );
awt::Size aVisualSize;
aVisualSize.Width = aTmp.Width();
aVisualSize.Height = aTmp.Height();
@@ -529,7 +529,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
bool bInsertNewObject = true;
Size aSize;
- MapUnit aMapUnit = MAP_100TH_MM;
+ MapUnit aMapUnit = MapUnit::Map100thMM;
if ( nAspect != embed::Aspects::MSOLE_ICON )
{
awt::Size aSz;
@@ -550,14 +550,14 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
// rectangle with balanced edge ratio
aSize.Width() = 14100;
aSize.Height() = 10000;
- Size aTmp = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aMapUnit );
+ Size aTmp = OutputDevice::LogicToLogic( aSize, MapUnit::Map100thMM, aMapUnit );
aSz.Width = aTmp.Width();
aSz.Height = aTmp.Height();
xObj->setVisualAreaSize( nAspect, aSz );
}
else
{
- aSize = OutputDevice::LogicToLogic(aSize, aMapUnit, MAP_100TH_MM);
+ aSize = OutputDevice::LogicToLogic(aSize, aMapUnit, MapUnit::Map100thMM);
}
}
@@ -593,7 +593,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
}
else
{
- Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MAP_100TH_MM, aMapUnit );
+ Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MapUnit::Map100thMM, aMapUnit );
awt::Size aSz( aTmp.Width(), aTmp.Height() );
xObj->setVisualAreaSize( nAspect, aSz );
}
@@ -613,7 +613,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
aObjRef.SetGraphicStream( xIconMetaFile, aIconMediaType );
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
aSize = aObjRef.GetSize( &aMapMode );
}
@@ -636,7 +636,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
awt::Size aSz = xObj->getVisualAreaSize( nAspect );
Size aNewSize = Window::LogicToLogic( Size( aSz.Width, aSz.Height ),
- MapMode( aMapUnit ), MapMode( MAP_100TH_MM ) );
+ MapMode( aMapUnit ), MapMode( MapUnit::Map100thMM ) );
if ( aNewSize != aSize )
{
aRect.SetSize( aNewSize );
@@ -653,7 +653,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
if ( nAspect != embed::Aspects::MSOLE_ICON )
{
- Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MAP_100TH_MM, aMapUnit );
+ Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MapUnit::Map100thMM, aMapUnit );
awt::Size aSz( aTmp.Width(), aTmp.Height() );
xObj->setVisualAreaSize( nAspect, aSz );
}
@@ -737,9 +737,9 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq )
if( aPrefSize.Width() && aPrefSize.Height() )
{
if( mpWindow )
- aSize = mpWindow->PixelToLogic( aPrefSize, MAP_100TH_MM );
+ aSize = mpWindow->PixelToLogic( aPrefSize, MapUnit::Map100thMM );
else
- aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM );
+ aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM );
}
else
aSize = Size( 5000, 5000 );
@@ -816,9 +816,9 @@ void FuInsert3DModel::DoExecute( SfxRequest& )
Size aSize(480,360);
if( mpWindow )
- aSize = mpWindow->PixelToLogic( aSize, MAP_100TH_MM );
+ aSize = mpWindow->PixelToLogic( aSize, MapUnit::Map100thMM );
else
- aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, MAP_100TH_MM );
+ aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, MapUnit::Map100thMM );
if( mpWindow )
{
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index 8d7ffc8e3630..d103a84fa0db 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -97,7 +97,7 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow (
pWindow->Show(bInitiallyVisible);
- pWindow->SetMapMode(MAP_PIXEL);
+ pWindow->SetMapMode(MapUnit::MapPixel);
pWindow->SetBackground();
if ( ! bEnableParentClip)
{
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 39fec898ad74..62cb7141cdb4 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -252,7 +252,7 @@ PresenterTextView::Implementation::Implementation()
mnTop(0),
mnTotalHeight(-1)
{
- mpOutputDevice->SetMapMode(MAP_PIXEL);
+ mpOutputDevice->SetMapMode(MapUnit::MapPixel);
GetEditEngine();
}
@@ -330,7 +330,7 @@ EditEngine* PresenterTextView::Implementation::CreateEditEngine()
EEControlBits(~EEControlBits::PASTESPECIAL) );
pEditEngine->SetWordDelimiters (" .=+-*/(){}[];\"");
- pEditEngine->SetRefMapMode (MAP_PIXEL);
+ pEditEngine->SetRefMapMode (MapUnit::MapPixel);
pEditEngine->SetPaperSize (Size(800, 0));
pEditEngine->EraseVirtualDevice();
pEditEngine->ClearModifyFlag();
@@ -387,7 +387,7 @@ void PresenterTextView::Implementation::SetFontDescriptor (
SvxFontHeightItem aFontHeight(
Application::GetDefaultDevice()->LogicToPixel(
- Size(0, nFontHeight), MapMode (MAP_POINT)).Height(),
+ Size(0, nFontHeight), MapMode (MapUnit::MapPoint)).Height(),
100,
EE_CHAR_FONTHEIGHT);
mpEditEngineItemPool->SetPoolDefaultItem( aFontHeight);
@@ -454,7 +454,7 @@ Reference<rendering::XBitmap> const & PresenterTextView::Implementation::GetBitm
mpOutputDevice.disposeAndClear();
mpOutputDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(),
DeviceFormat::DEFAULT, DeviceFormat::DEFAULT);
- mpOutputDevice->SetMapMode(MAP_PIXEL);
+ mpOutputDevice->SetMapMode(MapUnit::MapPixel);
mpOutputDevice->SetOutputSizePixel(maSize);
mpOutputDevice->SetLineColor();
mpOutputDevice->SetFillColor();
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index ab7c1fb68fc1..fcf4bf45e37a 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -718,7 +718,7 @@ void SlideBackground::NotifyItemUpdate(
if(mpPaperOrientation->GetSelectEntryPos() == 0)
Swap(aPaperSize);
- Paper ePaper = SvxPaperInfo::GetSvxPaper(aPaperSize, static_cast<MapUnit>(meUnit),true);
+ Paper ePaper = SvxPaperInfo::GetSvxPaper(aPaperSize, meUnit, true);
mpPaperSizeBox->SetSelection( ePaper );
}
}
diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx
index ba757dc4b0a8..11d2ae362039 100644
--- a/sd/source/ui/slideshow/showwin.cxx
+++ b/sd/source/ui/slideshow/showwin.cxx
@@ -59,7 +59,7 @@ ShowWindow::ShowWindow( const ::rtl::Reference< SlideshowImpl >& xController, vc
EnableRTL (false);
MapMode aMap(GetMapMode());
- aMap.SetMapUnit(MAP_100TH_MM);
+ aMap.SetMapUnit(MapUnit::Map100thMM);
SetMapMode(aMap);
// set HelpId
@@ -462,8 +462,8 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
const MapMode& rMap = GetMapMode();
const Point aOutOrg( PixelToLogic( Point() ) );
const Size aOutSize( GetOutputSize() );
- const Size aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, rMap ) );
- const Size aOffset( LogicToLogic( Size( 1000, 1000 ), MAP_100TH_MM, rMap ) );
+ const Size aTextSize( LogicToLogic( Size( 0, 14 ), MapUnit::MapPoint, rMap ) );
+ const Size aOffset( LogicToLogic( Size( 1000, 1000 ), MapUnit::Map100thMM, rMap ) );
OUString aText( SdResId( STR_PRES_PAUSE ) );
bool bDrawn = false;
@@ -479,7 +479,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
{
Size aGrfSize;
- if( maLogo.GetPrefMapMode() == MAP_PIXEL )
+ if( maLogo.GetPrefMapMode() == MapUnit::MapPixel )
aGrfSize = PixelToLogic( maLogo.GetPrefSize() );
else
aGrfSize = LogicToLogic( maLogo.GetPrefSize(), maLogo.GetPrefMapMode(), rMap );
@@ -536,7 +536,7 @@ void ShowWindow::DrawEndScene()
vcl::Font aFont( GetSettings().GetStyleSettings().GetMenuFont() );
const Point aOutOrg( PixelToLogic( Point() ) );
- const Size aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, GetMapMode() ) );
+ const Size aTextSize( LogicToLogic( Size( 0, 14 ), MapUnit::MapPoint, GetMapMode() ) );
const OUString aText( SdResId( STR_PRES_SOFTEND ) );
aFont.SetFontSize( aTextSize );
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index b762a68cd172..0b36058aadb4 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -133,7 +133,7 @@ SlideSorterController::SlideSorterController (SlideSorter& rSlideSorter)
// class.
pWindow->SetBackground(Wallpaper());
pWindow->SetCenterAllowed(false);
- pWindow->SetMapMode(MapMode(MAP_PIXEL));
+ pWindow->SetMapMode(MapMode(MapUnit::MapPixel));
pWindow->SetViewSize(mrView.GetModelArea().GetSize());
}
}
diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx b/sd/source/ui/slidesorter/view/SlsTheme.cxx
index 45806df08f0e..86bf11a0b81d 100644
--- a/sd/source/ui/slidesorter/view/SlsTheme.cxx
+++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx
@@ -156,7 +156,7 @@ std::shared_ptr<vcl::Font> Theme::GetFont (
if (pFont)
{
// Transform the point size to pixel size.
- const MapMode aFontMapMode (MAP_POINT);
+ const MapMode aFontMapMode (MapUnit::MapPoint);
const Size aFontSize (rDevice.LogicToPixel(pFont->GetFontSize(), aFontMapMode));
// Transform the font size to the logical coordinates of the device.
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index d4b8aca487cf..8a2cf3f8d3d7 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -160,7 +160,7 @@ Image PreviewRenderer::RenderSubstitution (
// Set a map mode that makes a typical substitution text completely
// visible.
MapMode aMapMode (mpPreviewDevice->GetMapMode());
- aMapMode.SetMapUnit(MAP_100TH_MM);
+ aMapMode.SetMapUnit(MapUnit::Map100thMM);
Fraction aFinalScale(25 * rPreviewPixelSize.Width(), 28000);
aMapMode.SetScaleX(aFinalScale);
aMapMode.SetScaleY(aFinalScale);
@@ -365,7 +365,7 @@ void PreviewRenderer::SetupOutputSize (
// First set the map mode to some arbitrary scale that is numerically
// stable.
MapMode aMapMode (mpPreviewDevice->GetMapMode());
- aMapMode.SetMapUnit(MAP_PIXEL);
+ aMapMode.SetMapUnit(MapUnit::MapPixel);
// Adapt it to the desired width.
const Size aPageModelSize (rPage.GetSize());
@@ -449,7 +449,7 @@ Image PreviewRenderer::ScaleBitmap (
(long)((nWidth*1.0 * aSize.Height()) / aSize.Width() + 0.5));
Size aPreviewSize (aFrameSize.Width()-2,aFrameSize.Height()-2);
MapMode aMapMode (mpPreviewDevice->GetMapMode());
- aMapMode.SetMapUnit(MAP_PIXEL);
+ aMapMode.SetMapUnit(MapUnit::MapPixel);
aMapMode.SetOrigin (Point());
aMapMode.SetScaleX (1.0);
aMapMode.SetScaleY (1.0);
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index afd08350bc90..125684283896 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -766,7 +766,7 @@ throw (UnknownPropertyException, PropertyVetoException,
pPrinter = SfxPrinter::Create ( aStream, pItemSet );
MapMode aMM (pPrinter->GetMapMode());
- aMM.SetMapUnit(MAP_100TH_MM);
+ aMM.SetMapUnit(MapUnit::Map100thMM);
pPrinter->SetMapMode(aMM);
pDocSh->SetPrinter( pPrinter );
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 72d53f7375e5..f4037ce1dbb1 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1925,7 +1925,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
pView->SetPageVisible( false );
pView->SetGlueVisible( false );
- pOut->SetMapMode( MAP_100TH_MM );
+ pOut->SetMapMode( MapUnit::Map100thMM );
pOut->IntersectClipRegion( aVisArea );
uno::Reference< frame::XModel > xModel;
@@ -2268,7 +2268,7 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice,
nTilePosY = convertTwipToMm100( nTilePosY );
MapMode aMapMode = rDevice.GetMapMode();
- aMapMode.SetMapUnit( MAP_100TH_MM );
+ aMapMode.SetMapUnit( MapUnit::Map100thMM );
aMapMode.SetOrigin( Point( -nTilePosX,
-nTilePosY) );
aMapMode.SetScaleX( scaleX );
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 206cc01f233b..3033a115369e 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -1135,7 +1135,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
Size aSize( GetPage()->GetSize() );
xMetaFile->AddAction( static_cast<MetaAction*>(new MetaFillColorAction( COL_WHITE, true )), 0 );
xMetaFile->AddAction( static_cast<MetaAction*>(new MetaRectAction( Rectangle( aPoint, aSize ) )), 1 );
- xMetaFile->SetPrefMapMode( MAP_100TH_MM );
+ xMetaFile->SetPrefMapMode( MapUnit::Map100thMM );
xMetaFile->SetPrefSize( aSize );
SvMemoryStream aDestStrm( 65535, 65535 );
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index 5361f5abc725..359906e911f3 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1432,7 +1432,7 @@ private:
{
MapMode aMap (aInfo.mpPrinter->GetMapMode());
- aMap.SetMapUnit(MAP_100TH_MM);
+ aMap.SetMapUnit(MapUnit::Map100thMM);
aInfo.maMap = aMap;
mpPrinter->SetMapMode(aMap);
@@ -1623,7 +1623,7 @@ private:
Rectangle aOutRect(aPageOfs, rInfo.mpPrinter->GetOutputSize());
if( aOutRect.GetWidth() > aOutRect.GetHeight() )
{
- Size aPaperSize( rInfo.mpPrinter->PixelToLogic( rInfo.mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
+ Size aPaperSize( rInfo.mpPrinter->PixelToLogic( rInfo.mpPrinter->GetPaperSizePixel(), MapMode( MapUnit::Map100thMM ) ) );
maPrintSize.Width = aPaperSize.Height();
maPrintSize.Height = aPaperSize.Width();
const long nRotatedWidth = aOutRect.GetHeight();
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 97c6b502b949..8aee92b7e04d 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -478,7 +478,7 @@ void ViewShellBase::InnerResizePixel (const Point& rOrigin, const Size &rSize)
Size aSize( rSize );
aSize.Width() -= (aBorder.Left() + aBorder.Right());
aSize.Height() -= (aBorder.Top() + aBorder.Bottom());
- Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel( aObjSize, MAP_100TH_MM );
+ Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel( aObjSize, MapUnit::Map100thMM );
SfxViewShell::SetZoomFactor(
Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), (long int)1 ) ),
Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), (long int)1) ) );
@@ -550,7 +550,7 @@ sal_uInt16 ViewShellBase::SetPrinter (
nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE) && pNewPrinter )
{
MapMode aMap = pNewPrinter->GetMapMode();
- aMap.SetMapUnit(MAP_100TH_MM);
+ aMap.SetMapUnit(MapUnit::Map100thMM);
MapMode aOldMap = pNewPrinter->GetMapMode();
pNewPrinter->SetMapMode(aMap);
Size aNewSize = pNewPrinter->GetOutputSize();
@@ -1064,8 +1064,8 @@ void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const
{
Rectangle aRectangle = pOutlinerView->GetOutputArea();
vcl::Window* pWin = pThisShell->GetActiveWindow();
- if (pWin && pWin->GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP);
+ if (pWin && pWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip);
OString sRectangle = aRectangle.toString();
SfxLokHelper::notifyOtherView(&pDrawViewShell->GetViewShellBase(), pOtherShell, LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle);
}
diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx
index 4ef3dce4e7f1..f1c07f6102ed 100644
--- a/sd/source/ui/view/drviews8.cxx
+++ b/sd/source/ui/view/drviews8.cxx
@@ -65,12 +65,12 @@ void DrawViewShell::ScannerEvent( const css::lang::EventObject& )
const SolarMutexGuard aGuard;
SdrPage* pPage = mpDrawView->GetSdrPageView()->GetPage();
Size aBmpSize( aScanBmp.GetPrefSize() ), aPageSize( pPage->GetSize() );
- const MapMode aMap100( MAP_100TH_MM );
+ const MapMode aMap100( MapUnit::Map100thMM );
if( !aBmpSize.Width() || !aBmpSize.Height() )
aBmpSize = aScanBmp.GetSizePixel();
- if( aScanBmp.GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ if( aScanBmp.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
aBmpSize = GetActiveWindow()->PixelToLogic( aBmpSize, aMap100 );
else
aBmpSize = OutputDevice::LogicToLogic( aBmpSize, aScanBmp.GetPrefMapMode(), aMap100 );
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index 6b3b0606b5ca..25899a943c03 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -91,7 +91,7 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq)
ScopedVclPtrInstance< Window > aWindow(GetActiveWindow());
aWindow->SetMapMode(aGraphic.GetPrefMapMode());
Size aSizePix = aWindow->LogicToPixel(aGraphic.GetPrefSize());
- aWindow->SetMapMode( MapMode(MAP_100TH_MM) );
+ aWindow->SetMapMode( MapMode(MapUnit::Map100thMM) );
Size aSize = aWindow->PixelToLogic(aSizePix);
// constrain size to page size if necessary
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 061b28aecb2e..b98f8009db0d 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -719,8 +719,8 @@ bool View::SdrBeginTextEdit(
if (OutlinerView* pView = GetTextEditOutlinerView())
{
Rectangle aRectangle = pView->GetOutputArea();
- if (pWin && pWin->GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP);
+ if (pWin && pWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip);
OString sRectangle = aRectangle.toString();
SfxLokHelper::notifyOtherViews(&mpViewSh->GetViewShellBase(), LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle);
}
@@ -886,7 +886,7 @@ void View::SetMarkedOriginalSize()
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
- MapMode aMap100( MAP_100TH_MM );
+ MapMode aMap100( MapUnit::Map100thMM );
aOleSize = static_cast<SdrOle2Obj*>(pObj)->GetOrigObjSize( &aMap100 );
bOK = true;
}
@@ -896,7 +896,7 @@ void View::SetMarkedOriginalSize()
try
{
awt::Size aSz = xObj->getVisualAreaSize( nAspect );
- aOleSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aUnit, MAP_100TH_MM );
+ aOleSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aUnit, MapUnit::Map100thMM );
bOK = true;
}
catch( embed::NoVisualAreaSizeException& )
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index ec2764825c76..452a7e4bc5da 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -948,7 +948,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
aSize = aObjDesc.maSize;
else
{
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
aSize = aObjRef.GetSize( &aMapMode );
}
}
@@ -958,7 +958,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( aObjDesc.mnViewAspect ) );
if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() )
{
- Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MAP_100TH_MM, aMapUnit ) );
+ Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MapUnit::Map100thMM, aMapUnit ) );
aSz.Width = aTmp.Width();
aSz.Height = aTmp.Height();
xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz );
@@ -979,13 +979,13 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
{
aSize.Width() = 14100;
aSize.Height() = 10000;
- aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MAP_100TH_MM, aMapUnit );
+ aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MapUnit::Map100thMM, aMapUnit );
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz );
}
- aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM );
+ aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MapUnit::Map100thMM );
}
Size aMaxSize( mrDoc.GetMaxObjSize() );
@@ -1117,7 +1117,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
aSize = aObjDesc.maSize;
else
{
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
aSize = aObjRef.GetSize( &aMapMode );
}
}
@@ -1136,7 +1136,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() )
{
- Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MAP_100TH_MM, aMapUnit ) );
+ Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MapUnit::Map100thMM, aMapUnit ) );
if ( aSz.Width != aTmp.Width() || aSz.Height != aTmp.Height() )
{
aSz.Width = aTmp.Width();
@@ -1149,13 +1149,13 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( !aSize.Width() || !aSize.Height() )
{
- aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MAP_100TH_MM, aMapUnit );
+ aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MapUnit::Map100thMM, aMapUnit );
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz );
}
- aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM );
+ aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MapUnit::Map100thMM );
}
Size aMaxSize( mrDoc.GetMaxObjSize() );
@@ -1226,7 +1226,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
// restrict movement to WorkArea
Size aImageMapSize = OutputDevice::LogicToLogic(aGraphic.GetPrefSize(),
- aGraphic.GetPrefMapMode(), MapMode(MAP_100TH_MM));
+ aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM));
ImpCheckInsertPos(aInsertPos, aImageMapSize, GetWorkArea());
@@ -1523,7 +1523,7 @@ bool View::PasteRTFTable( const ::tools::SvRef<SotStorageStream>& xStm, SdrPage*
{
std::unique_ptr<SdDrawDocument> pModel(new SdDrawDocument( DOCUMENT_TYPE_IMPRESS, mpDocSh ));
pModel->NewOrLoadCompleted(NEW_DOC);
- pModel->GetItemPool().SetDefaultMetric(MAP_100TH_MM);
+ pModel->GetItemPool().SetDefaultMetric(MapUnit::Map100thMM);
pModel->InsertPage(pModel->AllocPage(false));
Reference< XComponent > xComponent( new SdXImpressDocument( pModel.get(), true ) );
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 6ad4b1d7901c..756f2fff2963 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -173,7 +173,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
// create new object
Size aSize;
- if ( rGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ if ( rGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
{
::OutputDevice* pOutDev = nullptr;
if( mpViewSh )
@@ -183,13 +183,13 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
pOutDev = Application::GetDefaultDevice();
if( pOutDev )
- aSize = pOutDev->PixelToLogic( rGraphic.GetPrefSize(), MAP_100TH_MM );
+ aSize = pOutDev->PixelToLogic( rGraphic.GetPrefSize(), MapUnit::Map100thMM );
}
else
{
aSize = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(),
rGraphic.GetPrefMapMode(),
- MapMode( MAP_100TH_MM ) );
+ MapMode( MapUnit::Map100thMM ) );
}
pNewGrafObj = new SdrGrafObj( rGraphic, Rectangle( rPos, aSize ) );
@@ -489,9 +489,9 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Idle *, void)
::sd::Window* pWin = mpViewSh->GetActiveWindow();
if( pWin )
- aPrefSize = pWin->PixelToLogic( aPrefSize, MAP_100TH_MM );
+ aPrefSize = pWin->PixelToLogic( aPrefSize, MapUnit::Map100thMM );
else
- aPrefSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM );
+ aPrefSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM );
}
else
aPrefSize = Size( 5000, 5000 );
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 728d40a89a55..abcaaeecea6c 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -74,7 +74,7 @@ Window::Window(vcl::Window* pParent)
SetDialogControlFlags( DialogControlFlags::Return | DialogControlFlags::WantFocus );
MapMode aMap(GetMapMode());
- aMap.SetMapUnit(MAP_100TH_MM);
+ aMap.SetMapUnit(MapUnit::Map100thMM);
SetMapMode(aMap);
// whit it, the vcl::WindowColor is used in the slide mode
@@ -1004,8 +1004,8 @@ void Window::LogicInvalidate(const Rectangle* pRectangle)
else
{
Rectangle aRectangle(*pRectangle);
- if (GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP);
+ if (GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip);
sRectangle = aRectangle.toString();
}
SfxViewShell& rSfxViewShell = mpViewShell->GetViewShellBase();
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index d2d4f64a0836..afafe4c8a5d5 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -205,7 +205,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
}
sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId);
- bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == MAP_TWIP );
+ bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == MapUnit::MapTwip );
pItem->SetWhich( nWhich );
sal_uInt16 nSubCount = pType->nAttribs;
@@ -322,7 +322,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
}
sal_uInt16 nWhich = rSet.GetPool()->GetWhich(rArg.nSlotId);
- bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == MAP_TWIP );
+ bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == MapUnit::MapTwip );
pItem->SetWhich( nWhich );
const SfxType* pType = rArg.pType;
sal_uInt16 nSubCount = pType->nAttribs;
@@ -1273,7 +1273,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
{
// slot is a property
sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId);
- bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == MAP_TWIP );
+ bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == MapUnit::MapTwip );
const SfxPoolItem* pItem = rSet.GetItem<SfxPoolItem>(nWhich, false);
if ( pItem ) //???
{
@@ -1325,7 +1325,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
{
const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg );
sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId );
- bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == MAP_TWIP );
+ bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == MapUnit::MapTwip );
const SfxPoolItem* pItem = rSet.GetItem<SfxPoolItem>(nWhich, false);
if ( pItem ) //???
{
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 0242633f5658..e7b7dd4ed3d2 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -437,7 +437,7 @@ ContentTabPage_Impl::ContentTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindo
"sfx/ui/helpcontentpage.ui")
{
get(m_pContentBox, "content");
- Size aSize(LogicToPixel(Size(108 , 188), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(108 , 188), MapUnit::MapAppFont));
m_pContentBox->set_width_request(aSize.Width());
m_pContentBox->set_height_request(aSize.Height());
}
@@ -545,7 +545,7 @@ IndexTabPage_Impl::IndexTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_Im
, bIsActivated(false)
{
get(m_pIndexCB, "terms");
- Size aSize(LogicToPixel(Size(108, 97), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(108, 97), MapUnit::MapAppFont));
m_pIndexCB->set_width_request(aSize.Width());
m_pIndexCB->set_height_request(aSize.Height());
get(m_pOpenBtn, "display");
@@ -918,7 +918,7 @@ SearchTabPage_Impl::SearchTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_
get(m_pFullWordsCB, "completewords");
get(m_pScopeCB, "headings");
get(m_pResultsLB, "results");
- Size aSize(LogicToPixel(Size(128 , 30), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(128 , 30), MapUnit::MapAppFont));
m_pResultsLB->set_width_request(aSize.Width());
m_pResultsLB->set_height_request(aSize.Height());
get(m_pOpenBtn, "display");
@@ -1268,7 +1268,7 @@ BookmarksTabPage_Impl::BookmarksTabPage_Impl(vcl::Window* pParent, SfxHelpIndexW
{
get(m_pBookmarksPB, "display");
get(m_pBookmarksBox, "bookmarks");
- Size aSize(LogicToPixel(Size(120 , 200), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(120 , 200), MapUnit::MapAppFont));
m_pBookmarksBox->set_width_request(aSize.Width());
m_pBookmarksBox->set_height_request(aSize.Height());
@@ -2072,7 +2072,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox()
}
// set position of the checkbox
- Size a3Size = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
+ Size a3Size = LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont );
Size aTBSize = aToolBox->GetSizePixel();
Size aCBSize = aOnStartupCB->GetSizePixel();
Point aPnt = aToolBox->GetPosPixel();
@@ -2957,7 +2957,7 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl(
pIndexWin = VclPtr<SfxHelpIndexWindow_Impl>::Create( this );
pIndexWin->SetDoubleClickHdl( LINK( this, SfxHelpWindow_Impl, OpenHdl ) );
pIndexWin->SetSelectFactoryHdl( LINK( this, SfxHelpWindow_Impl, SelectFactoryHdl ) );
- pIndexWin->SetSizePixel(LogicToPixel(Size(120, 200), MAP_APPFONT));
+ pIndexWin->SetSizePixel(LogicToPixel(Size(120, 200), MapUnit::MapAppFont));
pIndexWin->Show();
pTextWin = VclPtr<SfxHelpTextWindow_Impl>::Create( this );
Reference < XFrames > xFrames = rFrame->getFrames();
diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx
index 29e6eaf28d6a..94c412faa17b 100644
--- a/sfx2/source/control/ctrlitem.cxx
+++ b/sfx2/source/control/ctrlitem.cxx
@@ -341,7 +341,7 @@ MapUnit SfxControllerItem::GetCoreMetric() const
}
SAL_INFO( "sfx.control", "W1: Can not find ItemPool!" );
- return MAP_100TH_MM;
+ return MapUnit::Map100thMM;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 9aee901870cd..34619467da70 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -2135,7 +2135,7 @@ SfxItemState SfxDispatcher::QueryState( sal_uInt16 nSID, css::uno::Any& rAny )
sal_uInt16 nSubId( 0 );
SfxItemPool& rPool = pShell->GetPool();
sal_uInt16 nWhich = rPool.GetWhich( nSID );
- if ( rPool.GetMetric( nWhich ) == MAP_TWIP )
+ if ( rPool.GetMetric( nWhich ) == MapUnit::MapTwip )
nSubId |= CONVERT_TWIPS;
pItem->QueryValue( aState, (sal_uInt8)nSubId );
}
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 49d9c40a1858..4deb98744156 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -665,7 +665,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const css::util::URL& aURL,
bool bSuccess = false;
const SfxPoolItem* pItem = nullptr;
- MapUnit eMapUnit( MAP_100TH_MM );
+ MapUnit eMapUnit( MapUnit::Map100thMM );
// Extra scope so that aInternalSet is destroyed before
// rListener->dispatchFinished potentially calls
@@ -775,7 +775,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const css::util::URL& aURL,
if ( bSuccess && pItem && dynamic_cast< const SfxVoidItem *>( pItem ) == nullptr )
{
sal_uInt16 nSubId( 0 );
- if ( eMapUnit == MAP_TWIP )
+ if ( eMapUnit == MapUnit::MapTwip )
nSubId |= CONVERT_TWIPS;
pItem->QueryValue( aEvent.Result, (sal_uInt8)nSubId );
}
@@ -892,7 +892,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
{
// Retrieve metric from pool to have correct sub ID when calling QueryValue
sal_uInt16 nSubId( 0 );
- MapUnit eMapUnit( MAP_100TH_MM );
+ MapUnit eMapUnit( MapUnit::Map100thMM );
// retrieve the core metric
// it's enough to check the objectshell, the only shell that does not use the pool of the document
@@ -906,7 +906,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
eMapUnit = GetCoreMetric( pShell->GetPool(), nSID );
}
- if ( eMapUnit == MAP_TWIP )
+ if ( eMapUnit == MapUnit::MapTwip )
nSubId |= CONVERT_TWIPS;
pState->QueryValue( aState, (sal_uInt8)nSubId );
diff --git a/sfx2/source/dialog/dialoghelper.cxx b/sfx2/source/dialog/dialoghelper.cxx
index fe0044eb91cf..a5657d8b9e6a 100644
--- a/sfx2/source/dialog/dialoghelper.cxx
+++ b/sfx2/source/dialog/dialoghelper.cxx
@@ -55,22 +55,22 @@ void setPreviewsToSamePlace(vcl::Window *pParent, VclBuilderContainer *pPage)
Size getParagraphPreviewOptimalSize(const vcl::Window *pReference)
{
- return pReference->LogicToPixel(Size(68 , 112), MAP_APPFONT);
+ return pReference->LogicToPixel(Size(68 , 112), MapUnit::MapAppFont);
}
Size getDrawPreviewOptimalSize(const vcl::Window *pReference)
{
- return pReference->LogicToPixel(Size(88, 42), MAP_APPFONT);
+ return pReference->LogicToPixel(Size(88, 42), MapUnit::MapAppFont);
}
Size getPreviewStripSize(const vcl::Window *pReference)
{
- return pReference->LogicToPixel(Size(70 , 40), MapMode(MAP_APPFONT));
+ return pReference->LogicToPixel(Size(70 , 40), MapMode(MapUnit::MapAppFont));
}
Size getPreviewOptionsSize(const vcl::Window *pReference)
{
- return pReference->LogicToPixel(Size(70 , 27), MapMode(MAP_APPFONT));
+ return pReference->LogicToPixel(Size(70 , 27), MapMode(MapUnit::MapAppFont));
}
OUString getWidestTime(const LocaleDataWrapper& rWrapper)
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 6164b5edbb83..3d28a70c59ce 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1387,7 +1387,7 @@ IMPL_LINK_NOARG(CustomPropertiesEditButton, ClickHdl, Button*, void)
void CustomPropertiesYesNoButton::Resize()
{
const long nWidth = GetSizePixel().Width();
- const long n3Width = LogicToPixel( Size( 3, 3 ), MAP_APPFONT ).Width();
+ const long n3Width = LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ).Width();
const long nNewWidth = ( nWidth / 2 ) - n3Width - 2;
Size aSize = m_aYesButton->GetSizePixel();
const long nDelta = aSize.Width() - nNewWidth;
@@ -1461,14 +1461,14 @@ CustomPropertiesWindow::CustomPropertiesWindow(vcl::Window* pParent,
m_aNumberFormatter( ::comphelper::getProcessComponentContext(),
Application::GetSettings().GetLanguageTag().getLanguageType() )
{
- Point aPos(LogicToPixel(Point(159, 2), MAP_APPFONT));
+ Point aPos(LogicToPixel(Point(159, 2), MapUnit::MapAppFont));
m_aEditButton->SetPosSizePixel(aPos,
- LogicToPixel(Size(RSC_CD_TEXTBOX_HEIGHT, RSC_CD_TEXTBOX_HEIGHT), MAP_APPFONT));
+ LogicToPixel(Size(RSC_CD_TEXTBOX_HEIGHT, RSC_CD_TEXTBOX_HEIGHT), MapUnit::MapAppFont));
- m_aRemoveButton->SetSizePixel(LogicToPixel(Size(RSC_CD_PUSHBUTTON_HEIGHT, RSC_CD_PUSHBUTTON_HEIGHT), MAP_APPFONT));
+ m_aRemoveButton->SetSizePixel(LogicToPixel(Size(RSC_CD_PUSHBUTTON_HEIGHT, RSC_CD_PUSHBUTTON_HEIGHT), MapUnit::MapAppFont));
- Size aSize(LogicToPixel(Size(61, RSC_CD_TEXTBOX_HEIGHT), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(61, RSC_CD_TEXTBOX_HEIGHT), MapUnit::MapAppFont));
m_aValueEdit->SetPosSizePixel(aPos, aSize);
m_aDurationField->SetPosSizePixel(aPos, aSize);
m_aDateField->SetPosSizePixel(aPos, aSize);
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 6c8a29f9069c..978cf37ff0c8 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -311,7 +311,7 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl()
*/
{
- MapUnit eUnit = MAP_CM;
+ MapUnit eUnit = MapUnit::MapCM;
FieldUnit eFieldUnit( FUNIT_CM );
SfxModule* pModule = SfxModule::GetActiveModule();
if ( pModule )
@@ -323,15 +323,15 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl()
switch ( eFieldUnit )
{
- case FUNIT_MM: eUnit = MAP_MM; break;
+ case FUNIT_MM: eUnit = MapUnit::MapMM; break;
case FUNIT_CM:
case FUNIT_M:
- case FUNIT_KM: eUnit = MAP_CM; break;
+ case FUNIT_KM: eUnit = MapUnit::MapCM; break;
case FUNIT_POINT:
- case FUNIT_PICA: eUnit = MAP_POINT; break;
+ case FUNIT_PICA: eUnit = MapUnit::MapPoint; break;
case FUNIT_INCH:
case FUNIT_FOOT:
- case FUNIT_MILE: eUnit = MAP_INCH; break;
+ case FUNIT_MILE: eUnit = MapUnit::MapInch; break;
default:
OSL_FAIL( "non supported field unit" );
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index cb4dd57062a0..1044c61861a9 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -188,7 +188,7 @@ void SfxVersionsTabListBox_Impl::setColSizes()
long aStaticTabs[] = { 3, 0, 0, 0 };
aStaticTabs[2] = nMax;
aStaticTabs[3] = nMax + nMaxAuthorWidth;
- SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL);
+ SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
}
SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersionOnClose )
@@ -207,7 +207,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersion
SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("versions");
Size aControlSize(260, 114);
- aControlSize = pContainer->LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = pContainer->LogicToPixel(aControlSize, MapUnit::MapAppFont);
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(aControlSize.Height());
@@ -540,7 +540,7 @@ SfxCmisVersionsDialog::SfxCmisVersionsDialog ( SfxViewFrame* pVwFrame )
SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("versions");
Size aControlSize(260, 114);
- aControlSize = pContainer->LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = pContainer->LogicToPixel(aControlSize, MapUnit::MapAppFont);
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(aControlSize.Height());
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index ac9999a95437..ba871c15a84c 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -142,7 +142,7 @@ void* GraphicHelper::getWinMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta, co
pMF->mm = MM_ANISOTROPIC;
MapMode aMetaMode = pGDIMeta->GetPrefMapMode();
- MapMode aWinMode( MAP_100TH_MM );
+ MapMode aWinMode( MapUnit::Map100thMM );
if ( aWinMode == pGDIMeta->GetPrefMapMode() )
{
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index 085421d81cf4..0a7f60b219e0 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -62,7 +62,7 @@ void SfxPreviewBase_Impl::Resize()
Size SfxPreviewBase_Impl::GetOptimalSize() const
{
- return LogicToPixel(Size(127, 129), MAP_APPFONT);
+ return LogicToPixel(Size(127, 129), MapUnit::MapAppFont);
}
void SfxPreviewWin_Impl::ImpPaint(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/, GDIMetaFile* pFile)
@@ -350,7 +350,7 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl(
pAntiImplP->get(m_pRegionLb, "categories");
pAntiImplP->get(m_pTemplateLb, "templates");
- Size aSize(m_pRegionLb->LogicToPixel(Size(127, 72), MAP_APPFONT));
+ Size aSize(m_pRegionLb->LogicToPixel(Size(127, 72), MapUnit::MapAppFont));
m_pRegionLb->set_width_request(aSize.Width());
m_pRegionLb->set_height_request(aSize.Height());
m_pTemplateLb->set_width_request(aSize.Width());
diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx
index 66a30a052029..e190f3a05760 100644
--- a/sfx2/source/doc/objembed.cxx
+++ b/sfx2/source/doc/objembed.cxx
@@ -100,7 +100,7 @@ Rectangle SfxObjectShell::GetVisArea( sal_uInt16 nAspect ) const
{
Rectangle aRect;
aRect.SetSize( OutputDevice::LogicToLogic( Size( 5000, 5000 ),
- MAP_100TH_MM, GetMapUnit() ) );
+ MapUnit::Map100thMM, GetMapUnit() ) );
return aRect;
}
return Rectangle();
@@ -162,7 +162,7 @@ void SfxObjectShell::FillTransferableObjectDescriptor( TransferableObjectDescrip
rDesc.mnViewAspect = ASPECT_CONTENT;
rDesc.mnOle2Misc = GetMiscStatus();
- rDesc.maSize = OutputDevice::LogicToLogic( GetVisArea().GetSize(), GetMapUnit(), MAP_100TH_MM );
+ rDesc.maSize = OutputDevice::LogicToLogic( GetVisArea().GetSize(), GetMapUnit(), MapUnit::Map100thMM );
rDesc.maDragStartPos = Point();
rDesc.maDisplayName.clear();
}
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index c68e2dcc83ef..9150ef6b0645 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -254,7 +254,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,bDisposing( false )
,m_bEnableSetModified( true )
,m_bIsModified( false )
- ,m_nMapUnit( MAP_100TH_MM )
+ ,m_nMapUnit( MapUnit::Map100thMM )
,m_bCreateTempStor( false )
,m_bIsInit( false )
,m_bIncomplEncrWarnShown( false )
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index a54bc2dfa863..29c9458acf8b 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -436,7 +436,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
{
// Bug 56929 - MapMode of 100mm which recalculated when
// the device is set. Additionally only set if they were really changed.
- aSetPaperSize = pPrinter->LogicToPixel( aSetPaperSize, MAP_100TH_MM );
+ aSetPaperSize = pPrinter->LogicToPixel( aSetPaperSize, MapUnit::Map100thMM );
if( aSetPaperSize != pPrinter->GetPaperSizePixel() )
{
pPrinter->SetPaperSizeUser( pPrinter->PixelToLogic( aSetPaperSize ) );
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index a08c3543017b..a4c1c25f424d 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -892,7 +892,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const OUString&
if ( ( aArgs.get( "WinExtent" ) >>= aWinExtent )&& ( aWinExtent.getLength() == 4 ) )
{
Rectangle aVisArea( aWinExtent[0], aWinExtent[1], aWinExtent[2], aWinExtent[3] );
- aVisArea = OutputDevice::LogicToLogic( aVisArea, MAP_100TH_MM, pObjectShell->GetMapUnit() );
+ aVisArea = OutputDevice::LogicToLogic( aVisArea, MapUnit::Map100thMM, pObjectShell->GetMapUnit() );
pObjectShell->SetVisArea( aVisArea );
}
@@ -983,7 +983,7 @@ Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(RuntimeE
// We can store it now to overwrite an old value
// since it is not from ItemSet
Rectangle aTmpRect = m_pData->m_pObjectShell->GetVisArea( ASPECT_CONTENT );
- aTmpRect = OutputDevice::LogicToLogic( aTmpRect, m_pData->m_pObjectShell->GetMapUnit(), MAP_100TH_MM );
+ aTmpRect = OutputDevice::LogicToLogic( aTmpRect, m_pData->m_pObjectShell->GetMapUnit(), MapUnit::Map100thMM );
Sequence< sal_Int32 > aRectSeq(4);
aRectSeq[0] = aTmpRect.Left();
@@ -1950,7 +1950,7 @@ Any SAL_CALL SfxBaseModel::getTransferData( const datatransfer::DataFlavor& aFla
Size aSize = m_pData->m_pObjectShell->GetVisArea().GetSize();
MapUnit aMapUnit = m_pData->m_pObjectShell->GetMapUnit();
- aDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM );
+ aDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MapUnit::Map100thMM );
aDesc.maDragStartPos = Point();
aDesc.maDisplayName.clear();
diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx b/sfx2/source/sidebar/SidebarChildWindow.cxx
index 8c3b7387b893..bdc9aa102d92 100644
--- a/sfx2/source/sidebar/SidebarChildWindow.cxx
+++ b/sfx2/source/sidebar/SidebarChildWindow.cxx
@@ -71,7 +71,7 @@ sal_Int32 SidebarChildWindow::GetDefaultWidth (vcl::Window* pWindow)
// Width of the paragraph panel.
const static sal_Int32 nMaxPropertyPageWidth (115);
- return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MAP_APPFONT).X()
+ return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MapUnit::MapAppFont).X()
+ TabBar::GetDefaultWidth() * pWindow->GetDPIScaleFactor();
}
else
diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx
index 01ada5970bbb..78b2b0dc2dc0 100644
--- a/sfx2/source/view/classificationcontroller.cxx
+++ b/sfx2/source/view/classificationcontroller.cxx
@@ -341,7 +341,7 @@ void ClassificationControl::SetOptimalSize()
{
// Same as SvxColorDockingWindow.
const Size aLogicalAttrSize(150 * m_pLabels.size(), 0);
- Size aSize(LogicToPixel(aLogicalAttrSize,MAP_APPFONT));
+ Size aSize(LogicToPixel(aLogicalAttrSize,MapUnit::MapAppFont));
auto& pLabel = m_pLabels[SfxClassificationPolicyType::IntellectualProperty];
auto& pCategories = m_pCategories[SfxClassificationPolicyType::IntellectualProperty];
diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx
index c7f8cd934582..61c2b4a4413f 100644
--- a/slideshow/source/engine/rehearsetimingsactivity.cxx
+++ b/slideshow/source/engine/rehearsetimingsactivity.cxx
@@ -161,7 +161,7 @@ RehearseTimingsActivity::RehearseTimingsActivity( const SlideShowContext& rConte
ScopedVclPtrInstance< VirtualDevice > blackHole;
blackHole->EnableOutput(false);
blackHole->SetFont( maFont );
- blackHole->SetMapMode( MAP_PIXEL );
+ blackHole->SetMapMode( MapUnit::MapPixel );
Rectangle rect;
const FontMetric metric( blackHole->GetFontMetric() );
blackHole->GetTextBoundRect( rect, "XX:XX:XX" );
@@ -440,7 +440,7 @@ void RehearseTimingsActivity::paint( cppcanvas::CanvasSharedPtr const & canvas )
metaFile.Record( blackHole );
metaFile.SetPrefSize( Size( 1, 1 ) );
blackHole->EnableOutput(false);
- blackHole->SetMapMode( MAP_PIXEL );
+ blackHole->SetMapMode( MapUnit::MapPixel );
blackHole->SetFont( maFont );
Rectangle rect = Rectangle( 0,0,
maSpriteSizePixel.getX(),
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 1f4ef1f39c08..fe517fbc5e11 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -229,7 +229,7 @@ SmElementsControl::SmElementsControl(vcl::Window *pParent)
, mxScroll(VclPtr<ScrollBar>::Create(this, WB_VERT))
{
set_id("element_selector");
- SetMapMode( MapMode(MAP_100TH_MM) );
+ SetMapMode( MapMode(MapUnit::Map100thMM) );
SetDrawMode( DrawModeFlags::Default );
SetLayoutMode( ComplexTextLayoutFlags::Default );
SetDigitLanguage( LANGUAGE_ENGLISH );
@@ -515,7 +515,7 @@ void SmElementsControl::addElement(const OUString& aElementVisual, const OUStrin
pNode->SetSize(Fraction(10,8));
pNode->Arrange(*this, maFormat);
- Size aSizePixel = LogicToPixel(Size(pNode->GetWidth(), pNode->GetHeight()), MAP_100TH_MM);
+ Size aSizePixel = LogicToPixel(Size(pNode->GetWidth(), pNode->GetHeight()), MapUnit::Map100thMM);
if (aSizePixel.Width() > maMaxElementDimensions.Width()) {
maMaxElementDimensions.Width() = aSizePixel.Width();
}
@@ -682,7 +682,7 @@ void SmElementsControl::build()
Size SmElementsControl::GetOptimalSize() const
{
- return LogicToPixel(Size(100, 100), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(100, 100), MapMode(MapUnit::MapAppFont));
}
FactoryFunction SmElementsControl::GetUITestFactory() const
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 5883f3c594df..fece32e4c63c 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -1268,7 +1268,7 @@ Rectangle SmTextForwarder::GetParaBounds( sal_Int32 nPara ) const
MapMode SmTextForwarder::GetMapMode() const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
- return pEditEngine ? pEditEngine->GetRefMapMode() : MapMode( MAP_100TH_MM );
+ return pEditEngine ? pEditEngine->GetRefMapMode() : MapMode( MapUnit::Map100thMM );
}
OutputDevice* SmTextForwarder::GetRefDevice() const
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 73bc61fb074f..a1a15aefa285 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -290,7 +290,7 @@ VCL_BUILDER_DECL_FACTORY(SmShowFont)
Size SmShowFont::GetOptimalSize() const
{
- return LogicToPixel(Size(111 , 31), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(111 , 31), MapMode(MapUnit::MapAppFont));
}
void SmShowFont::SetFont(const vcl::Font& rFont)
@@ -1132,7 +1132,7 @@ void SmShowSymbolSetWindow::Paint(vcl::RenderContext& rRenderContext, const Rect
rRenderContext.Push(PushFlags::MAPMODE);
// set MapUnit for which 'nLen' has been calculated
- rRenderContext.SetMapMode(MapMode(MAP_PIXEL));
+ rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel));
sal_uInt16 v = sal::static_int_cast< sal_uInt16 >((m_pVScrollBar->GetThumbPos() * nColumns));
size_t nSymbols = aSymbolSet.size();
@@ -1278,7 +1278,7 @@ VCL_BUILDER_FACTORY(SmShowSymbolSet)
void SmShowSymbolSetWindow::calccols()
{
// Height of 16pt in pixels (matching 'aOutputSize')
- nLen = LogicToPixel(Size(0, 16), MapMode(MAP_POINT)).Height();
+ nLen = LogicToPixel(Size(0, 16), MapMode(MapUnit::MapPoint)).Height();
Size aOutputSize = GetOutputSizePixel();
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 1af687b4ce21..deb7d1514003 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -262,10 +262,10 @@ void SmDocShell::ArrangeFormula()
else
{
pOutDev = &SM_MOD()->GetDefaultVirtualDev();
- pOutDev->SetMapMode( MapMode(MAP_100TH_MM) );
+ pOutDev->SetMapMode( MapMode(MapUnit::Map100thMM) );
}
}
- OSL_ENSURE(pOutDev->GetMapMode().GetMapUnit() == MAP_100TH_MM,
+ OSL_ENSURE(pOutDev->GetMapMode().GetMapUnit() == MapUnit::Map100thMM,
"Sm : falscher MapMode");
const SmFormat &rFormat = GetFormat();
@@ -334,7 +334,7 @@ void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool)
// set font heights
SvxFontHeightItem aFontHeigt(
Application::GetDefaultDevice()->LogicToPixel(
- Size( 0, 11 ), MapMode( MAP_POINT ) ).Height(), 100,
+ Size( 0, 11 ), MapMode( MapUnit::MapPoint ) ).Height(), 100,
EE_CHAR_FONTHEIGHT );
rEditEngineItemPool.SetPoolDefaultItem( aFontHeigt );
aFontHeigt.SetWhich( EE_CHAR_FONTHEIGHT_CJK );
@@ -368,7 +368,7 @@ EditEngine& SmDocShell::GetEditEngine()
EEControlBits(~EEControlBits::PASTESPECIAL) );
mpEditEngine->SetWordDelimiters(" .=+-*/(){}[];\"");
- mpEditEngine->SetRefMapMode( MAP_PIXEL );
+ mpEditEngine->SetRefMapMode( MapUnit::MapPixel );
mpEditEngine->SetPaperSize( Size( 800, 0 ) );
@@ -507,13 +507,13 @@ SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell )
//!this class.
const MapUnit eOld = pPrinter->GetMapMode().GetMapUnit();
- if ( MAP_100TH_MM != eOld )
+ if ( MapUnit::Map100thMM != eOld )
{
MapMode aMap( pPrinter->GetMapMode() );
- aMap.SetMapUnit( MAP_100TH_MM );
+ aMap.SetMapUnit( MapUnit::Map100thMM );
Point aTmp( aMap.GetOrigin() );
- aTmp.X() = OutputDevice::LogicToLogic( aTmp.X(), eOld, MAP_100TH_MM );
- aTmp.Y() = OutputDevice::LogicToLogic( aTmp.Y(), eOld, MAP_100TH_MM );
+ aTmp.X() = OutputDevice::LogicToLogic( aTmp.X(), eOld, MapUnit::Map100thMM );
+ aTmp.Y() = OutputDevice::LogicToLogic( aTmp.Y(), eOld, MapUnit::Map100thMM );
aMap.SetOrigin( aTmp );
pPrinter->SetMapMode( aMap );
}
@@ -532,13 +532,13 @@ SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell )
//!this class.
const MapUnit eOld = pRefDev->GetMapMode().GetMapUnit();
- if ( MAP_100TH_MM != eOld )
+ if ( MapUnit::Map100thMM != eOld )
{
MapMode aMap( pRefDev->GetMapMode() );
- aMap.SetMapUnit( MAP_100TH_MM );
+ aMap.SetMapUnit( MapUnit::Map100thMM );
Point aTmp( aMap.GetOrigin() );
- aTmp.X() = OutputDevice::LogicToLogic( aTmp.X(), eOld, MAP_100TH_MM );
- aTmp.Y() = OutputDevice::LogicToLogic( aTmp.Y(), eOld, MAP_100TH_MM );
+ aTmp.X() = OutputDevice::LogicToLogic( aTmp.X(), eOld, MapUnit::Map100thMM );
+ aTmp.Y() = OutputDevice::LogicToLogic( aTmp.Y(), eOld, MapUnit::Map100thMM );
aMap.SetOrigin( aTmp );
pRefDev->SetMapMode( aMap );
}
@@ -581,7 +581,7 @@ Printer* SmDocShell::GetPrt()
SmModule *pp = SM_MOD();
pp->GetConfig()->ConfigToItemSet(*pOptions);
mpPrinter = VclPtr<SfxPrinter>::Create(pOptions);
- mpPrinter->SetMapMode(MapMode(MAP_100TH_MM));
+ mpPrinter->SetMapMode(MapMode(MapUnit::Map100thMM));
}
return mpPrinter;
}
@@ -602,7 +602,7 @@ void SmDocShell::SetPrinter( SfxPrinter *pNew )
{
mpPrinter.disposeAndClear();
mpPrinter = pNew; //Transfer ownership
- mpPrinter->SetMapMode( MapMode(MAP_100TH_MM) );
+ mpPrinter->SetMapMode( MapMode(MapUnit::Map100thMM) );
SetFormulaArranged(false);
Repaint();
}
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 109ad5ed819a..f13aaf8c6246 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -90,7 +90,7 @@ SmEditWindow::SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ) :
{
set_id("math_edit");
SetHelpId(HID_SMA_COMMAND_WIN_EDIT);
- SetMapMode(MAP_PIXEL);
+ SetMapMode(MapUnit::MapPixel);
// Even RTL languages don't use RTL for math
EnableRTL( false );
diff --git a/starmath/source/tmpdevice.cxx b/starmath/source/tmpdevice.cxx
index b6232bd3a013..ca0ee8f8b356 100644
--- a/starmath/source/tmpdevice.cxx
+++ b/starmath/source/tmpdevice.cxx
@@ -35,10 +35,10 @@ SmTmpDevice::SmTmpDevice(OutputDevice &rTheDev, bool bUseMap100th_mm) :
{
rOutDev.Push( PushFlags::FONT | PushFlags::MAPMODE |
PushFlags::LINECOLOR | PushFlags::FILLCOLOR | PushFlags::TEXTCOLOR );
- if (bUseMap100th_mm && MAP_100TH_MM != rOutDev.GetMapMode().GetMapUnit())
+ if (bUseMap100th_mm && MapUnit::Map100thMM != rOutDev.GetMapMode().GetMapUnit())
{
SAL_WARN("starmath", "incorrect MapMode?");
- rOutDev.SetMapMode( MAP_100TH_MM ); //format for 100% always
+ rOutDev.SetMapMode( MapUnit::Map100thMM ); //format for 100% always
}
}
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index efe052e24983..fdc6f51328f7 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -1003,7 +1003,7 @@ void SAL_CALL SmModel::render(
if (!pOut)
throw RuntimeException();
- pOut->SetMapMode( MAP_100TH_MM );
+ pOut->SetMapMode( MapUnit::Map100thMM );
uno::Reference< frame::XModel > xModel;
rSelection >>= xModel;
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index a2f7fa8b2814..3bd645a314bf 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -104,7 +104,7 @@ SmGraphicWindow::SmGraphicWindow(SmViewShell* pShell)
Hide();
const Fraction aFraction(1, 1);
- SetMapMode(MapMode(MAP_100TH_MM, Point(), aFraction, aFraction));
+ SetMapMode(MapMode(MapUnit::Map100thMM, Point(), aFraction, aFraction));
SetTotalSize();
@@ -584,7 +584,7 @@ void SmGraphicWindow::SetZoom(sal_uInt16 Factor)
{
nZoom = std::min(std::max(Factor, MINZOOM), MAXZOOM);
Fraction aFraction (nZoom, 100);
- SetMapMode( MapMode(MAP_100TH_MM, Point(), aFraction, aFraction) );
+ SetMapMode( MapMode(MapUnit::Map100thMM, Point(), aFraction, aFraction) );
SetTotalSize();
SmViewShell *pViewSh = GetView();
if (pViewSh)
@@ -601,7 +601,7 @@ void SmGraphicWindow::ZoomToFitInWindow()
SmDocShell &rDoc = *pViewShell->GetDoc();
// set defined mapmode before calling 'LogicToPixel' below
- SetMapMode(MapMode(MAP_100TH_MM));
+ SetMapMode(MapMode(MapUnit::Map100thMM));
Size aSize (LogicToPixel(rDoc.GetSize()));
Size aWindowSize (GetSizePixel());
@@ -675,7 +675,7 @@ SmCmdBoxWindow::SmCmdBoxWindow(SfxBindings *pBindings_, SfxChildWindow *pChildWi
bExiting (false)
{
SetHelpId( HID_SMA_COMMAND_WIN );
- SetSizePixel(LogicToPixel(Size(292 , 94), MapMode(MAP_APPFONT)));
+ SetSizePixel(LogicToPixel(Size(292 , 94), MapMode(MapUnit::MapAppFont)));
SetText(SM_RESSTR(STR_CMDBOXWINDOW));
Hide();
@@ -896,7 +896,7 @@ void SmViewShell::InnerResizePixel(const Point &rOfs, const Size &rSize)
Size aObjSize = GetObjectShell()->GetVisArea().GetSize();
if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 )
{
- Size aProvidedSize = GetWindow()->PixelToLogic( rSize, MAP_100TH_MM );
+ Size aProvidedSize = GetWindow()->PixelToLogic( rSize, MapUnit::Map100thMM );
SfxViewShell::SetZoomFactor( Fraction( aProvidedSize.Width(), aObjSize.Width() ),
Fraction( aProvidedSize.Height(), aObjSize.Height() ) );
}
@@ -1198,44 +1198,44 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri
switch (ePrintSize)
{
case PRINT_SIZE_NORMAL:
- OutputMapMode = MapMode(MAP_100TH_MM);
+ OutputMapMode = MapMode(MapUnit::Map100thMM);
break;
case PRINT_SIZE_SCALED:
if ((aSize.Width() > 0) && (aSize.Height() > 0))
{
Size OutputSize (rOutDev.LogicToPixel(Size(aOutRect.GetWidth(),
- aOutRect.GetHeight()), MapMode(MAP_100TH_MM)));
- Size GraphicSize (rOutDev.LogicToPixel(aSize, MapMode(MAP_100TH_MM)));
+ aOutRect.GetHeight()), MapMode(MapUnit::Map100thMM)));
+ Size GraphicSize (rOutDev.LogicToPixel(aSize, MapMode(MapUnit::Map100thMM)));
sal_uInt16 nZ = sal::static_int_cast<sal_uInt16>(std::min(long(Fraction(OutputSize.Width() * 100L, GraphicSize.Width())),
long(Fraction(OutputSize.Height() * 100L, GraphicSize.Height()))));
nZ -= 10;
Fraction aFraction (std::max(MINZOOM, std::min(MAXZOOM, nZ)), 100);
- OutputMapMode = MapMode(MAP_100TH_MM, aZeroPoint, aFraction, aFraction);
+ OutputMapMode = MapMode(MapUnit::Map100thMM, aZeroPoint, aFraction, aFraction);
}
else
- OutputMapMode = MapMode(MAP_100TH_MM);
+ OutputMapMode = MapMode(MapUnit::Map100thMM);
break;
case PRINT_SIZE_ZOOMED:
{
Fraction aFraction( nZoomFactor, 100 );
- OutputMapMode = MapMode(MAP_100TH_MM, aZeroPoint, aFraction, aFraction);
+ OutputMapMode = MapMode(MapUnit::Map100thMM, aZeroPoint, aFraction, aFraction);
break;
}
}
aSize = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aSize, OutputMapMode),
- MapMode(MAP_100TH_MM));
+ MapMode(MapUnit::Map100thMM));
Point aPos (aOutRect.Left() + (aOutRect.GetWidth() - aSize.Width()) / 2,
aOutRect.Top() + (aOutRect.GetHeight() - aSize.Height()) / 2);
- aPos = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aPos, MapMode(MAP_100TH_MM)),
+ aPos = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aPos, MapMode(MapUnit::Map100thMM)),
OutputMapMode);
- aOutRect = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aOutRect, MapMode(MAP_100TH_MM)),
+ aOutRect = rOutDev.PixelToLogic(rOutDev.LogicToPixel(aOutRect, MapMode(MapUnit::Map100thMM)),
OutputMapMode);
rOutDev.SetMapMode(OutputMapMode);
@@ -1760,7 +1760,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
case SvxZoomType::PAGEWIDTH:
case SvxZoomType::WHOLEPAGE:
{
- const MapMode aMap( MAP_100TH_MM );
+ const MapMode aMap( MapUnit::Map100thMM );
SfxPrinter *pPrinter = GetPrinter( true );
Point aPoint;
Rectangle OutputRect(aPoint, pPrinter->GetOutputSize());
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index 75ba7334079c..b1cf78f8e15b 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -138,7 +138,7 @@ struct SfxItemPool_Impl
, nStoringEnd(0)
, nMajorVer(0)
, nMinorVer(0)
- , eDefMetric(MAP_CM)
+ , eDefMetric(MapUnit::MapCM)
, bInSetItem(false)
, bStreaming(false)
, mbPersistentRefCounts(false)
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 3fc63112f6be..891fa316c73e 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -176,7 +176,7 @@ SfxItemPool::SfxItemPool
pItemInfos(pInfo),
pImpl( new SfxItemPool_Impl( this, rName, nStartWhich, nEndWhich ) )
{
- pImpl->eDefMetric = MAP_TWIP;
+ pImpl->eDefMetric = MapUnit::MapTwip;
pImpl->nVersion = 0;
pImpl->bStreaming = false;
pImpl->nLoadingVersion = 0;
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index d6bfea432055..0032ac6c5ad0 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -195,7 +195,7 @@ void SfxPoolItem::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("typeName"), BAD_CAST(typeid(*this).name()));
OUString rText;
- if (GetPresentation( SfxItemPresentation::Complete, MAP_100TH_MM, MAP_100TH_MM, rText))
+ if (GetPresentation( SfxItemPresentation::Complete, MapUnit::Map100thMM, MapUnit::Map100thMM, rText))
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(rText.getStr()));
xmlTextWriterEndElement(pWriter);
}
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index dc22ff3a391d..cfc4ab9b6320 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -682,8 +682,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
// (as it is based on the settings of our data window, not the foreign device)
if (!nDataRowHeight)
ImpGetDataRowHeight();
- long nHeightLogic = PixelToLogic(Size(0, nDataRowHeight), MAP_10TH_MM).Height();
- long nForeignHeightPixel = pDev->LogicToPixel(Size(0, nHeightLogic), MAP_10TH_MM).Height();
+ long nHeightLogic = PixelToLogic(Size(0, nDataRowHeight), MapUnit::Map10thMM).Height();
+ long nForeignHeightPixel = pDev->LogicToPixel(Size(0, nHeightLogic), MapUnit::Map10thMM).Height();
long nOriginalHeight = nDataRowHeight;
nDataRowHeight = nForeignHeightPixel;
@@ -694,8 +694,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
{
BrowserColumn* pCurrent = (*pCols)[ nPos ];
- long nWidthLogic = PixelToLogic(Size(pCurrent->Width(), 0), MAP_10TH_MM).Width();
- long nForeignWidthPixel = pDev->LogicToPixel(Size(nWidthLogic, 0), MAP_10TH_MM).Width();
+ long nWidthLogic = PixelToLogic(Size(pCurrent->Width(), 0), MapUnit::Map10thMM).Width();
+ long nForeignWidthPixel = pDev->LogicToPixel(Size(nWidthLogic, 0), MapUnit::Map10thMM).Width();
pCurrent->SetWidth(nForeignWidthPixel, GetZoom());
if ( pBar )
@@ -712,8 +712,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
if ( pBar )
{
// the title height with respect to the font set for the given device
- long nTitleHeight = PixelToLogic(Size(0, GetTitleHeight()), MAP_10TH_MM).Height();
- nTitleHeight = pDev->LogicToPixel(Size(0, nTitleHeight), MAP_10TH_MM).Height();
+ long nTitleHeight = PixelToLogic(Size(0, GetTitleHeight()), MapUnit::Map10thMM).Height();
+ nTitleHeight = pDev->LogicToPixel(Size(0, nTitleHeight), MapUnit::Map10thMM).Height();
BrowserColumn* pFirstCol = !pCols->empty() ? (*pCols)[ 0 ] : nullptr;
@@ -773,8 +773,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
{
BrowserColumn* pCurrent = (*pCols)[ nPos ];
- long nForeignWidthLogic = pDev->PixelToLogic(Size(pCurrent->Width(), 0), MAP_10TH_MM).Width();
- long nWidthPixel = LogicToPixel(Size(nForeignWidthLogic, 0), MAP_10TH_MM).Width();
+ long nForeignWidthLogic = pDev->PixelToLogic(Size(pCurrent->Width(), 0), MapUnit::Map10thMM).Width();
+ long nWidthPixel = LogicToPixel(Size(nForeignWidthLogic, 0), MapUnit::Map10thMM).Width();
pCurrent->SetWidth(nWidthPixel, GetZoom());
if ( pBar )
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 82df75ef8f51..b97d2c126ef6 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -495,14 +495,14 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( vcl::Window* pParentWin,
if (nFlags & FileViewFlags::SHOW_ONLYTITLE)
{
long pTabs[] = { 2, 20, 600 };
- SetTabs(&pTabs[0], MAP_PIXEL);
+ SetTabs(&pTabs[0], MapUnit::MapPixel);
mpHeaderBar->InsertItem(COLUMN_TITLE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_TITLE), 600, nBits | HeaderBarItemBits::UPARROW);
}
else
{
long pTabs[] = { 5, 20, 180, 320, 400, 600 };
- SetTabs(&pTabs[0], MAP_PIXEL);
+ SetTabs(&pTabs[0], MapUnit::MapPixel);
SetTabJustify(2, AdjustRight); // column "Size"
mpHeaderBar->InsertItem(COLUMN_TITLE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_TITLE), 180, nBits | HeaderBarItemBits::UPARROW);
@@ -1012,7 +1012,7 @@ VCL_BUILDER_DECL_FACTORY(SvtFileView)
Size SvtFileView::GetOptimalSize() const
{
- return LogicToPixel(Size(208, 50), MAP_APPFONT);
+ return LogicToPixel(Size(208, 50), MapUnit::MapAppFont);
}
void SvtFileView::SetViewMode( FileViewMode eMode )
@@ -1313,7 +1313,7 @@ IMPL_LINK( SvtFileView, HeaderEndDrag_Impl, HeaderBar*, pBar, void )
long nWidth = pBar->GetItemSize(i);
aSize.Width() = nWidth + nTmpSize;
nTmpSize += nWidth;
- mpImpl->mpView->SetTab( i, aSize.Width(), MAP_PIXEL );
+ mpImpl->mpView->SetTab( i, aSize.Width(), MapUnit::MapPixel );
}
}
}
diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx
index ef479e626c5f..0652388e3679 100644
--- a/svtools/source/contnr/simptabl.cxx
+++ b/svtools/source/contnr/simptabl.cxx
@@ -382,7 +382,7 @@ void SvSimpleTable::HBarEndDrag()
for(sal_uInt16 i=1;i<nPrivTabCount;i++)
{
nNewSize = static_cast< sal_uInt16 >( aHeaderBar->GetItemSize(i) ) + nPos;
- SetTab( i, nNewSize, MAP_PIXEL );
+ SetTab( i, nNewSize, MapUnit::MapPixel );
nPos = nNewSize;
}
}
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index e33e31a5e421..4b07b1270426 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -132,7 +132,7 @@ void SvTabListBox::SetTabs(const long* pTabs, MapUnit eMapUnit)
nTabCount = nCount;
MapMode aMMSource( eMapUnit );
- MapMode aMMDest( MAP_PIXEL );
+ MapMode aMMDest( MapUnit::MapPixel );
pTabs++;
for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++, pTabs++ )
@@ -155,7 +155,7 @@ void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit )
{
DBG_ASSERT(pTabList,"TabList?");
MapMode aMMSource( eMapUnit );
- MapMode aMMDest( MAP_PIXEL );
+ MapMode aMMDest( MapUnit::MapPixel );
Size aSize( nValue, 0 );
aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
nValue = aSize.Width();
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 20fdb89c9eaf..cb190b4af2a7 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -517,7 +517,7 @@ void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, lo
basegfx::B2DPolyPolygon aPolygons = svtools::ApplyLineDashing(rPolygon, nDashing, nPix);
// Handle problems of width 1px in Pixel mode: 0.5px gives a 1px line
- if (rDev.GetMapMode().GetMapUnit() == MAP_PIXEL && nWidth == nPix)
+ if (rDev.GetMapMode().GetMapUnit() == MapUnit::MapPixel && nWidth == nPix)
nWidth = 0;
for ( sal_uInt32 i = 0; i < aPolygons.count( ); i++ )
@@ -717,7 +717,7 @@ void LineListBox::ImplInit()
eSourceUnit = FUNIT_POINT;
aVirDev->SetLineColor();
- aVirDev->SetMapMode( MapMode( MAP_TWIP ) );
+ aVirDev->SetMapMode( MapMode( MapUnit::MapTwip ) );
UpdatePaintLineColor();
}
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index a196e0a3ad8d..974af100fa7c 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -747,7 +747,7 @@ const sal_IntPtr* FontList::GetSizeAry( const FontMetric& rInfo ) const
return aStdSizeAry;
MapMode aOldMapMode = pDevice->GetMapMode();
- MapMode aMap( MAP_10TH_INCH, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) );
+ MapMode aMap( MapUnit::Map10thInch, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) );
pDevice->SetMapMode( aMap );
int nRealCount = 0;
diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx
index 640e98da9de0..638159100126 100644
--- a/svtools/source/control/roadmap.cxx
+++ b/svtools/source/control/roadmap.cxx
@@ -189,8 +189,8 @@ public:
void RoadmapImpl::initItemSize()
{
Size aLabelSize( m_rAntiImpl.GetOutputSizePixel() );
- aLabelSize.Height() = m_rAntiImpl.LogicToPixel( Size( 0, LABELBASEMAPHEIGHT ), MAP_APPFONT ).Height();
- aLabelSize.Width() -= m_rAntiImpl.LogicToPixel( Size( 2 * ROADMAP_INDENT_X, 0 ), MAP_APPFONT ).Width();
+ aLabelSize.Height() = m_rAntiImpl.LogicToPixel( Size( 0, LABELBASEMAPHEIGHT ), MapUnit::MapAppFont ).Height();
+ aLabelSize.Width() -= m_rAntiImpl.LogicToPixel( Size( 2 * ROADMAP_INDENT_X, 0 ), MapUnit::MapAppFont ).Width();
m_aItemSizePixel = aLabelSize;
}
@@ -572,7 +572,7 @@ void ORoadmap::Paint(vcl::RenderContext& rRenderContext, const Rectangle& _rRect
void ORoadmap::DrawHeadline(vcl::RenderContext& rRenderContext)
{
- Point aTextPos = LogicToPixel(Point(ROADMAP_INDENT_X, 8), MAP_APPFONT);
+ Point aTextPos = LogicToPixel(Point(ROADMAP_INDENT_X, 8), MapUnit::MapAppFont);
Size aOutputSize(GetOutputSizePixel());
@@ -744,7 +744,7 @@ void RoadmapItem::SetPosition(RoadmapItem* _pOldItem)
Point aIDPos;
if ( _pOldItem == nullptr )
{
- aIDPos = mpID->LogicToPixel( Point( ROADMAP_INDENT_X, ROADMAP_INDENT_Y ), MAP_APPFONT );
+ aIDPos = mpID->LogicToPixel( Point( ROADMAP_INDENT_X, ROADMAP_INDENT_Y ), MapUnit::MapAppFont );
}
else
{
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 7e4dbb9f2bbc..22b752d6f709 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -179,17 +179,17 @@ ImplRulerData& ImplRulerData::operator=( const ImplRulerData& rData )
static const RulerUnitData aImplRulerUnitTab[RULER_UNIT_COUNT] =
{
-{ MAP_100TH_MM, 100, 25.0, 25.0, 50.0, 100.0, " mm" }, // MM
-{ MAP_100TH_MM, 1000, 100.0, 500.0, 1000.0, 1000.0, " cm" }, // CM
-{ MAP_MM, 1000, 10.0, 250.0, 500.0, 1000.0, " m" }, // M
-{ MAP_CM, 100000, 12500.0, 25000.0, 50000.0, 100000.0, " km" }, // KM
-{ MAP_1000TH_INCH, 1000, 62.5, 125.0, 500.0, 1000.0, "\"" }, // INCH
-{ MAP_100TH_INCH, 1200, 120.0, 120.0, 600.0, 1200.0, "'" }, // FOOT
-{ MAP_10TH_INCH, 633600, 63360.0, 63360.0, 316800.0, 633600.0, " miles" }, // MILE
-{ MAP_POINT, 1, 12.0, 12.0, 12.0, 36.0, " pt" }, // POINT
-{ MAP_100TH_MM, 423, 423.0, 423.0, 423.0, 846.0, " pi" }, // PICA
-{ MAP_100TH_MM, 371, 371.0, 371.0, 371.0, 743.0, " ch" }, // CHAR
-{ MAP_100TH_MM, 551, 551.0, 551.0, 551.0, 1102.0, " li" } // LINE
+{ MapUnit::Map100thMM, 100, 25.0, 25.0, 50.0, 100.0, " mm" }, // MM
+{ MapUnit::Map100thMM, 1000, 100.0, 500.0, 1000.0, 1000.0, " cm" }, // CM
+{ MapUnit::MapMM, 1000, 10.0, 250.0, 500.0, 1000.0, " m" }, // M
+{ MapUnit::MapCM, 100000, 12500.0, 25000.0, 50000.0, 100000.0, " km" }, // KM
+{ MapUnit::Map1000thInch, 1000, 62.5, 125.0, 500.0, 1000.0, "\"" }, // INCH
+{ MapUnit::Map100thInch, 1200, 120.0, 120.0, 600.0, 1200.0, "'" }, // FOOT
+{ MapUnit::Map10thInch, 633600, 63360.0, 63360.0, 316800.0, 633600.0, " miles" }, // MILE
+{ MapUnit::MapPoint, 1, 12.0, 12.0, 12.0, 36.0, " pt" }, // POINT
+{ MapUnit::Map100thMM, 423, 423.0, 423.0, 423.0, 846.0, " pi" }, // PICA
+{ MapUnit::Map100thMM, 371, 371.0, 371.0, 371.0, 743.0, " ch" }, // CHAR
+{ MapUnit::Map100thMM, 551, 551.0, 551.0, 551.0, 1102.0, " li" } // LINE
};
static RulerTabData ruler_tab =
@@ -260,7 +260,7 @@ void Ruler::ImplInit( WinBits nWinBits )
mnUnitIndex = RULER_UNIT_CM;
meUnit = FUNIT_CM;
maZoom = Fraction( 1, 1 );
- meSourceUnit = MAP_100TH_MM;
+ meSourceUnit = MapUnit::Map100thMM;
// Recalculate border widths
if ( nWinBits & WB_BORDER )
@@ -289,7 +289,7 @@ void Ruler::ImplInit( WinBits nWinBits )
Ruler::Ruler( vcl::Window* pParent, WinBits nWinStyle ) :
Window( pParent, nWinStyle & WB_3DLOOK ),
maVirDev( VclPtr<VirtualDevice>::Create(*this) ),
- maMapMode( MAP_100TH_MM ),
+ maMapMode( MapUnit::Map100thMM ),
mpSaveData(new ImplRulerData),
mpData(nullptr),
mpDragData(new ImplRulerData)
diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx
index ae3484defafd..84ad86e9ff77 100644
--- a/svtools/source/control/scrwin.cxx
+++ b/svtools/source/control/scrwin.cxx
@@ -230,7 +230,7 @@ void ScrollableWindow::Resize()
// select the shifted map-mode
if ( aPixOffset != aOldPixOffset )
{
- Window::SetMapMode( MapMode( MAP_PIXEL ) );
+ Window::SetMapMode( MapMode( MapUnit::MapPixel ) );
Window::Scroll(
aPixOffset.X() - aOldPixOffset.X(),
aPixOffset.Y() - aOldPixOffset.Y() );
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index 5b38e6403aa4..cac41b7419cb 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -133,7 +133,7 @@ namespace svt
m_pImpl->pRoadmap->SetPosPixel( Point( 0, 0 ) );
m_pImpl->pRoadmap->SetItemSelectHdl( LINK( this, RoadmapWizard, OnRoadmapItemSelected ) );
- Size aRoadmapSize =( LogicToPixel( Size( 85, 0 ), MAP_APPFONT ) );
+ Size aRoadmapSize =( LogicToPixel( Size( 85, 0 ), MapUnit::MapAppFont ) );
aRoadmapSize.Height() = GetSizePixel().Height();
m_pImpl->pRoadmap->SetSizePixel( aRoadmapSize );
diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx
index dde11dced207..0f9ad02d0d25 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -125,7 +125,7 @@ namespace svt
if (_nButtonFlags & WizardButtonFlags::HELP)
{
m_pHelp= VclPtr<HelpButton>::Create(this, WB_TABSTOP);
- m_pHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
+ m_pHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) );
m_pHelp->Show();
AddButton( m_pHelp, WIZARDDIALOG_BUTTON_STDOFFSET_X);
}
@@ -135,7 +135,7 @@ namespace svt
{
m_pPrevPage = VclPtr<PushButton>::Create(this, WB_TABSTOP);
m_pPrevPage->SetHelpId( HID_WIZARD_PREVIOUS );
- m_pPrevPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
+ m_pPrevPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) );
m_pPrevPage->SetText(SVT_RESSTR(STR_WIZDLG_PREVIOUS));
m_pPrevPage->Show();
m_pPrevPage->set_id("previous");
@@ -153,7 +153,7 @@ namespace svt
{
m_pNextPage = VclPtr<PushButton>::Create(this, WB_TABSTOP);
m_pNextPage->SetHelpId( HID_WIZARD_NEXT );
- m_pNextPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
+ m_pNextPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) );
m_pNextPage->SetText(OUString(SVT_RESSTR(STR_WIZDLG_NEXT)));
m_pNextPage->Show();
m_pNextPage->set_id("next");
@@ -167,7 +167,7 @@ namespace svt
if (_nButtonFlags & WizardButtonFlags::FINISH)
{
m_pFinish = VclPtr<OKButton>::Create(this, WB_TABSTOP);
- m_pFinish->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
+ m_pFinish->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) );
m_pFinish->SetText(SVT_RESSTR(STR_WIZDLG_FINISH));
m_pFinish->Show();
m_pFinish->set_id("finish");
@@ -180,7 +180,7 @@ namespace svt
if (_nButtonFlags & WizardButtonFlags::CANCEL)
{
m_pCancel = VclPtr<CancelButton>::Create(this, WB_TABSTOP);
- m_pCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
+ m_pCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) );
m_pCancel->Show();
AddButton( m_pCancel, WIZARDDIALOG_BUTTON_STDOFFSET_X );
diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx
index f8b04d233568..e7e7508fbb08 100644
--- a/svtools/source/dialogs/wizdlg.cxx
+++ b/svtools/source/dialogs/wizdlg.cxx
@@ -235,7 +235,7 @@ void WizardDialog::ImplPosCtrls()
long WizardDialog::LogicalCoordinateToPixel(int iCoordinate){
- Size aLocSize = LogicToPixel(Size( iCoordinate, 0 ), MAP_APPFONT );
+ Size aLocSize = LogicToPixel(Size( iCoordinate, 0 ), MapUnit::MapAppFont );
int iPixelCoordinate = aLocSize.Width();
return iPixelCoordinate;
}
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index 7bcb47303867..4d1e72f9ff94 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -53,7 +53,7 @@ DocumentToGraphicRenderer::~DocumentToGraphicRenderer()
Size DocumentToGraphicRenderer::getDocumentSizeInPixels(sal_Int32 aCurrentPage)
{
Size aSize100mm = getDocumentSizeIn100mm(aCurrentPage);
- return Size( Application::GetDefaultDevice()->LogicToPixel( aSize100mm, MAP_100TH_MM ) );
+ return Size( Application::GetDefaultDevice()->LogicToPixel( aSize100mm, MapUnit::Map100thMM ) );
}
Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 aCurrentPage)
diff --git a/svtools/source/filter/GraphicExportOptionsDialog.cxx b/svtools/source/filter/GraphicExportOptionsDialog.cxx
index 33fbeafde44a..e7591cc2b98d 100644
--- a/svtools/source/filter/GraphicExportOptionsDialog.cxx
+++ b/svtools/source/filter/GraphicExportOptionsDialog.cxx
@@ -89,12 +89,12 @@ IMPL_LINK_NOARG( GraphicExportOptionsDialog, resolutionModifiedHandle, Edit&, vo
double GraphicExportOptionsDialog::getViewWidthInch()
{
- return (double) MetricField::ConvertValue(mSize100mm.Width(), 2, MAP_100TH_MM, FUNIT_INCH) / 100.0;
+ return (double) MetricField::ConvertValue(mSize100mm.Width(), 2, MapUnit::Map100thMM, FUNIT_INCH) / 100.0;
}
double GraphicExportOptionsDialog::getViewHeightInch()
{
- return (double) MetricField::ConvertValue(mSize100mm.Height(), 2, MAP_100TH_MM, FUNIT_INCH) / 100.0;
+ return (double) MetricField::ConvertValue(mSize100mm.Height(), 2, MapUnit::Map100thMM, FUNIT_INCH) / 100.0;
}
void GraphicExportOptionsDialog::updateWidth()
diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx
index 9f965471dc24..645c8df7dd5f 100644
--- a/svtools/source/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
@@ -90,14 +90,14 @@ static sal_Int16 GetFilterFormat(const OUString& rExt)
static MapUnit GetMapUnit( sal_Int32 nUnit )
{
- MapUnit aMapUnit( MAP_PIXEL );
+ MapUnit aMapUnit( MapUnit::MapPixel );
switch( nUnit )
{
- case UNIT_INCH : aMapUnit = MAP_INCH; break;
- case UNIT_CM : aMapUnit = MAP_CM; break;
- case UNIT_MM : aMapUnit = MAP_MM; break;
- case UNIT_POINT : aMapUnit = MAP_POINT; break;
- case UNIT_PIXEL : aMapUnit = MAP_PIXEL; break;
+ case UNIT_INCH : aMapUnit = MapUnit::MapInch; break;
+ case UNIT_CM : aMapUnit = MapUnit::MapCM; break;
+ case UNIT_MM : aMapUnit = MapUnit::MapMM; break;
+ case UNIT_POINT : aMapUnit = MapUnit::MapPoint; break;
+ case UNIT_PIXEL : aMapUnit = MapUnit::MapPixel; break;
}
return aMapUnit;
}
@@ -600,7 +600,7 @@ ExportDialog::ExportDialog(FltCallDialogParameter& rPara,
mnFormat = GetFilterFormat( maExt );
- Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MAP_CM ) );
+ Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MapUnit::MapCM ) );
maResolution.Width = aResolution.Width();
maResolution.Height= aResolution.Height();
maOriginalSize = GetOriginalSize();
@@ -838,7 +838,7 @@ void ExportDialog::updateControls()
if ( !mbIsPixelFormat )
{
awt::Size aSize100thmm( maSize );
- Size aSize( LogicToLogic( Size( aSize100thmm.Width * 100, aSize100thmm.Height * 100 ), MAP_100TH_MM,
+ Size aSize( LogicToLogic( Size( aSize100thmm.Width * 100, aSize100thmm.Height * 100 ), MapUnit::Map100thMM,
MapMode( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ) ) ) );
mpMfSizeX->SetValue( aSize.Width() );
mpMfSizeY->SetValue( aSize.Height() );
@@ -846,7 +846,7 @@ void ExportDialog::updateControls()
else
{
MapUnit aMapUnit( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ) );
- if ( aMapUnit == MAP_PIXEL )
+ if ( aMapUnit == MapUnit::MapPixel )
{ // calculating pixel count via resolution and original graphic size
mpMfSizeX->SetDecimalDigits( 0 );
mpMfSizeY->SetDecimalDigits( 0 );
@@ -860,11 +860,11 @@ void ExportDialog::updateControls()
double fRatio;
switch( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ) )
{
- case MAP_INCH : fRatio = static_cast< double >( maResolution.Width ) * 0.0254; break;
- case MAP_MM : fRatio = static_cast< double >( maResolution.Width ) * 0.001; break;
- case MAP_POINT :fRatio = ( static_cast< double >( maResolution.Width ) * 0.0254 ) / 72.0; break;
+ case MapUnit::MapInch : fRatio = static_cast< double >( maResolution.Width ) * 0.0254; break;
+ case MapUnit::MapMM : fRatio = static_cast< double >( maResolution.Width ) * 0.001; break;
+ case MapUnit::MapPoint :fRatio = ( static_cast< double >( maResolution.Width ) * 0.0254 ) / 72.0; break;
default:
- case MAP_CM : fRatio = static_cast< double >( maResolution.Width ) * 0.01; break;
+ case MapUnit::MapCM : fRatio = static_cast< double >( maResolution.Width ) * 0.01; break;
}
mpMfSizeX->SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Width * 100 ) / fRatio ) + 0.5 ) );
mpMfSizeY->SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Height * 100 ) / fRatio ) + 0.5 ) );
@@ -998,12 +998,12 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeX, Edit&, void)
{
switch( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ) )
{
- case MAP_INCH : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * mpMfSizeX->GetValue() / 100.0 + 0.5 ); break;
- case MAP_CM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.01 * mpMfSizeX->GetValue() / 100.0 + 0.5 ); break;
- case MAP_MM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.001 * mpMfSizeX->GetValue() / 100.0 + 0.5 ); break;
- case MAP_POINT : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * mpMfSizeX->GetValue() / 100.0 * 72 + 0.5 ); break;
+ case MapUnit::MapInch : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * mpMfSizeX->GetValue() / 100.0 + 0.5 ); break;
+ case MapUnit::MapCM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.01 * mpMfSizeX->GetValue() / 100.0 + 0.5 ); break;
+ case MapUnit::MapMM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.001 * mpMfSizeX->GetValue() / 100.0 + 0.5 ); break;
+ case MapUnit::MapPoint : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * mpMfSizeX->GetValue() / 100.0 * 72 + 0.5 ); break;
default:
- case MAP_PIXEL : maSize.Width = mpMfSizeX->GetValue(); break;
+ case MapUnit::MapPixel : maSize.Width = mpMfSizeX->GetValue(); break;
}
maSize.Height = static_cast< sal_Int32 >( fRatio * maSize.Width + 0.5 );
}
@@ -1014,7 +1014,7 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeX, Edit&, void)
sal_Int32 nHeight= static_cast< sal_Int32 >( nWidth * fRatio );
const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) );
MapMode aSourceMapMode( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ),Point(), aFract, aFract );
- Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) );
+ Size aDest( LogicToLogic( aSource, aSourceMapMode, MapUnit::Map100thMM ) );
maSize.Width = aDest.Width();
maSize.Height = aDest.Height();
@@ -1030,12 +1030,12 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeY, Edit&, void)
{
switch( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ) )
{
- case MAP_INCH : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * mpMfSizeY->GetValue() / 100.0 + 0.5 ); break;
- case MAP_CM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.01 * mpMfSizeY->GetValue() / 100.0 + 0.5 ); break;
- case MAP_MM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.001 * mpMfSizeY->GetValue() / 100.0 + 0.5 ); break;
- case MAP_POINT : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * mpMfSizeY->GetValue() / 100.0 * 72 + 0.5 ); break;
+ case MapUnit::MapInch : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * mpMfSizeY->GetValue() / 100.0 + 0.5 ); break;
+ case MapUnit::MapCM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.01 * mpMfSizeY->GetValue() / 100.0 + 0.5 ); break;
+ case MapUnit::MapMM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.001 * mpMfSizeY->GetValue() / 100.0 + 0.5 ); break;
+ case MapUnit::MapPoint : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * mpMfSizeY->GetValue() / 100.0 * 72 + 0.5 ); break;
default:
- case MAP_PIXEL : maSize.Height = mpMfSizeY->GetValue(); break;
+ case MapUnit::MapPixel : maSize.Height = mpMfSizeY->GetValue(); break;
}
maSize.Width = static_cast< sal_Int32 >( fRatio * maSize.Height + 0.5 );
}
@@ -1046,7 +1046,7 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeY, Edit&, void)
sal_Int32 nWidth = static_cast< sal_Int32 >( nHeight * fRatio );
const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) );
MapMode aSourceMapMode( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ),Point(), aFract, aFract );
- Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) );
+ Size aDest( LogicToLogic( aSource, aSourceMapMode, MapUnit::Map100thMM ) );
maSize.Height = aDest.Height();
maSize.Width = aDest.Width();
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx
index 1cec88463da3..4f73e4fab05c 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -379,9 +379,9 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry**
if( mpGraphic )
{
- if( mpGraphic->GetPrefMapMode().GetMapUnit() != MAP_PIXEL )
+ if( mpGraphic->GetPrefMapMode().GetMapUnit() != MapUnit::MapPixel )
{
- const Size aSizeLog( OutputDevice::LogicToLogic( mpGraphic->GetPrefSize(), mpGraphic->GetPrefMapMode(), MAP_100TH_MM ) );
+ const Size aSizeLog( OutputDevice::LogicToLogic( mpGraphic->GetPrefSize(), mpGraphic->GetPrefMapMode(), MapUnit::Map100thMM ) );
aAWTSize = awt::Size( aSizeLog.Width(), aSizeLog.Height() );
}
}
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 3392814cc4d9..214f37814fb0 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -290,7 +290,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz
tools::Polygon aClipPoly( Rectangle( rPt, rSz ) );
const sal_uInt16 nRot10 = pAttr->GetRotation() % 3600;
const Point aOldOrigin( rPt );
- const MapMode aMap100( MAP_100TH_MM );
+ const MapMode aMap100( MapUnit::Map100thMM );
Size aSize100;
long nTotalWidth, nTotalHeight;
@@ -304,7 +304,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz
rClipPolyPoly = aClipPoly;
- if( maGraphic.GetPrefMapMode() == MAP_PIXEL )
+ if( maGraphic.GetPrefMapMode() == MapUnit::MapPixel )
aSize100 = Application::GetDefaultDevice()->PixelToLogic( maGraphic.GetPrefSize(), aMap100 );
else
{
@@ -723,7 +723,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
// #104115# Convert the crop margins to graphic object mapmode
const MapMode aMapGraph( aTransGraphic.GetPrefMapMode() );
- const MapMode aMap100( MAP_100TH_MM );
+ const MapMode aMap100( MapUnit::Map100thMM );
Size aCropLeftTop;
Size aCropRightBottom;
@@ -732,9 +732,9 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
{
GDIMetaFile aMtf( aTransGraphic.GetGDIMetaFile() );
- if( aMapGraph == MAP_PIXEL )
+ if( aMapGraph == MapUnit::MapPixel )
{
- // crops are in 1/100th mm -> to aMapGraph -> to MAP_PIXEL
+ // crops are in 1/100th mm -> to aMapGraph -> to MapUnit::MapPixel
aCropLeftTop = Application::GetDefaultDevice()->LogicToPixel(
Size(rAttr.GetLeftCrop(), rAttr.GetTopCrop()),
aMap100);
@@ -805,9 +805,9 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
// convert crops to pixel
if(rAttr.IsCropped())
{
- if( aMapGraph == MAP_PIXEL )
+ if( aMapGraph == MapUnit::MapPixel )
{
- // crops are in 1/100th mm -> to MAP_PIXEL
+ // crops are in 1/100th mm -> to MapUnit::MapPixel
aCropLeftTop = Application::GetDefaultDevice()->LogicToPixel(
Size(rAttr.GetLeftCrop(), rAttr.GetTopCrop()),
aMap100);
@@ -817,7 +817,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
}
else
{
- // crops are in GraphicObject units -> to MAP_PIXEL
+ // crops are in GraphicObject units -> to MapUnit::MapPixel
aCropLeftTop = Application::GetDefaultDevice()->LogicToPixel(
Size(rAttr.GetLeftCrop(), rAttr.GetTopCrop()),
aMapGraph);
@@ -1153,12 +1153,12 @@ basegfx::B2DVector GraphicObject::calculateCropScaling(
double fRightCrop,
double fBottomCrop) const
{
- const MapMode aMapMode100thmm(MAP_100TH_MM);
+ const MapMode aMapMode100thmm(MapUnit::Map100thMM);
Size aBitmapSize(GetPrefSize());
double fFactorX(1.0);
double fFactorY(1.0);
- if(MAP_PIXEL == GetPrefMapMode().GetMapUnit())
+ if(MapUnit::MapPixel == GetPrefMapMode().GetMapUnit())
{
aBitmapSize = Application::GetDefaultDevice()->PixelToLogic(aBitmapSize, aMapMode100thmm);
}
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index fdfcbc50ae9a..1f559d6c5e28 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -501,13 +501,13 @@ void ImplCalculateCropRect( ::Graphic& rGraphic, const text::GraphicCrop& rGraph
if ( rGraphicCropLogic.Left || rGraphicCropLogic.Top || rGraphicCropLogic.Right || rGraphicCropLogic.Bottom )
{
Size aSize100thMM( 0, 0 );
- if( rGraphic.GetPrefMapMode().GetMapUnit() != MAP_PIXEL )
+ if( rGraphic.GetPrefMapMode().GetMapUnit() != MapUnit::MapPixel )
{
- aSize100thMM = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode(), MAP_100TH_MM );
+ aSize100thMM = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode(), MapUnit::Map100thMM );
}
else
{
- aSize100thMM = Application::GetDefaultDevice()->PixelToLogic( rGraphic.GetPrefSize(), MAP_100TH_MM );
+ aSize100thMM = Application::GetDefaultDevice()->PixelToLogic( rGraphic.GetPrefSize(), MapUnit::Map100thMM );
}
if ( aSize100thMM.Width() && aSize100thMM.Height() )
{
@@ -627,10 +627,10 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal
{
ScopedVclPtrInstance< VirtualDevice > aDummyVDev;
GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() );
- Size aMtfSize( OutputDevice::LogicToLogic( aMtf.GetPrefSize(), aMtf.GetPrefMapMode(), MAP_100TH_MM ) );
+ Size aMtfSize( OutputDevice::LogicToLogic( aMtf.GetPrefSize(), aMtf.GetPrefMapMode(), MapUnit::Map100thMM ) );
if ( aMtfSize.Width() && aMtfSize.Height() )
{
- MapMode aNewMapMode( MAP_100TH_MM );
+ MapMode aNewMapMode( MapUnit::Map100thMM );
aNewMapMode.SetScaleX( static_cast< double >( aLogicalSize.Width ) / static_cast< double >( aMtfSize.Width() ) );
aNewMapMode.SetScaleY( static_cast< double >( aLogicalSize.Height ) / static_cast< double >( aMtfSize.Height() ) );
aDummyVDev->EnableOutput( false );
@@ -680,7 +680,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal
}
::Graphic aGraphic( aBmpEx );
const Size aSize100thmm( aDummyVDev->LogicToPixel( aSize ) );
- Size aSize100thmm2( aDummyVDev->PixelToLogic( aSize100thmm, MAP_100TH_MM ) );
+ Size aSize100thmm2( aDummyVDev->PixelToLogic( aSize100thmm, MapUnit::Map100thMM ) );
ImplApplyBitmapResolution( aGraphic, nImageResolution,
aGraphic.GetSizePixel(), awt::Size( aSize100thmm2.Width(), aSize100thmm2.Height() ) );
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 9a61bfc7cce0..564b5a096479 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -463,7 +463,7 @@ const Graphic* EmbeddedObjectRef::GetGraphic() const
Size EmbeddedObjectRef::GetSize( MapMode* pTargetMapMode ) const
{
- MapMode aSourceMapMode( MAP_100TH_MM );
+ MapMode aSourceMapMode( MapUnit::Map100thMM );
Size aResult;
if ( mpImpl->nViewAspect == embed::Aspects::MSOLE_ICON )
@@ -640,7 +640,7 @@ SvStream* EmbeddedObjectRef::GetGraphicStream( bool bUpdate ) const
void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const OUString &rText, OutputDevice *pOut )
{
- MapMode aMM( MAP_APPFONT );
+ MapMode aMM( MapUnit::MapAppFont );
Size aAppFontSz = pOut->LogicToLogic( Size( 0, 8 ), &aMM, nullptr );
vcl::Font aFnt( OUString("Helvetica"), aAppFontSz );
aFnt.SetTransparent( true );
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index 8dab2ac5abdb..1a867e22e240 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -218,7 +218,7 @@ void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObject
rDesc.mnOle2Misc = sal::static_int_cast<sal_Int32>(xObj->getStatus( rDesc.mnViewAspect ));
Size aSize;
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
if ( pGraphic )
@@ -247,7 +247,7 @@ void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObject
aMapMode = MapMode( VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( rDesc.mnViewAspect ) ) );
}
- rDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapMode( MAP_100TH_MM ) );
+ rDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapMode( MapUnit::Map100thMM ) );
rDesc.maDragStartPos = Point();
rDesc.maDisplayName.clear();
}
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index e37763b52a9a..1b96d67840f7 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -151,7 +151,7 @@ IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect,
void IMapRectangleObject::ImpConstruct( const Rectangle& rRect, bool bPixel )
{
if ( bPixel )
- aRect = Application::GetDefaultDevice()->PixelToLogic( rRect, MapMode( MAP_100TH_MM ) );
+ aRect = Application::GetDefaultDevice()->PixelToLogic( rRect, MapMode( MapUnit::Map100thMM ) );
else
aRect = rRect;
}
@@ -209,7 +209,7 @@ Rectangle IMapRectangleObject::GetRectangle( bool bPixelCoords ) const
Rectangle aNewRect;
if ( bPixelCoords )
- aNewRect = Application::GetDefaultDevice()->LogicToPixel( aRect, MapMode( MAP_100TH_MM ) );
+ aNewRect = Application::GetDefaultDevice()->LogicToPixel( aRect, MapMode( MapUnit::Map100thMM ) );
else
aNewRect = aRect;
@@ -252,7 +252,7 @@ void IMapCircleObject::ImpConstruct( const Point& rCenter, sal_uLong nRad, bool
{
if ( bPixel )
{
- MapMode aMap100( MAP_100TH_MM );
+ MapMode aMap100( MapUnit::Map100thMM );
aCenter = Application::GetDefaultDevice()->PixelToLogic( rCenter, aMap100 );
nRadius = Application::GetDefaultDevice()->PixelToLogic( Size( nRad, 0 ), aMap100 ).Width();
@@ -334,7 +334,7 @@ Point IMapCircleObject::GetCenter( bool bPixelCoords ) const
Point aNewPoint;
if ( bPixelCoords )
- aNewPoint = Application::GetDefaultDevice()->LogicToPixel( aCenter, MapMode( MAP_100TH_MM ) );
+ aNewPoint = Application::GetDefaultDevice()->LogicToPixel( aCenter, MapMode( MapUnit::Map100thMM ) );
else
aNewPoint = aCenter;
@@ -346,7 +346,7 @@ sal_uLong IMapCircleObject::GetRadius( bool bPixelCoords ) const
sal_uLong nNewRadius;
if ( bPixelCoords )
- nNewRadius = Application::GetDefaultDevice()->LogicToPixel( Size( nRadius, 0 ), MapMode( MAP_100TH_MM ) ).Width();
+ nNewRadius = Application::GetDefaultDevice()->LogicToPixel( Size( nRadius, 0 ), MapMode( MapUnit::Map100thMM ) ).Width();
else
nNewRadius = nRadius;
@@ -395,7 +395,7 @@ IMapPolygonObject::IMapPolygonObject( const tools::Polygon& rPoly,
void IMapPolygonObject::ImpConstruct( const tools::Polygon& rPoly, bool bPixel )
{
if ( bPixel )
- aPoly = Application::GetDefaultDevice()->PixelToLogic( rPoly, MapMode( MAP_100TH_MM ) );
+ aPoly = Application::GetDefaultDevice()->PixelToLogic( rPoly, MapMode( MapUnit::Map100thMM ) );
else
aPoly = rPoly;
}
@@ -462,7 +462,7 @@ tools::Polygon IMapPolygonObject::GetPolygon( bool bPixelCoords ) const
tools::Polygon aNewPoly;
if ( bPixelCoords )
- aNewPoly = Application::GetDefaultDevice()->LogicToPixel( aPoly, MapMode( MAP_100TH_MM ) );
+ aNewPoly = Application::GetDefaultDevice()->LogicToPixel( aPoly, MapMode( MapUnit::Map100thMM ) );
else
aNewPoly = aPoly;
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index b031d4c85cc7..8ca4349421fd 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -39,7 +39,7 @@
void IMapObject::AppendCERNCoords(OStringBuffer& rBuf, const Point& rPoint100)
{
- const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MAP_100TH_MM ) ) );
+ const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MapUnit::Map100thMM ) ) );
rBuf.append('(');
rBuf.append(static_cast<sal_Int32>(aPixPt.X()));
@@ -50,7 +50,7 @@ void IMapObject::AppendCERNCoords(OStringBuffer& rBuf, const Point& rPoint100)
void IMapObject::AppendNCSACoords(OStringBuffer& rBuf, const Point& rPoint100)
{
- const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MAP_100TH_MM ) ) );
+ const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MapUnit::Map100thMM ) ) );
rBuf.append(static_cast<sal_Int32>(aPixPt.X()));
rBuf.append(',');
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index b156b61220bd..8efdce0b1512 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -1609,18 +1609,18 @@ bool TransferableDataHelper::GetBitmapEx( const DataFlavor& rFlavor, BitmapEx& r
{
const MapMode aMapMode(rBmpEx.GetPrefMapMode());
- if(MAP_PIXEL != aMapMode.GetMapUnit())
+ if(MapUnit::MapPixel != aMapMode.GetMapUnit())
{
- const Size aSize(OutputDevice::LogicToLogic(rBmpEx.GetPrefSize(), aMapMode, MAP_100TH_MM));
+ const Size aSize(OutputDevice::LogicToLogic(rBmpEx.GetPrefSize(), aMapMode, MapUnit::Map100thMM));
// #i122388# This wrongly corrects in the given case; changing from 5000 100th mm to
// the described 50 cm (which is 50000 100th mm)
if((aSize.Width() > 50000) || (aSize.Height() > 50000))
{
- rBmpEx.SetPrefMapMode(MAP_PIXEL);
+ rBmpEx.SetPrefMapMode(MapUnit::MapPixel);
// #i122388# also adapt size by applying the mew MapMode
- const Size aNewSize(OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, MAP_PIXEL));
+ const Size aNewSize(OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, MapUnit::MapPixel));
rBmpEx.SetPrefSize(aNewSize);
}
}
diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx
index 250ac3b96438..acf65083136c 100644
--- a/svtools/source/misc/unitconv.cxx
+++ b/svtools/source/misc/unitconv.cxx
@@ -111,7 +111,7 @@ void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit )
void SetMetricValue( MetricField& rField, long nCoreValue, MapUnit eUnit )
{
- sal_Int64 nVal = OutputDevice::LogicToLogic( nCoreValue, (MapUnit)eUnit, MAP_100TH_MM );
+ sal_Int64 nVal = OutputDevice::LogicToLogic( nCoreValue, (MapUnit)eUnit, MapUnit::Map100thMM );
nVal = rField.Normalize( nVal );
rField.SetValue( nVal, FUNIT_100TH_MM );
@@ -136,7 +136,7 @@ long GetCoreValue( const MetricField& rField, MapUnit eUnit )
}
if( bRoundBefore )
nVal = rField.Denormalize( nVal );
- sal_Int64 nUnitVal = OutputDevice::LogicToLogic( static_cast<long>(nVal), MAP_100TH_MM, (MapUnit)eUnit );
+ sal_Int64 nUnitVal = OutputDevice::LogicToLogic( static_cast<long>(nVal), MapUnit::Map100thMM, (MapUnit)eUnit );
if( ! bRoundBefore )
nUnitVal = rField.Denormalize( nUnitVal );
return static_cast<long>(nUnitVal);
@@ -147,23 +147,23 @@ long CalcToUnit( float nIn, MapUnit eUnit )
{
// nIn ist in Points
- DBG_ASSERT( eUnit == MAP_TWIP ||
- eUnit == MAP_100TH_MM ||
- eUnit == MAP_10TH_MM ||
- eUnit == MAP_MM ||
- eUnit == MAP_CM, "this unit is not implemented" );
+ DBG_ASSERT( eUnit == MapUnit::MapTwip ||
+ eUnit == MapUnit::Map100thMM ||
+ eUnit == MapUnit::Map10thMM ||
+ eUnit == MapUnit::MapMM ||
+ eUnit == MapUnit::MapCM, "this unit is not implemented" );
float nTmp = nIn;
- if ( MAP_TWIP != eUnit )
+ if ( MapUnit::MapTwip != eUnit )
nTmp = nIn * 10 / 567;
switch ( eUnit )
{
- case MAP_100TH_MM: nTmp *= 100; break;
- case MAP_10TH_MM: nTmp *= 10; break;
- case MAP_MM: break;
- case MAP_CM: nTmp /= 10; break;
+ case MapUnit::Map100thMM: nTmp *= 100; break;
+ case MapUnit::Map10thMM: nTmp *= 10; break;
+ case MapUnit::MapMM: break;
+ case MapUnit::MapCM: nTmp /= 10; break;
default: ;//prevent warning
}
@@ -180,46 +180,46 @@ long ItemToControl( long nIn, MapUnit eItem, FieldUnit eCtrl )
switch ( eItem )
{
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- case MAP_MM:
+ case MapUnit::Map100thMM:
+ case MapUnit::Map10thMM:
+ case MapUnit::MapMM:
{
- if ( eItem == MAP_10TH_MM )
+ if ( eItem == MapUnit::Map10thMM )
nIn /= 10;
- else if ( eItem == MAP_100TH_MM )
+ else if ( eItem == MapUnit::Map100thMM )
nIn /= 100;
nOut = TransformMetric( nIn, FUNIT_MM, eCtrl );
}
break;
- case MAP_CM:
+ case MapUnit::MapCM:
{
nOut = TransformMetric( nIn, FUNIT_CM, eCtrl );
}
break;
- case MAP_1000TH_INCH:
- case MAP_100TH_INCH:
- case MAP_10TH_INCH:
- case MAP_INCH:
+ case MapUnit::Map1000thInch:
+ case MapUnit::Map100thInch:
+ case MapUnit::Map10thInch:
+ case MapUnit::MapInch:
{
- if ( eItem == MAP_10TH_INCH )
+ if ( eItem == MapUnit::Map10thInch )
nIn /= 10;
- else if ( eItem == MAP_100TH_INCH )
+ else if ( eItem == MapUnit::Map100thInch )
nIn /= 100;
- else if ( eItem == MAP_1000TH_INCH )
+ else if ( eItem == MapUnit::Map1000thInch )
nIn /= 1000;
nOut = TransformMetric( nIn, FUNIT_INCH, eCtrl );
}
break;
- case MAP_POINT:
+ case MapUnit::MapPoint:
{
nOut = TransformMetric( nIn, FUNIT_POINT, eCtrl );
}
break;
- case MAP_TWIP:
+ case MapUnit::MapTwip:
{
nOut = TransformMetric( nIn, FUNIT_TWIP, eCtrl );
}
@@ -240,24 +240,24 @@ FieldUnit MapToFieldUnit( const MapUnit eUnit )
{
switch ( eUnit )
{
- case MAP_100TH_MM:
- case MAP_10TH_MM:
- case MAP_MM:
+ case MapUnit::Map100thMM:
+ case MapUnit::Map10thMM:
+ case MapUnit::MapMM:
return FUNIT_MM;
- case MAP_CM:
+ case MapUnit::MapCM:
return FUNIT_CM;
- case MAP_1000TH_INCH:
- case MAP_100TH_INCH:
- case MAP_10TH_INCH:
- case MAP_INCH:
+ case MapUnit::Map1000thInch:
+ case MapUnit::Map100thInch:
+ case MapUnit::Map10thInch:
+ case MapUnit::MapInch:
return FUNIT_INCH;
- case MAP_POINT:
+ case MapUnit::MapPoint:
return FUNIT_POINT;
- case MAP_TWIP:
+ case MapUnit::MapTwip:
return FUNIT_TWIP;
default: ;//prevent warning
}
@@ -267,30 +267,30 @@ FieldUnit MapToFieldUnit( const MapUnit eUnit )
long CalcToPoint( long nIn, MapUnit eUnit, sal_uInt16 nFactor )
{
- DBG_ASSERT( eUnit == MAP_TWIP ||
- eUnit == MAP_100TH_MM ||
- eUnit == MAP_10TH_MM ||
- eUnit == MAP_MM ||
- eUnit == MAP_CM, "this unit is not implemented" );
+ DBG_ASSERT( eUnit == MapUnit::MapTwip ||
+ eUnit == MapUnit::Map100thMM ||
+ eUnit == MapUnit::Map10thMM ||
+ eUnit == MapUnit::MapMM ||
+ eUnit == MapUnit::MapCM, "this unit is not implemented" );
long nRet = 0;
- if ( MAP_TWIP == eUnit )
+ if ( MapUnit::MapTwip == eUnit )
nRet = nIn;
else
nRet = nIn * 567;
switch ( eUnit )
{
- case MAP_100TH_MM: nRet /= 100; break;
- case MAP_10TH_MM: nRet /= 10; break;
- case MAP_MM: break;
- case MAP_CM: nRet *= 10; break;
+ case MapUnit::Map100thMM: nRet /= 100; break;
+ case MapUnit::Map10thMM: nRet /= 10; break;
+ case MapUnit::MapMM: break;
+ case MapUnit::MapCM: nRet *= 10; break;
default: ;//prevent warning
}
// ggf. aufrunden
- if ( MAP_TWIP != eUnit )
+ if ( MapUnit::MapTwip != eUnit )
{
long nMod = 10;
long nTmp = nRet % nMod;
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index dacd04450f51..e9636955793f 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -558,15 +558,15 @@ namespace svt { namespace table
void TableControl_Impl::impl_ni_updateCachedTableMetrics()
{
- m_nRowHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getRowHeight() ), MAP_APPFONT ).Height();
+ m_nRowHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getRowHeight() ), MapUnit::MapAppFont ).Height();
m_nColHeaderHeightPixel = 0;
if ( m_pModel->hasColumnHeaders() )
- m_nColHeaderHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getColumnHeaderHeight() ), MAP_APPFONT ).Height();
+ m_nColHeaderHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getColumnHeaderHeight() ), MapUnit::MapAppFont ).Height();
m_nRowHeaderWidthPixel = 0;
if ( m_pModel->hasRowHeaders() )
- m_nRowHeaderWidthPixel = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT).Width();
+ m_nRowHeaderWidthPixel = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MapUnit::MapAppFont).Width();
}
@@ -1810,13 +1810,13 @@ namespace svt { namespace table
long TableControl_Impl::pixelWidthToAppFont( long const i_pixels ) const
{
- return m_pDataWindow->PixelToLogic( Size( i_pixels, 0 ), MAP_APPFONT ).Width();
+ return m_pDataWindow->PixelToLogic( Size( i_pixels, 0 ), MapUnit::MapAppFont ).Width();
}
long TableControl_Impl::appFontWidthToPixel( long const i_appFontUnits ) const
{
- return m_pDataWindow->LogicToPixel( Size( i_appFontUnits, 0 ), MAP_APPFONT ).Width();
+ return m_pDataWindow->LogicToPixel( Size( i_appFontUnits, 0 ), MapUnit::MapAppFont ).Width();
}
diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx
index 9bdbafa1aa20..59bb09071a13 100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -212,7 +212,7 @@ void SVTXGridControl::setProperty( const OUString& PropertyName, const Any& aVal
sal_Int32 columnHeaderHeight = 0;
if ( !aValue.hasValue() )
{
- columnHeaderHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
+ columnHeaderHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MapUnit::MapAppFont ).Height();
}
else
{
@@ -252,7 +252,7 @@ void SVTXGridControl::setProperty( const OUString& PropertyName, const Any& aVal
sal_Int32 rowHeight = 0;
if ( !aValue.hasValue() )
{
- rowHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
+ rowHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MapUnit::MapAppFont ).Height();
}
else
{
diff --git a/svtools/source/uno/wizard/wizardshell.cxx b/svtools/source/uno/wizard/wizardshell.cxx
index ca27a2ee2193..ad63261bd229 100644
--- a/svtools/source/uno/wizard/wizardshell.cxx
+++ b/svtools/source/uno/wizard/wizardshell.cxx
@@ -184,7 +184,7 @@ namespace svt { namespace uno
{
// fallback for ill-behaved clients: empty page
pPage = VclPtr<TabPage>::Create( this, 0 );
- pPage->SetSizePixel( LogicToPixel( Size( 280, 185 ), MAP_APPFONT ) );
+ pPage->SetSizePixel( LogicToPixel( Size( 280, 185 ), MapUnit::MapAppFont ) );
}
m_aPageControllers[ pPage ] = pController;
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 94e8eff10db8..a52bfffe4097 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -269,9 +269,9 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
fMap /= aFraction.GetDenominator();
pMap = &fMap;
}
- if ( pModel->GetScaleUnit() != MAP_100TH_MM )
+ if ( pModel->GetScaleUnit() != MapUnit::Map100thMM )
{
- DBG_ASSERT( pModel->GetScaleUnit() == MAP_TWIP, "EnhancedCustomShape3d::Current MapMode is Unsupported" );
+ DBG_ASSERT( pModel->GetScaleUnit() == MapUnit::MapTwip, "EnhancedCustomShape3d::Current MapMode is Unsupported" );
fMap *= 1440.0 / 2540.0;
pMap = &fMap;
}
@@ -500,14 +500,14 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
// from regular 3D objects for some time, also needs to be removed from CustomShapes
//Size aLogicalSize = aFillBmp.GetPrefSize();
- //if ( aFillBmp.GetPrefMapMode() == MAP_PIXEL )
- // aLogicalSize = Application::GetDefaultDevice()->PixelToLogic( aLogicalSize, MAP_100TH_MM );
+ //if ( aFillBmp.GetPrefMapMode() == MapUnit::MapPixel )
+ // aLogicalSize = Application::GetDefaultDevice()->PixelToLogic( aLogicalSize, MapUnit::Map100thMM );
//else
- // aLogicalSize = OutputDevice::LogicToLogic( aLogicalSize, aFillBmp.GetPrefMapMode(), MAP_100TH_MM );
+ // aLogicalSize = OutputDevice::LogicToLogic( aLogicalSize, aFillBmp.GetPrefMapMode(), MapUnit::Map100thMM );
//aLogicalSize.Width() *= 5; ;// :-( nice scaling, look at engine3d/obj3d.cxx
//aLogicalSize.Height() *= 5;
//aFillBmp.SetPrefSize( aLogicalSize );
- //aFillBmp.SetPrefMapMode( MAP_100TH_MM );
+ //aFillBmp.SetPrefMapMode( MapUnit::Map100thMM );
//p3DObj->SetMergedItem(XFillBitmapItem(String(), Graphic(aFillBmp)));
}
else
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index def4e5bae4f8..a999791a5c5a 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -167,7 +167,7 @@ void CalculateHorizontalScalingFactor( const SdrObject* pCustomShape,
// initializing virtual device
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK);
- pVirDev->SetMapMode( MAP_100TH_MM );
+ pVirDev->SetMapMode( MapUnit::Map100thMM );
pVirDev->SetFont( aFont );
if ( nOutlinesCount2d & 1 )
@@ -261,7 +261,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
// initializing virtual device
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK);
- pVirDev->SetMapMode( MAP_100TH_MM );
+ pVirDev->SetMapMode( MapUnit::Map100thMM );
pVirDev->SetFont( aFont );
pVirDev->EnableRTL();
if ( aParagraphIter->nFrameDirection == FRMDIR_HORI_RIGHT_TOP )
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index d8d0ebc3f281..77ca04fc3a01 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -76,7 +76,7 @@ public:
virtual Size GetOptimalSize() const override
{
- return LogicToPixel(Size(43, 14), MAP_APPFONT);
+ return LogicToPixel(Size(43, 14), MapUnit::MapAppFont);
}
};
@@ -93,7 +93,7 @@ public:
virtual void GetFocus() override;
virtual Size GetOptimalSize() const override
{
- return LogicToPixel(Size(24, 12), MAP_APPFONT);
+ return LogicToPixel(Size(24, 12), MapUnit::MapAppFont);
}
void onEditColor();
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index faedbde8feb0..2f316de609d3 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -273,7 +273,7 @@ SvxSuperContourDlg::SvxSuperContourDlg(SfxBindings *_pBindings, SfxChildWindow *
m_pTbx1->SetSizePixel( aTbxSize );
m_pTbx1->SetSelectHdl( LINK( this, SvxSuperContourDlg, Tbx1ClickHdl ) );
- aPos.X() += aTbxSize.Width() + LogicToPixel( Size( 3, 0 ), MapMode( MAP_APPFONT ) ).Width();
+ aPos.X() += aTbxSize.Width() + LogicToPixel( Size( 3, 0 ), MapMode( MapUnit::MapAppFont ) ).Width();
m_pMtfTolerance->SetPosPixel( aPos );
m_pMtfTolerance->SetValue( 10L );
@@ -355,10 +355,10 @@ void SvxSuperContourDlg::SetPolyPolygon( const tools::PolyPolygon& rPolyPoly )
DBG_ASSERT( m_pContourWnd->GetGraphic().GetType() != GraphicType::NONE, "Graphic must've been set first!" );
tools::PolyPolygon aPolyPoly( rPolyPoly );
- const MapMode aMap100( MAP_100TH_MM );
+ const MapMode aMap100( MapUnit::Map100thMM );
const MapMode aGrfMap( aGraphic.GetPrefMapMode() );
OutputDevice* pOutDev = Application::GetDefaultDevice();
- bool bPixelMap = aGrfMap.GetMapUnit() == MAP_PIXEL;
+ bool bPixelMap = aGrfMap.GetMapUnit() == MapUnit::MapPixel;
for ( sal_uInt16 j = 0, nPolyCount = aPolyPoly.Count(); j < nPolyCount; j++ )
{
@@ -383,10 +383,10 @@ tools::PolyPolygon SvxSuperContourDlg::GetPolyPolygon()
{
tools::PolyPolygon aRetPolyPoly( m_pContourWnd->GetPolyPolygon() );
- const MapMode aMap100( MAP_100TH_MM );
+ const MapMode aMap100( MapUnit::Map100thMM );
const MapMode aGrfMap( aGraphic.GetPrefMapMode() );
OutputDevice* pOutDev = Application::GetDefaultDevice();
- bool bPixelMap = aGrfMap.GetMapUnit() == MAP_PIXEL;
+ bool bPixelMap = aGrfMap.GetMapUnit() == MapUnit::MapPixel;
for ( sal_uInt16 j = 0, nPolyCount = aRetPolyPoly.Count(); j < nPolyCount; j++ )
{
@@ -598,7 +598,7 @@ IMPL_LINK_NOARG(SvxSuperContourDlg, CreateHdl, Idle *, void)
{
aCreateIdle.Stop();
- const Rectangle aWorkRect = m_pContourWnd->LogicToPixel( m_pContourWnd->GetWorkRect(), MapMode( MAP_100TH_MM ) );
+ const Rectangle aWorkRect = m_pContourWnd->LogicToPixel( m_pContourWnd->GetWorkRect(), MapMode( MapUnit::Map100thMM ) );
const Graphic& rGraphic = m_pContourWnd->GetGraphic();
const bool bValid = aWorkRect.Left() != aWorkRect.Right() && aWorkRect.Top() != aWorkRect.Bottom();
diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx
index 059cb552a06b..17a577c91bff 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -189,7 +189,7 @@ void CompressGraphicsDialog::Update()
pDummyVDev->SetMapMode( m_aGraphic.GetPrefMapMode() );
Size aPixelSize = m_aGraphic.GetSizePixel();
- Size aOriginalSize100mm( pDummyVDev->PixelToLogic( m_aGraphic.GetSizePixel(), MAP_100TH_MM ) );
+ Size aOriginalSize100mm( pDummyVDev->PixelToLogic( m_aGraphic.GetSizePixel(), MapUnit::Map100thMM ) );
OUString aBitmapSizeString = SVX_RESSTR(STR_IMAGE_ORIGINAL_SIZE);
OUString aWidthString = GetUnitString( aOriginalSize100mm.Width(), eFieldUnit, cSeparator );
@@ -243,12 +243,12 @@ void CompressGraphicsDialog::UpdateResolutionLB()
double CompressGraphicsDialog::GetViewWidthInch()
{
- return (double) MetricField::ConvertValue(m_aViewSize100mm.Width(), 2, MAP_100TH_MM, FUNIT_INCH) / 100.0;
+ return (double) MetricField::ConvertValue(m_aViewSize100mm.Width(), 2, MapUnit::Map100thMM, FUNIT_INCH) / 100.0;
}
double CompressGraphicsDialog::GetViewHeightInch()
{
- return (double) MetricField::ConvertValue(m_aViewSize100mm.Height(), 2, MAP_100TH_MM, FUNIT_INCH) / 100.0;
+ return (double) MetricField::ConvertValue(m_aViewSize100mm.Height(), 2, MapUnit::Map100thMM, FUNIT_INCH) / 100.0;
}
BmpScaleFlag CompressGraphicsDialog::GetSelectedInterpolationType()
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index 6360cfd934da..807f361489b2 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -42,7 +42,7 @@ SvxXConnectionPreview::SvxXConnectionPreview( vcl::Window* pParent, WinBits nSty
, pObjList(nullptr)
, pView(nullptr)
{
- SetMapMode( MAP_100TH_MM );
+ SetMapMode( MapUnit::Map100thMM );
SetStyles();
}
@@ -77,7 +77,7 @@ void SvxXConnectionPreview::Resize()
Size SvxXConnectionPreview::GetOptimalSize() const
{
- return LogicToPixel(Size(118 , 121), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(118 , 121), MapMode(MapUnit::MapAppFont));
}
void SvxXConnectionPreview::AdaptSize()
@@ -85,7 +85,7 @@ void SvxXConnectionPreview::AdaptSize()
// Adapt size
if( pObjList )
{
- SetMapMode( MAP_100TH_MM );
+ SetMapMode( MapUnit::Map100thMM );
OutputDevice* pOD = pView->GetFirstOutputDevice(); // GetWin( 0 );
Rectangle aRect = pObjList->GetAllObjBoundRect();
diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx
index e0faf2d196e0..c258847ec408 100644
--- a/svx/source/dialog/contwnd.cxx
+++ b/svx/source/dialog/contwnd.cxx
@@ -252,7 +252,7 @@ void ContourWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& r
Size ContourWindow::GetOptimalSize() const
{
- return LogicToPixel(Size(270, 170), MAP_APPFONT);
+ return LogicToPixel(Size(270, 170), MapUnit::MapAppFont);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 005284fc65c4..7d85606ca724 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -379,7 +379,7 @@ SvxTPView::SvxTPView(vcl::Window *pParent, VclBuilderContainer *pTopLevel)
SvSimpleTableContainer* pTable = get<SvSimpleTableContainer>("changes");
Size aControlSize(80, 65);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
pTable->set_width_request(aControlSize.Width());
pTable->set_height_request(aControlSize.Height());
m_pViewData = VclPtr<SvxRedlinTable>::Create(*pTable, 0);
diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx
index 50b9f089966b..4f7a240e146b 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -378,7 +378,7 @@ sal_Int32 DialControl::GetRotation() const
Size DialControl::GetOptimalSize() const
{
- return LogicToPixel(Size(42 , 43), MAP_APPFONT);
+ return LogicToPixel(Size(42 , 43), MapUnit::MapAppFont);
}
void DialControl::SetRotation( sal_Int32 nAngle )
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index 67bbd780c1db..84b5a5029c7e 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -59,7 +59,7 @@ Svx3DPreviewControl::Svx3DPreviewControl(vcl::Window* pParent, WinBits nStyle)
Size Svx3DPreviewControl::GetOptimalSize() const
{
- return LogicToPixel(Size(80, 100), MAP_APPFONT);
+ return LogicToPixel(Size(80, 100), MapUnit::MapAppFont);
}
VCL_BUILDER_FACTORY(Svx3DPreviewControl)
@@ -81,7 +81,7 @@ void Svx3DPreviewControl::Construct()
// Do never mirror the preview window. This explicitly includes right
// to left writing environments.
EnableRTL (false);
- SetMapMode( MAP_100TH_MM );
+ SetMapMode( MapUnit::Map100thMM );
// Model
mpModel = new FmFormModel();
@@ -952,7 +952,7 @@ SvxLightCtl3D::SvxLightCtl3D( vcl::Window* pParent)
Size SvxLightCtl3D::GetOptimalSize() const
{
- return LogicToPixel(Size(80, 100), MAP_APPFONT);
+ return LogicToPixel(Size(80, 100), MapUnit::MapAppFont);
}
VCL_BUILDER_FACTORY(SvxLightCtl3D)
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index a9c8b598f815..570ae38136ca 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -80,7 +80,7 @@ SvxRectCtl::SvxRectCtl(vcl::Window* pParent, RectPoint eRpt,
, mbUpdateForeground(true)
, mbUpdateBackground(true)
{
- SetMapMode(MAP_100TH_MM);
+ SetMapMode(MapUnit::Map100thMM);
Resize_Impl();
}
@@ -95,7 +95,7 @@ void SvxRectCtl::SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder, sal_uInt
Size SvxRectCtl::GetOptimalSize() const
{
- return LogicToPixel(Size(78, 39), MAP_APPFONT);
+ return LogicToPixel(Size(78, 39), MapUnit::MapAppFont);
}
VCL_BUILDER_FACTORY(SvxRectCtl)
@@ -824,7 +824,7 @@ void SvxPixelCtl::Resize()
Size SvxPixelCtl::GetOptimalSize() const
{
- return LogicToPixel(Size(72, 72), MAP_APPFONT);
+ return LogicToPixel(Size(72, 72), MapUnit::MapAppFont);
}
VCL_BUILDER_FACTORY_ARGS(SvxPixelCtl, 8)
@@ -1705,7 +1705,7 @@ SvxPreviewBase::SvxPreviewBase(vcl::Window* pParent)
// Draw the control's border as a flat thin black line.
SetBorderStyle(WindowBorderStyle::MONO);
SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
- SetMapMode(MAP_100TH_MM);
+ SetMapMode(MapUnit::Map100thMM);
// init model
mpModel->GetItemPool().FreezeIdRanges();
diff --git a/svx/source/dialog/dlgunit.hxx b/svx/source/dialog/dlgunit.hxx
index 5b380620a878..2af023651d32 100644
--- a/svx/source/dialog/dlgunit.hxx
+++ b/svx/source/dialog/dlgunit.hxx
@@ -25,7 +25,7 @@
inline OUString GetUnitString( long nVal_100, FieldUnit eFieldUnit, sal_Unicode cSep )
{
OUStringBuffer aVal = OUString::number(
- MetricField::ConvertValue(nVal_100, 2, MAP_100TH_MM, eFieldUnit));
+ MetricField::ConvertValue(nVal_100, 2, MapUnit::Map100thMM, eFieldUnit));
while( aVal.getLength() < 3 )
aVal.insert( 0, "0" );
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 2f968ccfeb56..051b23356c97 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -865,7 +865,7 @@ RecoveryDialog::RecoveryDialog(vcl::Window* pParent, RecoveryCore* pCore)
get(m_pCancelBtn, "cancel");
SvSimpleTableContainer* pFileListLBContainer = get<SvSimpleTableContainer>("filelist");
- Size aSize(LogicToPixel(Size(RECOV_CONTROLWIDTH, RECOV_FILELISTHEIGHT), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(RECOV_CONTROLWIDTH, RECOV_FILELISTHEIGHT), MapUnit::MapAppFont));
pFileListLBContainer->set_height_request(aSize.Height());
m_pFileListLB = VclPtr<RecovDocList>::Create(*pFileListLBContainer, DIALOG_MGR());
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 367b3be927a4..81d36d4f063b 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -493,7 +493,7 @@ void SvxFontPrevWindow::Init()
pImpl->mpPrinter = VclPtr<Printer>::Create();
pImpl->mbDelPrinter = true;
}
- SetMapMode(MapMode(MAP_TWIP));
+ SetMapMode(MapMode(MapUnit::MapTwip));
initFont(pImpl->maFont);
initFont(pImpl->maCJKFont);
initFont(pImpl->maCTLFont);
@@ -906,7 +906,7 @@ void SvxFontPrevWindow::SetFontSize( const SfxItemSet& rSet, sal_uInt16 nSlot, S
{
nH = LogicToLogic(static_cast<const SvxFontHeightItem&>(rSet.Get(nWhich)).GetHeight(),
(MapUnit) rSet.GetPool()->GetMetric(nWhich),
- MAP_TWIP);
+ MapUnit::MapTwip);
}
else
nH = 240;// as default 12pt
@@ -1122,7 +1122,7 @@ void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBack
{
const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>( rSet.Get( nWhich ) );
short nKern = ( short )
- LogicToLogic( rItem.GetValue(), ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ), MAP_TWIP );
+ LogicToLogic( rItem.GetValue(), ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ), MapUnit::MapTwip );
rFont.SetFixKerning( nKern );
rCJKFont.SetFixKerning( nKern );
rCTLFont.SetFixKerning( nKern );
@@ -1366,7 +1366,7 @@ void SvxFontPrevWindow::Init(const SfxItemSet& rSet)
{
const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>( rSet.Get( nWhich ) );
short nKern = ( short )
- LogicToLogic( rItem.GetValue(), ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ), MAP_TWIP );
+ LogicToLogic( rItem.GetValue(), ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ), MapUnit::MapTwip );
rFont.SetFixKerning( nKern );
rCJKFont.SetFixKerning( nKern );
rCTLFont.SetFixKerning( nKern );
diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx
index 123b4e6c0db6..166277cc42b4 100644
--- a/svx/source/dialog/fontwork.cxx
+++ b/svx/source/dialog/fontwork.cxx
@@ -421,7 +421,7 @@ void SvxFontWorkDialog::SetDistance_Impl(const XFormTextDistanceItem* pItem)
// Use HasChildPathFocus() instead of HasFocus() at SpinFields
if ( pItem && !m_pMtrFldDistance->HasChildPathFocus() )
{
- SetMetricValue(*m_pMtrFldDistance, pItem->GetValue(), MAP_100TH_MM);
+ SetMetricValue(*m_pMtrFldDistance, pItem->GetValue(), MapUnit::Map100thMM);
}
}
@@ -432,7 +432,7 @@ void SvxFontWorkDialog::SetStart_Impl(const XFormTextStartItem* pItem)
// Use HasChildPathFocus() instead of HasFocus() at SpinFields
if ( pItem && !m_pMtrFldTextStart->HasChildPathFocus() )
{
- SetMetricValue(*m_pMtrFldTextStart, pItem->GetValue(), MAP_100TH_MM);
+ SetMetricValue(*m_pMtrFldTextStart, pItem->GetValue(), MapUnit::Map100thMM);
}
}
@@ -513,8 +513,8 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
if ( bRestoreValues )
{
- SetMetricValue(*m_pMtrFldShadowX, nSaveShadowX, MAP_100TH_MM);
- SetMetricValue(*m_pMtrFldShadowY, nSaveShadowY, MAP_100TH_MM);
+ SetMetricValue(*m_pMtrFldShadowX, nSaveShadowX, MapUnit::Map100thMM);
+ SetMetricValue(*m_pMtrFldShadowY, nSaveShadowY, MapUnit::Map100thMM);
XFormTextShadowXValItem aXItem( nSaveShadowX );
XFormTextShadowYValItem aYItem( nSaveShadowY );
@@ -604,7 +604,7 @@ void SvxFontWorkDialog::SetShadowXVal_Impl(const XFormTextShadowXValItem* pItem)
}
else
{
- SetMetricValue(*m_pMtrFldShadowX, pItem->GetValue(), MAP_100TH_MM);
+ SetMetricValue(*m_pMtrFldShadowX, pItem->GetValue(), MapUnit::Map100thMM);
}
}
}
@@ -626,7 +626,7 @@ void SvxFontWorkDialog::SetShadowYVal_Impl(const XFormTextShadowYValItem* pItem)
}
else
{
- SetMetricValue(*m_pMtrFldShadowY, pItem->GetValue(), MAP_100TH_MM);
+ SetMetricValue(*m_pMtrFldShadowY, pItem->GetValue(), MapUnit::Map100thMM);
}
}
}
@@ -712,8 +712,8 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, SelectShadowHdl_Impl, ToolBox *, void)
if (nLastShadowTbxId == nShadowNormalId)
{
- nSaveShadowX = GetCoreValue(*m_pMtrFldShadowX, MAP_100TH_MM);
- nSaveShadowY = GetCoreValue(*m_pMtrFldShadowY, MAP_100TH_MM);
+ nSaveShadowX = GetCoreValue(*m_pMtrFldShadowX, MapUnit::Map100thMM);
+ nSaveShadowY = GetCoreValue(*m_pMtrFldShadowY, MapUnit::Map100thMM);
}
else if (nLastShadowTbxId == nShadowSlantId)
{
@@ -759,9 +759,9 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimoutHdl_Impl, Idle *, void)
m_pMtrFldShadowY->SetSpinSize( eDlgUnit == FUNIT_MM ? 50 : 10 );
}
- long nValue = GetCoreValue(*m_pMtrFldDistance, MAP_100TH_MM);
+ long nValue = GetCoreValue(*m_pMtrFldDistance, MapUnit::Map100thMM);
XFormTextDistanceItem aDistItem( nValue );
- nValue = GetCoreValue(*m_pMtrFldTextStart, MAP_100TH_MM);
+ nValue = GetCoreValue(*m_pMtrFldTextStart, MapUnit::Map100thMM);
XFormTextStartItem aStartItem( nValue );
sal_Int32 nValueX(0L);
@@ -773,8 +773,8 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimoutHdl_Impl, Idle *, void)
// methos regarding to the kind of value accessed.
if (nLastShadowTbxId == nShadowNormalId)
{
- nValueX = GetCoreValue(*m_pMtrFldShadowX, MAP_100TH_MM);
- nValueY = GetCoreValue(*m_pMtrFldShadowY, MAP_100TH_MM);
+ nValueX = GetCoreValue(*m_pMtrFldShadowX, MapUnit::Map100thMM);
+ nValueY = GetCoreValue(*m_pMtrFldShadowY, MapUnit::Map100thMM);
}
else if (nLastShadowTbxId == nShadowSlantId)
{
diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 26719c96ba91..4fbc52751cf6 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -1244,7 +1244,7 @@ void FrameSelector::Resize()
Size FrameSelector::GetOptimalSize() const
{
- return LogicToPixel(Size(61, 65), MAP_APPFONT);
+ return LogicToPixel(Size(61, 65), MapUnit::MapAppFont);
}
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index 37a330fdbd37..6cd7ca83500e 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -58,7 +58,7 @@ void GraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, c
GraphCtrl::GraphCtrl( vcl::Window* pParent, WinBits nStyle ) :
Control ( pParent, nStyle ),
aUpdateIdle ( "svx GraphCtrl Update" ),
- aMap100 ( MAP_100TH_MM ),
+ aMap100 ( MapUnit::Map100thMM ),
nWinStyle ( 0 ),
eObjKind ( OBJ_NONE ),
nPolyEdit ( 0 ),
@@ -195,7 +195,7 @@ void GraphCtrl::SetGraphic( const Graphic& rGraphic, bool bNewModel )
else
aGraphic = rGraphic;
- if ( aGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ if ( aGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
aGraphSize = Application::GetDefaultDevice()->PixelToLogic( aGraphic.GetPrefSize(), aMap100 );
else
aGraphSize = OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), aMap100 );
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index bc70898c7306..20c634cab5fe 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -438,8 +438,8 @@ void SvxHFPage::Reset( const SfxItemSet* rSet )
{
// defaults for distance and height
long nDefaultDist = bIsCalc ? DEF_DIST_CALC : DEF_DIST_WRITER;
- SetMetricValue( *m_pDistEdit, nDefaultDist, MAP_100TH_MM );
- SetMetricValue( *m_pHeightEdit, 500, MAP_100TH_MM );
+ SetMetricValue( *m_pDistEdit, nDefaultDist, MapUnit::Map100thMM );
+ SetMetricValue( *m_pHeightEdit, 500, MapUnit::Map100thMM );
}
if ( !pSetItem )
@@ -746,18 +746,18 @@ void SvxHFPage::UpdateExample()
if ( nId == SID_ATTR_PAGE_HEADERSET )
{
m_pBspWin->SetHeader( m_pTurnOnBox->IsChecked() );
- m_pBspWin->SetHdHeight( GetCoreValue( *m_pHeightEdit, MAP_TWIP ) );
- m_pBspWin->SetHdDist( GetCoreValue( *m_pDistEdit, MAP_TWIP ) );
- m_pBspWin->SetHdLeft( GetCoreValue( *m_pLMEdit, MAP_TWIP ) );
- m_pBspWin->SetHdRight( GetCoreValue( *m_pRMEdit, MAP_TWIP ) );
+ m_pBspWin->SetHdHeight( GetCoreValue( *m_pHeightEdit, MapUnit::MapTwip ) );
+ m_pBspWin->SetHdDist( GetCoreValue( *m_pDistEdit, MapUnit::MapTwip ) );
+ m_pBspWin->SetHdLeft( GetCoreValue( *m_pLMEdit, MapUnit::MapTwip ) );
+ m_pBspWin->SetHdRight( GetCoreValue( *m_pRMEdit, MapUnit::MapTwip ) );
}
else
{
m_pBspWin->SetFooter( m_pTurnOnBox->IsChecked() );
- m_pBspWin->SetFtHeight( GetCoreValue( *m_pHeightEdit, MAP_TWIP ) );
- m_pBspWin->SetFtDist( GetCoreValue( *m_pDistEdit, MAP_TWIP ) );
- m_pBspWin->SetFtLeft( GetCoreValue( *m_pLMEdit, MAP_TWIP ) );
- m_pBspWin->SetFtRight( GetCoreValue( *m_pRMEdit, MAP_TWIP ) );
+ m_pBspWin->SetFtHeight( GetCoreValue( *m_pHeightEdit, MapUnit::MapTwip ) );
+ m_pBspWin->SetFtDist( GetCoreValue( *m_pDistEdit, MapUnit::MapTwip ) );
+ m_pBspWin->SetFtLeft( GetCoreValue( *m_pLMEdit, MapUnit::MapTwip ) );
+ m_pBspWin->SetFtRight( GetCoreValue( *m_pRMEdit, MapUnit::MapTwip ) );
}
m_pBspWin->Invalidate();
}
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 5d8147b1d01e..f0c8b0d01868 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -84,7 +84,7 @@ void IMapWindow::dispose()
Size IMapWindow::GetOptimalSize() const
{
- return LogicToPixel(Size(270, 170), MAP_APPFONT);
+ return LogicToPixel(Size(270, 170), MapUnit::MapAppFont);
}
void IMapWindow::SetImageMap( const ImageMap& rImageMap )
diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx
index 1dc190d8b5ce..37d005ef6f4b 100644
--- a/svx/source/dialog/measctrl.cxx
+++ b/svx/source/dialog/measctrl.cxx
@@ -30,7 +30,7 @@
SvxXMeasurePreview::SvxXMeasurePreview(vcl::Window* pParent, WinBits nStyle)
: Control(pParent, nStyle)
{
- SetMapMode(MAP_100TH_MM);
+ SetMapMode(MapUnit::Map100thMM);
// Scale: 1:2
MapMode aMapMode = GetMapMode();
diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx
index f5e12ddeb840..fcff9579a5c7 100644
--- a/svx/source/dialog/pagectrl.cxx
+++ b/svx/source/dialog/pagectrl.cxx
@@ -76,7 +76,7 @@ SvxPageWindow::SvxPageWindow(vcl::Window* pParent)
eUsage(SVX_PAGE_ALL)
{
// Count in Twips by default
- SetMapMode(MapMode(MAP_TWIP));
+ SetMapMode(MapMode(MapUnit::MapTwip));
aWinSize = GetOptimalSize();
aWinSize.Height() -= 4;
aWinSize.Width() -= 4;
@@ -439,7 +439,7 @@ void SvxPageWindow::ResetBackground()
Size SvxPageWindow::GetOptimalSize() const
{
- return LogicToPixel(Size(75, 46), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(75, 46), MapMode(MapUnit::MapAppFont));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/paraprev.cxx b/svx/source/dialog/paraprev.cxx
index b43470352f9c..817429bcadad 100644
--- a/svx/source/dialog/paraprev.cxx
+++ b/svx/source/dialog/paraprev.cxx
@@ -36,7 +36,7 @@ SvxParaPrevWindow::SvxParaPrevWindow( vcl::Window* pParent, WinBits nBits) :
{
// Count in Twips by default
- SetMapMode(MapMode(MAP_TWIP));
+ SetMapMode(MapMode(MapUnit::MapTwip));
aSize = Size(11905, 16837);
diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx
index b7a3e3d359dc..f9a9a40f74b3 100644
--- a/svx/source/dialog/rubydialog.cxx
+++ b/svx/source/dialog/rubydialog.cxx
@@ -792,7 +792,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*r
{
rRenderContext.Push(PushFlags::MAPMODE);
- rRenderContext.SetMapMode(MAP_TWIP);
+ rRenderContext.SetMapMode(MapUnit::MapTwip);
Size aWinSize = rRenderContext.GetOutputSize();
@@ -909,7 +909,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*r
Size RubyPreview::GetOptimalSize() const
{
- return LogicToPixel(Size(215, 50), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(215, 50), MapMode(MapUnit::MapAppFont));
}
void RubyEdit::GetFocus()
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index e69b91c3ec72..177dd16fea87 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -2148,21 +2148,21 @@ OUString& SvxSearchDialog::BuildAttrText_Impl( OUString& rStr,
return rStr;
// Metric query
- MapUnit eMapUnit = MAP_CM;
+ MapUnit eMapUnit = MapUnit::MapCM;
FieldUnit eFieldUnit = pSh->GetModule()->GetFieldUnit();
switch ( eFieldUnit )
{
- case FUNIT_MM: eMapUnit = MAP_MM; break;
+ case FUNIT_MM: eMapUnit = MapUnit::MapMM; break;
case FUNIT_CM:
case FUNIT_M:
- case FUNIT_KM: eMapUnit = MAP_CM; break;
- case FUNIT_TWIP: eMapUnit = MAP_TWIP; break;
+ case FUNIT_KM: eMapUnit = MapUnit::MapCM; break;
+ case FUNIT_TWIP: eMapUnit = MapUnit::MapTwip; break;
case FUNIT_POINT:
- case FUNIT_PICA: eMapUnit = MAP_POINT; break;
+ case FUNIT_PICA: eMapUnit = MapUnit::MapPoint; break;
case FUNIT_INCH:
case FUNIT_FOOT:
- case FUNIT_MILE: eMapUnit = MAP_INCH; break;
- case FUNIT_100TH_MM: eMapUnit = MAP_100TH_MM; break;
+ case FUNIT_MILE: eMapUnit = MapUnit::MapInch; break;
+ case FUNIT_100TH_MM: eMapUnit = MapUnit::Map100thMM; break;
default: ;//prevent warning
}
diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx
index 25d4d226410f..19539641bbc7 100644
--- a/svx/source/dialog/swframeexample.cxx
+++ b/svx/source/dialog/swframeexample.cxx
@@ -67,7 +67,7 @@ VCL_BUILDER_FACTORY_ARGS(SvxSwFrameExample, 0)
Size SvxSwFrameExample::GetOptimalSize() const
{
- return LogicToPixel(Size(52, 86), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(52, 86), MapMode(MapUnit::MapAppFont));
}
void SvxSwFrameExample::InitColors_Impl()
@@ -474,7 +474,7 @@ Rectangle SvxSwFrameExample::DrawInnerFrame_Impl(vcl::RenderContext& rRenderCont
void SvxSwFrameExample::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
{
- rRenderContext.SetMapMode(MAP_PIXEL);
+ rRenderContext.SetMapMode(MapUnit::MapPixel);
InitAllRects_Impl(rRenderContext);
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index 0422f84e41b6..b5ed0de3e87a 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -97,7 +97,7 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p
, pConvertTo3DItem(nullptr)
, pConvertTo3DLatheItem(nullptr)
, mpImpl(new Svx3DWinImpl())
- , ePoolUnit(MAP_MM)
+ , ePoolUnit(MapUnit::MapMM)
, mpRemember2DAttributes(nullptr)
{
get(m_pBtnGeo, "geometry");
@@ -191,7 +191,7 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p
get(m_pCtlPreview, "preview");
get(m_pCtlLightPreview, "lightpreview");
- Size aSize(LogicToPixel(Size(83, 76), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(83, 76), MapUnit::MapAppFont));
m_pCtlPreview->set_width_request(aSize.Width());
m_pCtlLightPreview->set_width_request(aSize.Width());
m_pCtlPreview->set_height_request(aSize.Height());
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index a1efee19d1d4..27994a36cb4a 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -1458,7 +1458,7 @@ bool FmGridControl::isColumnMarked(sal_uInt16 nId) const
long FmGridControl::QueryMinimumRowHeight()
{
long nMinimalLogicHeight = 20; // 0.2 cm
- long nMinimalPixelHeight = LogicToPixel( Point( 0, nMinimalLogicHeight ), MAP_10TH_MM ).Y();
+ long nMinimalPixelHeight = LogicToPixel( Point( 0, nMinimalLogicHeight ), MapUnit::Map10thMM ).Y();
return CalcZoom( nMinimalPixelHeight );
}
@@ -1473,7 +1473,7 @@ void FmGridControl::RowHeightChanged()
try
{
sal_Int32 nUnzoomedPixelHeight = CalcReverseZoom( GetDataRowHeight() );
- Any aProperty = makeAny( (sal_Int32)PixelToLogic( Point( 0, nUnzoomedPixelHeight ), MAP_10TH_MM ).Y() );
+ Any aProperty = makeAny( (sal_Int32)PixelToLogic( Point( 0, nUnzoomedPixelHeight ), MapUnit::Map10thMM ).Y() );
xModel->setPropertyValue( FM_PROP_ROWHEIGHT, aProperty );
}
catch( const Exception& )
@@ -1496,7 +1496,7 @@ void FmGridControl::ColumnResized(sal_uInt16 nId)
sal_Int32 nColumnWidth = GetColumnWidth(nId);
nColumnWidth = CalcReverseZoom(nColumnWidth);
// Umrechnen in 10THMM
- aWidth <<= (sal_Int32)PixelToLogic(Point(nColumnWidth,0),MAP_10TH_MM).X();
+ aWidth <<= (sal_Int32)PixelToLogic(Point(nColumnWidth,0),MapUnit::Map10thMM).X();
xColModel->setPropertyValue(FM_PROP_WIDTH, aWidth);
}
}
@@ -1589,7 +1589,7 @@ void FmGridControl::InitColumnsByModels(const Reference< css::container::XIndexC
aWidth = xCol->getPropertyValue(FM_PROP_WIDTH);
sal_Int32 nWidth = 0;
if (aWidth >>= nWidth)
- nWidth = LogicToPixel(Point(nWidth,0),MAP_10TH_MM).X();
+ nWidth = LogicToPixel(Point(nWidth,0),MapUnit::Map10thMM).X();
AppendColumn(aName, (sal_uInt16)nWidth);
DbGridColumn* pCol = DbGridControl::GetColumns().at( i );
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index dcc54523cde0..a14585b6b967 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -1416,7 +1416,7 @@ void FmXGridPeer::propertyChange(const PropertyChangeEvent& evt) throw( RuntimeE
sal_Int32 nTest = 0;
if (evt.NewValue >>= nTest)
{
- nWidth = pGrid->LogicToPixel(Point(nTest,0),MAP_10TH_MM).X();
+ nWidth = pGrid->LogicToPixel(Point(nTest,0),MapUnit::Map10thMM).X();
// take the zoom factor into account
nWidth = pGrid->CalcZoom(nWidth);
}
@@ -1731,7 +1731,7 @@ void FmXGridPeer::elementInserted(const ContainerEvent& evt) throw( RuntimeExcep
Any aWidth = xNewColumn->getPropertyValue(FM_PROP_WIDTH);
sal_Int32 nWidth = 0;
if (aWidth >>= nWidth)
- nWidth = pGrid->LogicToPixel(Point(nWidth,0),MAP_10TH_MM).X();
+ nWidth = pGrid->LogicToPixel(Point(nWidth,0),MapUnit::Map10thMM).X();
pGrid->AppendColumn(aName, (sal_uInt16)nWidth, (sal_Int16)::comphelper::getINT32(evt.Accessor));
@@ -1774,7 +1774,7 @@ void FmXGridPeer::elementReplaced(const ContainerEvent& evt) throw( RuntimeExcep
Any aWidth = xNewColumn->getPropertyValue(FM_PROP_WIDTH);
sal_Int32 nWidth = 0;
if (aWidth >>= nWidth)
- nWidth = pGrid->LogicToPixel(Point(nWidth,0),MAP_10TH_MM).X();
+ nWidth = pGrid->LogicToPixel(Point(nWidth,0),MapUnit::Map10thMM).X();
sal_uInt16 nNewId = pGrid->AppendColumn(aName, (sal_uInt16)nWidth, (sal_Int16)::comphelper::getINT32(evt.Accessor));
sal_uInt16 nNewPos = pGrid->GetModelColumnPos(nNewId);
@@ -1965,7 +1965,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
sal_Int32 nLogHeight(0);
if (Value >>= nLogHeight)
{
- sal_Int32 nHeight = pGrid->LogicToPixel(Point(0,nLogHeight),MAP_10TH_MM).Y();
+ sal_Int32 nHeight = pGrid->LogicToPixel(Point(0,nLogHeight),MapUnit::Map10thMM).Y();
// take the zoom factor into account
nHeight = pGrid->CalcZoom(nHeight);
pGrid->SetDataRowHeight(nHeight);
@@ -2057,7 +2057,7 @@ Any FmXGridPeer::getProperty( const OUString& _rPropertyName ) throw( RuntimeExc
sal_Int32 nPixelHeight = pGrid->GetDataRowHeight();
// take the zoom factor into account
nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight);
- aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0,nPixelHeight),MAP_10TH_MM).Y();
+ aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0,nPixelHeight),MapUnit::Map10thMM).Y();
}
else if ( _rPropertyName == FM_PROP_HASNAVIGATION )
{
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 454a5b227322..6834a812332a 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -427,7 +427,7 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls()
Rectangle aRect(static_cast<DbGridControl*>(GetParent())->GetControlArea());
long nH = aRect.GetSize().Height();
long nW = GetParent()->GetOutputSizePixel().Width();
- Size aBorder = LogicToPixel(Size(2, 2),MAP_APPFONT);
+ Size aBorder = LogicToPixel(Size(2, 2),MapUnit::MapAppFont);
aBorder = Size(CalcZoom(aBorder.Width()), CalcZoom(aBorder.Height()));
sal_uInt16 nX = 1;
sal_uInt16 nY = 0;
@@ -436,7 +436,7 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls()
if (m_aAbsolute->GetTextHeight() > nH)
{
vcl::Font aApplFont (m_aAbsolute->GetFont());
- const Size pointAbsoluteSize(m_aAbsolute->PixelToLogic( Size( 0, nH - 2 ), MapMode(MAP_POINT) ));
+ const Size pointAbsoluteSize(m_aAbsolute->PixelToLogic( Size( 0, nH - 2 ), MapMode(MapUnit::MapPoint) ));
aApplFont.SetFontSize( pointAbsoluteSize );
m_aAbsolute->SetControlFont( aApplFont );
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 115e96dfa524..077a88f0ef39 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -314,7 +314,7 @@ namespace svxform
{
get(m_pToolBox, "toolbar");
get(m_pItemList, "items");
- Size aSize(LogicToPixel(Size(63, 100), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(63, 100), MapUnit::MapAppFont));
m_pItemList->set_width_request(aSize.Width());
m_pItemList->set_height_request(aSize.Height());
@@ -2155,7 +2155,7 @@ namespace svxform
SetText( SVX_RES( RID_STR_DATANAVIGATOR ) );
Size aSize = m_aDataWin->GetOutputSizePixel();
- Size aLogSize = PixelToLogic( aSize, MAP_APPFONT );
+ Size aLogSize = PixelToLogic( aSize, MapUnit::MapAppFont );
SfxDockingWindow::SetFloatingSize( aLogSize );
m_aDataWin->Show();
@@ -2213,13 +2213,13 @@ namespace svxform
{
SfxDockingWindow::Resize();
- Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MAP_APPFONT );
+ Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MapUnit::MapAppFont );
Size aLogExplSize = aLogOutputSize;
aLogExplSize.Width() -= 2;
aLogExplSize.Height() -= 2;
- Point aExplPos = LogicToPixel( Point(1,1), MAP_APPFONT );
- Size aExplSize = LogicToPixel( aLogExplSize, MAP_APPFONT );
+ Point aExplPos = LogicToPixel( Point(1,1), MapUnit::MapAppFont );
+ Size aExplSize = LogicToPixel( aLogExplSize, MapUnit::MapAppFont );
m_aDataWin->SetPosSizePixel( aExplPos, aExplSize );
}
@@ -2630,7 +2630,7 @@ namespace svxform
SAL_WARN( "svx.form", "AddDataItemDialog::InitFromNode(): exception caught" );
}
- Size a3and1Sz = LogicToPixel( Size( 3, 1 ), MAP_APPFONT );
+ Size a3and1Sz = LogicToPixel( Size( 3, 1 ), MapUnit::MapAppFont );
Size aNewSz = m_pDefaultED->GetSizePixel();
Point aNewPnt = m_pDefaultED->GetPosPixel();
aNewPnt.Y() += a3and1Sz.Height();
@@ -2894,7 +2894,7 @@ namespace svxform
SvSimpleTableContainer* pNamespacesListContainer =
get<SvSimpleTableContainer>("namespaces");
Size aControlSize(175, 72);
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
pNamespacesListContainer->set_width_request(aControlSize.Width());
pNamespacesListContainer->set_height_request(aControlSize.Height());
m_pNamespacesList = VclPtr<SvSimpleTable>::Create(*pNamespacesListContainer, 0);
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index d1a3773a8b68..b9afc8992bc7 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -1936,13 +1936,13 @@ void FmFilterNavigatorWin::Resize()
{
SfxDockingWindow::Resize();
- Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MAP_APPFONT );
+ Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MapUnit::MapAppFont );
Size aLogExplSize = aLogOutputSize;
aLogExplSize.Width() -= 6;
aLogExplSize.Height() -= 6;
- Point aExplPos = LogicToPixel( Point(3,3), MAP_APPFONT );
- Size aExplSize = LogicToPixel( aLogExplSize, MAP_APPFONT );
+ Point aExplPos = LogicToPixel( Point(3,3), MapUnit::MapAppFont );
+ Size aExplSize = LogicToPixel( aLogExplSize, MapUnit::MapAppFont );
m_pNavigator->SetPosSizePixel( aExplPos, aExplSize );
}
diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx
index 3ca6326362b0..755403338a2f 100644
--- a/svx/source/form/fmexpl.cxx
+++ b/svx/source/form/fmexpl.cxx
@@ -587,13 +587,13 @@ namespace svxform
{
SfxDockingWindow::Resize();
- Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MAP_APPFONT );
+ Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MapUnit::MapAppFont );
Size aLogExplSize = aLogOutputSize;
aLogExplSize.Width() -= 6;
aLogExplSize.Height() -= 6;
- Point aExplPos = LogicToPixel( Point(3,3), MAP_APPFONT );
- Size aExplSize = LogicToPixel( aLogExplSize, MAP_APPFONT );
+ Point aExplPos = LogicToPixel( Point(3,3), MapUnit::MapAppFont );
+ Size aExplSize = LogicToPixel( aLogExplSize, MapUnit::MapAppFont );
m_pNavigatorTree->SetPosSizePixel( aExplPos, aExplSize );
}
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 3ee22cca727c..4890141215b5 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -1475,7 +1475,7 @@ SdrObject* FmXFormView::implCreateXFormsControl( const svx::OXFormsDescriptor &_
// create a button control
const MapMode eTargetMode( pOutDev->GetMapMode() );
- const MapMode eSourceMode(MAP_100TH_MM);
+ const MapMode eSourceMode(MapUnit::Map100thMM);
const sal_uInt16 nObjID = OBJ_FM_BUTTON;
::Size controlSize(4000, 500);
FmFormObj *pControl = static_cast<FmFormObj*>(SdrObjFactory::MakeNewObject( FmFormInventor, nObjID, nullptr ));
@@ -1556,7 +1556,7 @@ bool FmXFormView::createControlLabelPair( OutputDevice& _rOutDev, sal_Int32 _nXO
::Size aTextSize( _rOutDev.GetTextWidth(sFieldName + _rFieldPostfix), _rOutDev.GetTextHeight() );
MapMode eTargetMode( _rOutDev.GetMapMode() ),
- eSourceMode( MAP_100TH_MM );
+ eSourceMode( MapUnit::Map100thMM );
// Textbreite ist mindestens 4cm
// Texthoehe immer halber cm
diff --git a/svx/source/gallery2/GalleryControl.cxx b/svx/source/gallery2/GalleryControl.cxx
index 99f3f06663e5..f9070492b3a0 100644
--- a/svx/source/gallery2/GalleryControl.cxx
+++ b/svx/source/gallery2/GalleryControl.cxx
@@ -133,7 +133,7 @@ void GalleryControl::Resize()
}
mbIsInitialResize = false;
- const long nFrameLen = LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width();
+ const long nFrameLen = LogicToPixel( Size( 3, 0 ), MapUnit::MapAppFont ).Width();
const long nFrameLen2 = nFrameLen << 1;
if(bNewLayoutHorizontal)
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index dd53ecef93ca..e4316449a632 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -181,7 +181,7 @@ sal_uIntPtr GalleryBrowser1::ImplInsertThemeEntry( const GalleryThemeEntry* pEnt
void GalleryBrowser1::ImplAdjustControls()
{
const Size aOutSize( GetOutputSizePixel() );
- const long nNewThemeHeight = LogicToPixel( Size( 0, 14 ), MAP_APPFONT ).Height();
+ const long nNewThemeHeight = LogicToPixel( Size( 0, 14 ), MapUnit::MapAppFont ).Height();
const long nStartY = nNewThemeHeight + 4;
maNewTheme->SetPosSizePixel( Point(),
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index e5436375fcc5..117997126d8e 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -59,7 +59,7 @@ VCL_BUILDER_DECL_FACTORY(GalleryPreview)
Size GalleryPreview::GetOptimalSize() const
{
- return LogicToPixel(Size(70, 88), MAP_APPFONT);
+ return LogicToPixel(Size(70, 88), MapUnit::MapAppFont);
}
bool GalleryPreview::SetGraphic( const INetURLObject& _aURL )
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index 70c9ad68d002..48fdd15d11ff 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -139,7 +139,7 @@ bool GallerySvDrawImport( SvStream& rIStm, SdrModel& rModel )
// read as XML
uno::Reference< io::XInputStream > xInputStream( new utl::OInputStreamWrapper( rIStm ) );
- rModel.GetItemPool().SetDefaultMetric( MAP_100TH_MM );
+ rModel.GetItemPool().SetDefaultMetric( MapUnit::Map100thMM );
uno::Reference< lang::XComponent > xComponent;
bRet = SvxDrawingLayerImport( &rModel, xInputStream, xComponent, "com.sun.star.comp.Draw.XMLOasisImporter" );
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 2a05f697ddb9..45af5e587330 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -100,11 +100,11 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic )
if( aBmpSize.Width() && aBmpSize.Height() )
{
- if( aBmpEx.GetPrefMapMode().GetMapUnit() != MAP_PIXEL &&
+ if( aBmpEx.GetPrefMapMode().GetMapUnit() != MapUnit::MapPixel &&
aBmpEx.GetPrefSize().Width() > 0 &&
aBmpEx.GetPrefSize().Height() > 0 )
{
- Size aLogSize( OutputDevice::LogicToLogic( aBmpEx.GetPrefSize(), aBmpEx.GetPrefMapMode(), MAP_100TH_MM ) );
+ Size aLogSize( OutputDevice::LogicToLogic( aBmpEx.GetPrefSize(), aBmpEx.GetPrefMapMode(), MapUnit::Map100thMM ) );
if( aLogSize.Width() > 0 && aLogSize.Height() > 0 )
{
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 81a7a6af356f..45969cb56e34 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -801,7 +801,7 @@ bool GalleryTheme::GetGraphic( sal_uIntPtr nPos, Graphic& rGraphic, bool bProgre
else
{
ScopedVclPtrInstance< VirtualDevice > pVDev;
- pVDev->SetMapMode( MapMode( MAP_100TH_MM ) );
+ pVDev->SetMapMode( MapMode( MapUnit::Map100thMM ) );
FmFormView aView( aModel.GetModel(), pVDev );
aView.hideMarkHandles();
diff --git a/svx/source/items/grfitem.cxx b/svx/source/items/grfitem.cxx
index c76e654a447c..f338b7553d1a 100644
--- a/svx/source/items/grfitem.cxx
+++ b/svx/source/items/grfitem.cxx
@@ -144,10 +144,10 @@ bool SvxGrfCrop::GetPresentation(
case SfxItemPresentation::Nameless:
return true;
case SfxItemPresentation::Complete:
- rText = "L: " + OUString(::GetMetricText( GetLeft(), eCoreUnit, MAP_MM, pIntl )) +
- " R: " + OUString(::GetMetricText( GetRight(), eCoreUnit, MAP_MM, pIntl )) +
- " T: " + OUString(::GetMetricText( GetTop(), eCoreUnit, MAP_MM, pIntl )) +
- " B: " + OUString(::GetMetricText( GetBottom(), eCoreUnit, MAP_MM, pIntl ));
+ rText = "L: " + OUString(::GetMetricText( GetLeft(), eCoreUnit, MapUnit::MapMM, pIntl )) +
+ " R: " + OUString(::GetMetricText( GetRight(), eCoreUnit, MapUnit::MapMM, pIntl )) +
+ " T: " + OUString(::GetMetricText( GetTop(), eCoreUnit, MapUnit::MapMM, pIntl )) +
+ " B: " + OUString(::GetMetricText( GetBottom(), eCoreUnit, MapUnit::MapMM, pIntl ));
return true;
break;
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 8cb09022e000..c4c336bff959 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -106,13 +106,13 @@ namespace sdr
// safe to assume 100th mm as target.
Size aPrefSize(GetGrafObject().GetGrafPrefSize());
- if(MAP_PIXEL == GetGrafObject().GetGrafPrefMapMode().GetMapUnit())
+ if(MapUnit::MapPixel == GetGrafObject().GetGrafPrefMapMode().GetMapUnit())
{
- aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM);
+ aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapUnit::Map100thMM);
}
else
{
- aPrefSize = OutputDevice::LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MAP_100TH_MM);
+ aPrefSize = OutputDevice::LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MapUnit::Map100thMM);
}
// decompose object matrix to get single values
@@ -198,13 +198,13 @@ namespace sdr
{
Size aPrefSize(aDraftBitmap.GetPrefSize());
- if(MAP_PIXEL == aDraftBitmap.GetPrefMapMode().GetMapUnit())
+ if(MapUnit::MapPixel == aDraftBitmap.GetPrefMapMode().GetMapUnit())
{
- aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MAP_100TH_MM);
+ aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MapUnit::Map100thMM);
}
else
{
- aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MAP_100TH_MM);
+ aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MapUnit::Map100thMM);
}
const double fBitmapScaling(2.0);
diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx
index c744f2923793..6438bc762115 100644
--- a/svx/source/sdr/overlay/overlayobjectlist.cxx
+++ b/svx/source/sdr/overlay/overlayobjectlist.cxx
@@ -79,8 +79,8 @@ namespace sdr
if (comphelper::LibreOfficeKit::isActive())
{
aSizeLogic = Size(DEFAULT_VALUE_FOR_HITTEST_TWIP, DEFAULT_VALUE_FOR_HITTEST_TWIP);
- if (pManager->getOutputDevice().GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aSizeLogic = OutputDevice::LogicToLogic(aSizeLogic, MAP_TWIP, MAP_100TH_MM);
+ if (pManager->getOutputDevice().GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aSizeLogic = OutputDevice::LogicToLogic(aSizeLogic, MapUnit::MapTwip, MapUnit::Map100thMM);
}
fLogicTolerance = aSizeLogic.Width();
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index bbfbbd87d8fa..e150b19469f5 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -642,7 +642,7 @@ namespace drawinglayer
if(GraphicType::Bitmap == aGraphic.GetType())
{
aGraphic.SetPrefSize(aGraphic.GetBitmapEx().GetSizePixel());
- aGraphic.SetPrefMapMode(MAP_PIXEL);
+ aGraphic.SetPrefMapMode(MapUnit::MapPixel);
}
}
@@ -659,11 +659,11 @@ namespace drawinglayer
if(aGraphic.GetPrefMapMode() != aDestinationMapUnit)
{
- // #i100360# for MAP_PIXEL, LogicToLogic will not work properly,
+ // #i100360# for MapUnit::MapPixel, LogicToLogic will not work properly,
// so fallback to Application::GetDefaultDevice()
Size aNewSize(0, 0);
- if(MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit())
+ if(MapUnit::MapPixel == aGraphic.GetPrefMapMode().GetMapUnit())
{
aNewSize = Application::GetDefaultDevice()->PixelToLogic(
aGraphic.GetPrefSize(),
diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
index 276f68d98452..a4fa9e4f3419 100644
--- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -73,13 +73,13 @@ namespace drawinglayer
// get PrefSize from the graphic in 100th mm
Size aPrefSize(aGraphic.GetPrefSize());
- if(MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit())
+ if(MapUnit::MapPixel == aGraphic.GetPrefMapMode().GetMapUnit())
{
- aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM);
+ aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapUnit::Map100thMM);
}
else
{
- aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MAP_100TH_MM);
+ aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MapUnit::Map100thMM);
}
const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 2.0);
diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx
index dc50fb1f8b00..922f104b6e6e 100644
--- a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx
+++ b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx
@@ -30,24 +30,24 @@
namespace svx { namespace sidebar {
// positioning helpers
-#define APOS1_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MAP_APPFONT))
-#define APOS2_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MAP_APPFONT))
-#define APOS1_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MAP_APPFONT))
-#define APOS2_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MAP_APPFONT))
-#define APOS1_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT))
-#define APOS1_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT))
-#define APOS2_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT))
-#define APOS2_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT))
-#define APOS1_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
-#define APOS1_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
-#define APOS2_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
-#define APOS2_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
-#define APOS1_7 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
-#define APOS1_8 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 4*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+3*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
-#define APOS_Left_Right_1 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y1), MAP_APPFONT))
-#define APOS_Left_Right_2 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y1), MAP_APPFONT))
-#define APOS_Left_Right_3 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y2), MAP_APPFONT))
-#define APOS_Left_Right_4 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y2), MAP_APPFONT))
+#define APOS1_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MapUnit::MapAppFont))
+#define APOS2_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
+#define APOS1_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MapUnit::MapAppFont))
+#define APOS2_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
+#define APOS1_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
+#define APOS1_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
+#define APOS2_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
+#define APOS2_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
+#define APOS1_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
+#define APOS1_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
+#define APOS2_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
+#define APOS2_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
+#define APOS1_7 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
+#define APOS1_8 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 4*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+3*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
+#define APOS_Left_Right_1 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y1), MapUnit::MapAppFont))
+#define APOS_Left_Right_2 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y1), MapUnit::MapAppFont))
+#define APOS_Left_Right_3 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y2), MapUnit::MapAppFont))
+#define APOS_Left_Right_4 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y2), MapUnit::MapAppFont))
AreaTransparencyGradientControl::AreaTransparencyGradientControl (
vcl::Window* pParent,
@@ -128,9 +128,9 @@ void AreaTransparencyGradientControl::Rearrange(XFillFloatTransparenceItem* pGra
const XGradient& rGradient = pGradientItem->GetGradientValue();
css::awt::GradientStyle eXGS(rGradient.GetGradientStyle());
Size aSize(POP_WIDTH,POP_HEIGHT);
- aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
+ aSize = LogicToPixel( aSize, MapMode(MapUnit::MapAppFont) );
Size aSize2(POP_WIDTH,POP_HEIGHT2);
- aSize2 = LogicToPixel( aSize2, MapMode(MAP_APPFONT) );
+ aSize2 = LogicToPixel( aSize2, MapMode(MapUnit::MapAppFont) );
long aPosY = 0;
Point aPointAngle;
Size aSizeAngle = maMtrTrgrAngle->GetSizePixel();
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 4d1ff4a309f1..2047408efd12 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -165,7 +165,7 @@ LinePropertyPanelBase::LinePropertyPanelBase(
mpStyleItem(),
mpDashItem(),
mnTrans(0),
- meMapUnit(MAP_MM),
+ meMapUnit(MapUnit::MapMM),
mnWidthCoreValue(0),
mpStartItem(),
mpEndItem(),
@@ -705,7 +705,7 @@ void LinePropertyPanelBase::SetWidthIcon()
return;
}
- long nVal = LogicToLogic(mnWidthCoreValue * 10,(MapUnit)meMapUnit , MAP_POINT);
+ long nVal = LogicToLogic(mnWidthCoreValue * 10,(MapUnit)meMapUnit , MapUnit::MapPoint);
const sal_uInt16 nIdWidth = mpTBWidth->GetItemId(UNO_SELECTWIDTH);
if(nVal <= 6)
diff --git a/svx/source/sidebar/line/LineWidthPopup.cxx b/svx/source/sidebar/line/LineWidthPopup.cxx
index b455758f8216..52f60d0b67bc 100644
--- a/svx/source/sidebar/line/LineWidthPopup.cxx
+++ b/svx/source/sidebar/line/LineWidthPopup.cxx
@@ -32,7 +32,7 @@ LineWidthPopup::LineWidthPopup(LinePropertyPanelBase& rParent)
, m_rParent(rParent)
, m_pStr(nullptr)
, m_sPt(SVX_RESSTR(RID_SVXSTR_PT))
- , m_eMapUnit(MAP_TWIP)
+ , m_eMapUnit(MapUnit::MapTwip)
, m_bVSFocus(true)
, m_bCustom(false)
, m_bCloseByEdit(false)
@@ -116,7 +116,7 @@ IMPL_LINK(LineWidthPopup, VSSelectHdl, ValueSet*, /*pControl*/, void)
sal_uInt16 iPos = m_xVSWidth->GetSelectItemId();
if (iPos >= 1 && iPos <= 8)
{
- sal_IntPtr nVal = LogicToLogic(reinterpret_cast<sal_IntPtr>(m_xVSWidth->GetItemData( iPos )), MAP_POINT, (MapUnit)m_eMapUnit);
+ sal_IntPtr nVal = LogicToLogic(reinterpret_cast<sal_IntPtr>(m_xVSWidth->GetItemData( iPos )), MapUnit::MapPoint, (MapUnit)m_eMapUnit);
nVal = m_xMFWidth->Denormalize(nVal);
XLineWidthItem aWidthItem( nVal );
m_rParent.setLineWidth(aWidthItem);
@@ -130,7 +130,7 @@ IMPL_LINK(LineWidthPopup, VSSelectHdl, ValueSet*, /*pControl*/, void)
//modified
if (m_bCustom)
{
- long nVal = LogicToLogic(m_nCustomWidth , MAP_POINT, (MapUnit)m_eMapUnit);
+ long nVal = LogicToLogic(m_nCustomWidth , MapUnit::MapPoint, (MapUnit)m_eMapUnit);
nVal = m_xMFWidth->Denormalize(nVal);
XLineWidthItem aWidthItem( nVal );
m_rParent.setLineWidth(aWidthItem);
@@ -165,7 +165,7 @@ IMPL_LINK(LineWidthPopup, MFModifyHdl, Edit&, /*rControl*/, void)
m_xVSWidth->StartSelection();
}
long nTmp = static_cast<long>(m_xMFWidth->GetValue());
- long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)m_eMapUnit );
+ long nVal = LogicToLogic( nTmp, MapUnit::MapPoint, (MapUnit)m_eMapUnit );
sal_Int32 nNewWidth = (short)m_xMFWidth->Denormalize( nVal );
XLineWidthItem aWidthItem(nNewWidth);
m_rParent.setLineWidth(aWidthItem);
@@ -208,7 +208,7 @@ void LineWidthPopup::SetWidthSelect(long lValue, bool bValuable, MapUnit eMapUni
if (bValuable)
{
- sal_Int64 nVal = OutputDevice::LogicToLogic(lValue, (MapUnit) eMapUnit, MAP_100TH_MM );
+ sal_Int64 nVal = OutputDevice::LogicToLogic(lValue, (MapUnit) eMapUnit, MapUnit::Map100thMM );
nVal = m_xMFWidth->Normalize(nVal);
m_xMFWidth->SetValue( nVal, FUNIT_100TH_MM );
}
diff --git a/svx/source/sidebar/line/LineWidthValueSet.cxx b/svx/source/sidebar/line/LineWidthValueSet.cxx
index 0d7503fac64b..7b406b4575a6 100644
--- a/svx/source/sidebar/line/LineWidthValueSet.cxx
+++ b/svx/source/sidebar/line/LineWidthValueSet.cxx
@@ -173,7 +173,7 @@ void LineWidthValueSet::UserDraw( const UserDrawEvent& rUDEvt )
Size LineWidthValueSet::GetOptimalSize() const
{
- return LogicToPixel(Size(80, 12 * 9), MAP_APPFONT);
+ return LogicToPixel(Size(80, 12 * 9), MapUnit::MapAppFont);
}
} } // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 765e0f80a900..e4b3a0f1460f 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -154,7 +154,7 @@ void NBOTypeMgrBase::ImplLoad(const OUString& filename)
{
bIsLoading = true;
MapUnit eOldCoreUnit=eCoreUnit;
- eCoreUnit = MAP_100TH_MM;
+ eCoreUnit = MapUnit::Map100thMM;
INetURLObject aFile( SvtPathOptions().GetUserConfigPath() );
aFile.Append( filename);
std::unique_ptr<SvStream> xIStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ));
@@ -193,7 +193,7 @@ void NBOTypeMgrBase::ImplStore(const OUString& filename)
{
if (bIsLoading) return;
MapUnit eOldCoreUnit=eCoreUnit;
- eCoreUnit = MAP_100TH_MM;
+ eCoreUnit = MapUnit::Map100thMM;
INetURLObject aFile( SvtPathOptions().GetUserConfigPath() );
aFile.Append( filename);
std::unique_ptr<SvStream> xOStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE ));
@@ -975,7 +975,7 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1
aSize = SvxNumberFormat::GetGraphicSizeMM100( pGrf );
}
}
- aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)GetMapUnit());
+ aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, (MapUnit)GetMapUnit());
aFmt.SetGraphicBrush( pLevelSettings->pBrushItem, &aSize, &eOrient );
}
} else
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
index f58cb6bc11ad..46ca5b89fcd8 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
@@ -62,7 +62,7 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId)
mpActLineDistFld = mpLineDistAtPercentBox.get();
- meLNSpaceUnit = MAP_100TH_MM;
+ meLNSpaceUnit = MapUnit::Map100thMM;
Link<Button*,void> aLink = LINK(this, ParaLineSpacingControl, PredefinedValuesHandler);
mpSpacing1Button->SetClickHdl(aLink);
@@ -120,7 +120,7 @@ void ParaLineSpacingControl::Initialize()
if( eState >= SfxItemState::DEFAULT )
{
- MapUnit eUnit = MAP_100TH_MM;
+ MapUnit eUnit = MapUnit::Map100thMM;
meLNSpaceUnit = eUnit;
switch( currSPItem->GetLineSpaceRule() )
@@ -309,7 +309,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
mpLineDistAtMetricBox->SetMin(mpLineDistAtMetricBox->Normalize(MIN_FIXED_DISTANCE), FUNIT_TWIP);
if (mpLineDistAtMetricBox->GetValue() != nTemp)
- SetMetricValue(*mpLineDistAtMetricBox, FIX_DIST_DEF, MAP_TWIP);
+ SetMetricValue(*mpLineDistAtMetricBox, FIX_DIST_DEF, MapUnit::MapTwip);
mpLineDistLabel->Enable();
mpActLineDistFld->Show();
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index b3e7e078145d..1f288e9deeaa 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -136,7 +136,7 @@ void ParaPropertyPanel::HandleContextChange (
mpToolBoxHighlight->Hide();
Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT);
- aSize = LogicToPixel( aSize,MapMode(MAP_APPFONT) );
+ aSize = LogicToPixel( aSize,MapMode(MapUnit::MapAppFont) );
aSize.setWidth(GetOutputSizePixel().Width());
SetSizePixel(aSize);
}*/
@@ -225,8 +225,8 @@ IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl, v
SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
maTxtLeft += INDENT_STEP;
- sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MAP_TWIP), MAP_100TH_MM );
- nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+ sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM );
+ nVal = OutputDevice::LogicToLogic( (long)nVal, MapUnit::Map100thMM, (MapUnit)m_eLRSpaceUnit );
aMargin.SetTextLeft( (const long)nVal );
aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) );
aMargin.SetTextFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ) );
@@ -258,8 +258,8 @@ IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl, v
SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
- sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MAP_TWIP), MAP_100TH_MM );
- nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+ sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM );
+ nVal = OutputDevice::LogicToLogic( (long)nVal, MapUnit::Map100thMM, (MapUnit)m_eLRSpaceUnit );
aMargin.SetTextLeft( (const long)nVal );
aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) );
@@ -369,18 +369,18 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat
{
const SvxLRSpaceItem* pSpace = static_cast<const SvxLRSpaceItem*>(pState);
maTxtLeft = pSpace->GetTextLeft();
- maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
- maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, MAP_100TH_MM, (MapUnit)(MAP_TWIP) );
+ maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)m_eLRSpaceUnit, MapUnit::Map100thMM );
+ maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, MapUnit::Map100thMM, (MapUnit)(MapUnit::MapTwip) );
long aTxtRight = pSpace->GetRight();
- aTxtRight = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
- aTxtRight = OutputDevice::LogicToLogic( aTxtRight, MAP_100TH_MM, (MapUnit)(MAP_TWIP) );
+ aTxtRight = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)m_eLRSpaceUnit, MapUnit::Map100thMM );
+ aTxtRight = OutputDevice::LogicToLogic( aTxtRight, MapUnit::Map100thMM, (MapUnit)(MapUnit::MapTwip) );
long aTxtFirstLineOfst = pSpace->GetTextFirstLineOfst();
- aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
- aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MAP_100TH_MM, (MapUnit)(MAP_TWIP) );
+ aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)m_eLRSpaceUnit, MapUnit::Map100thMM );
+ aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MapUnit::Map100thMM, (MapUnit)(MapUnit::MapTwip) );
- long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MAP_TWIP), MAP_100TH_MM );
+ long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM );
nVal = (long)mpLeftIndent->Normalize( (long)nVal );
if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text)
@@ -390,7 +390,7 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat
mpFLineIndent->SetMin( nVal*(-1), FUNIT_100TH_MM );
}
- long nrVal = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)(MAP_TWIP), MAP_100TH_MM );
+ long nrVal = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM );
nrVal = (long)mpRightIndent->Normalize( (long)nrVal );
switch (maContext.GetCombinedContext_DI())
@@ -421,7 +421,7 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat
mpLeftIndent->SetValue( nVal, FUNIT_100TH_MM );
mpRightIndent->SetValue( nrVal, FUNIT_100TH_MM );
- long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(MAP_TWIP), MAP_100TH_MM );
+ long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM );
nfVal = (long)mpFLineIndent->Normalize( (long)nfVal );
mpFLineIndent->SetValue( nfVal, FUNIT_100TH_MM );
@@ -475,18 +475,18 @@ void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /*nSID*/, SfxItemState eS
const SvxULSpaceItem* pOldItem = static_cast<const SvxULSpaceItem*>(pState);
maUpper = pOldItem->GetUpper();
- maUpper = OutputDevice::LogicToLogic( maUpper, (MapUnit)m_eULSpaceUnit, MAP_100TH_MM );
- maUpper = OutputDevice::LogicToLogic( maUpper, MAP_100TH_MM, (MapUnit)(MAP_TWIP) );
+ maUpper = OutputDevice::LogicToLogic( maUpper, (MapUnit)m_eULSpaceUnit, MapUnit::Map100thMM );
+ maUpper = OutputDevice::LogicToLogic( maUpper, MapUnit::Map100thMM, (MapUnit)(MapUnit::MapTwip) );
maLower = pOldItem->GetLower();
- maLower = OutputDevice::LogicToLogic( maLower, (MapUnit)m_eULSpaceUnit, MAP_100TH_MM );
- maLower = OutputDevice::LogicToLogic( maLower, MAP_100TH_MM, (MapUnit)(MAP_TWIP) );
+ maLower = OutputDevice::LogicToLogic( maLower, (MapUnit)m_eULSpaceUnit, MapUnit::Map100thMM );
+ maLower = OutputDevice::LogicToLogic( maLower, MapUnit::Map100thMM, (MapUnit)(MapUnit::MapTwip) );
- sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(MAP_TWIP), MAP_100TH_MM );
+ sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM );
nVal = mpTopDist->Normalize( nVal );
mpTopDist->SetValue( nVal, FUNIT_100TH_MM );
- nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(MAP_TWIP), MAP_100TH_MM );
+ nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(MapUnit::MapTwip), MapUnit::Map100thMM );
nVal = mpBottomDist->Normalize( nVal );
mpBottomDist->SetValue( nVal, FUNIT_100TH_MM );
}
diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
index 576da6087e28..41a7e45bab1c 100644
--- a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
+++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
@@ -36,7 +36,7 @@ using namespace svx;
ParaULSpacingWindow::ParaULSpacingWindow(vcl::Window* pParent, css::uno::Reference<css::frame::XFrame>& xFrame)
: VclVBox(pParent)
- , m_eUnit(MAP_TWIP)
+ , m_eUnit(MapUnit::MapTwip)
{
m_pUIBuilder = new VclBuilder(this, getUIRootDir(),
"svx/ui/paraulspacing.ui",
@@ -105,7 +105,7 @@ IMPL_LINK_NOARG(ParaULSpacingWindow, ModifySpacingHdl, Edit&, void)
ParaLRSpacingWindow::ParaLRSpacingWindow(vcl::Window* pParent, css::uno::Reference<css::frame::XFrame>& xFrame)
: VclVBox(pParent)
- , m_eUnit(MAP_TWIP)
+ , m_eUnit(MapUnit::MapTwip)
{
m_pUIBuilder = new VclBuilder(this, getUIRootDir(),
"svx/ui/paralrspacing.ui",
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 6dc0f9025179..856bef27a3d5 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -810,14 +810,14 @@ void PosSizePropertyPanel::executeSize()
double nWidth = (double)mpMtrWidth->GetValue( meDlgUnit );
nWidth = MetricField::ConvertDoubleValue( nWidth, mpMtrWidth->GetBaseValue(), mpMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
long lWidth = (long)(nWidth * (double)aUIScale);
- lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit );
+ lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit );
lWidth = (long)mpMtrWidth->Denormalize( lWidth );
// get Height
double nHeight = (double)mpMtrHeight->GetValue( meDlgUnit );
nHeight = MetricField::ConvertDoubleValue( nHeight, mpMtrHeight->GetBaseValue(), mpMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
long lHeight = (long)(nHeight * (double)aUIScale);
- lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit );
+ lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit );
lHeight = (long)mpMtrWidth->Denormalize( lHeight );
// put Width & Height to itemset
@@ -1067,8 +1067,8 @@ void PosSizePropertyPanel::SetPosSizeMinMax()
TransfrmHelper::ScaleRect( maRect, aUIScale );
const sal_uInt16 nDigits(mpMtrPosX->GetDecimalDigits());
- TransfrmHelper::ConvertRect( maWorkArea, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
- TransfrmHelper::ConvertRect( maRect, nDigits, (MapUnit) mePoolUnit, meDlgUnit );
+ TransfrmHelper::ConvertRect( maWorkArea, nDigits, mePoolUnit, meDlgUnit );
+ TransfrmHelper::ConvertRect( maRect, nDigits, mePoolUnit, meDlgUnit );
double fLeft(maWorkArea.getMinX());
double fTop(maWorkArea.getMinY());
@@ -1080,7 +1080,7 @@ void PosSizePropertyPanel::SetPosSizeMinMax()
fRight -= maRect.getWidth();
fBottom -= maRect.getHeight();
- const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MAP_100TH_MM, meDlgUnit ) - 1L));
+ const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1L));
fLeft = basegfx::clamp(fLeft, -fMaxLong, fMaxLong);
fRight = basegfx::clamp(fRight, -fMaxLong, fMaxLong);
fTop = basegfx::clamp(fTop, - fMaxLong, fMaxLong);
diff --git a/svx/source/sidebar/possize/SidebarDialControl.cxx b/svx/source/sidebar/possize/SidebarDialControl.cxx
index 8f9db397e023..831fcbca1266 100644
--- a/svx/source/sidebar/possize/SidebarDialControl.cxx
+++ b/svx/source/sidebar/possize/SidebarDialControl.cxx
@@ -34,7 +34,7 @@ VCL_BUILDER_FACTORY_ARGS(SidebarDialControl, WB_TABSTOP)
Size SidebarDialControl::GetOptimalSize() const
{
- return LogicToPixel(Size(10, 10), MAP_APPFONT);
+ return LogicToPixel(Size(10, 10), MapUnit::MapAppFont);
}
void SidebarDialControl::MouseButtonDown( const MouseEvent& rMEvt )
diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
index 5005f59c873a..3275033926d0 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
@@ -127,7 +127,7 @@ void TextCharacterSpacingControl::Initialize()
{
MapUnit eUnit = GetCoreMetric();
MapUnit eOrgUnit = (MapUnit)eUnit;
- MapUnit ePntUnit(MAP_POINT);
+ MapUnit ePntUnit(MapUnit::MapPoint);
long nBig = maEditKerning->Normalize(nKerning);
nKerning = LogicToLogic(nBig, eOrgUnit, ePntUnit);
maEditKerning->SetValue(nKerning);
@@ -151,7 +151,7 @@ void TextCharacterSpacingControl::ExecuteCharacterSpacing(long nValue, bool bClo
long nSign = (nValue < 0) ? -1 : 1;
nValue = nValue * nSign;
- long nVal = LogicToLogic(nValue, MAP_POINT, (MapUnit)eUnit);
+ long nVal = LogicToLogic(nValue, MapUnit::MapPoint, (MapUnit)eUnit);
short nKern = (nValue == 0) ? 0 : (short)maEditKerning->Denormalize(nVal);
SvxKerningItem aKernItem(nSign * nKern, SID_ATTR_CHAR_KERNING);
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 6dde7207ca34..5c235813ced1 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -3779,10 +3779,10 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/)
return false;
const GraphicObject& rGraphicObject = pObj->GetGraphicObject();
- const MapMode aMapMode100thmm(MAP_100TH_MM);
+ const MapMode aMapMode100thmm(MapUnit::Map100thMM);
Size aGraphicSize(rGraphicObject.GetPrefSize());
- if( MAP_PIXEL == rGraphicObject.GetPrefMapMode().GetMapUnit() )
+ if( MapUnit::MapPixel == rGraphicObject.GetPrefMapMode().GetMapUnit() )
aGraphicSize = Application::GetDefaultDevice()->PixelToLogic( aGraphicSize, aMapMode100thmm );
else
aGraphicSize = OutputDevice::LogicToLogic( aGraphicSize, rGraphicObject.GetPrefMapMode(), aMapMode100thmm);
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 3876de9157f7..f8e7c727fe52 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1337,7 +1337,7 @@ bool SdrObjEditView::IsTextEditHit(const Point& rHit) const
long nHitTol = 2000;
OutputDevice* pRef = pTextEditOutliner->GetRefDevice();
if( pRef )
- nHitTol = OutputDevice::LogicToLogic( nHitTol, MAP_100TH_MM, pRef->GetMapMode().GetMapUnit() );
+ nHitTol = OutputDevice::LogicToLogic( nHitTol, MapUnit::Map100thMM, pRef->GetMapMode().GetMapUnit() );
bOk = pTextEditOutliner->IsTextPos( aPnt, (sal_uInt16)nHitTol );
}
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index c006538f6ab4..d3152c536893 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -1005,7 +1005,7 @@ void SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItemS
rItem.GetPresentation(SfxItemPresentation::Nameless,
pPool->GetMetric(nWhich),
- MAP_MM, aEntry.aValue);
+ MapUnit::MapMM, aEntry.aValue);
if (aEntry.bCanNum)
{
aEntry.aValue = OUString::number(aEntry.nVal) + ": " + aEntry.aValue;
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 4bfb71beba97..dab3a8659519 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -937,20 +937,20 @@ void SdrModel::ImpSetUIUnit()
// normalize on meters resp. inch
switch (eObjUnit)
{
- case MAP_100TH_MM : nUIUnitKomma+=5; break;
- case MAP_10TH_MM : nUIUnitKomma+=4; break;
- case MAP_MM : nUIUnitKomma+=3; break;
- case MAP_CM : nUIUnitKomma+=2; break;
- case MAP_1000TH_INCH: nUIUnitKomma+=3; break;
- case MAP_100TH_INCH : nUIUnitKomma+=2; break;
- case MAP_10TH_INCH : nUIUnitKomma+=1; break;
- case MAP_INCH : nUIUnitKomma+=0; break;
- case MAP_POINT : nDiv=72; break; // 1Pt = 1/72"
- case MAP_TWIP : nDiv=144; nUIUnitKomma++; break; // 1Twip = 1/1440"
- case MAP_PIXEL : break;
- case MAP_SYSFONT : break;
- case MAP_APPFONT : break;
- case MAP_RELATIVE : break;
+ case MapUnit::Map100thMM : nUIUnitKomma+=5; break;
+ case MapUnit::Map10thMM : nUIUnitKomma+=4; break;
+ case MapUnit::MapMM : nUIUnitKomma+=3; break;
+ case MapUnit::MapCM : nUIUnitKomma+=2; break;
+ case MapUnit::Map1000thInch: nUIUnitKomma+=3; break;
+ case MapUnit::Map100thInch : nUIUnitKomma+=2; break;
+ case MapUnit::Map10thInch : nUIUnitKomma+=1; break;
+ case MapUnit::MapInch : nUIUnitKomma+=0; break;
+ case MapUnit::MapPoint : nDiv=72; break; // 1Pt = 1/72"
+ case MapUnit::MapTwip : nDiv=144; nUIUnitKomma++; break; // 1Twip = 1/1440"
+ case MapUnit::MapPixel : break;
+ case MapUnit::MapSysFont : break;
+ case MapUnit::MapAppFont : break;
+ case MapUnit::MapRelative : break;
default: break;
} // switch
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 383c51fc967d..8e618690cb0b 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -219,8 +219,8 @@ void SdrMarkView::ModelHasChanged()
{
if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
{
- if (pOutputDevice->GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aSelection = OutputDevice::LogicToLogic(aSelection, MAP_100TH_MM, MAP_TWIP);
+ if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip);
}
}
@@ -753,8 +753,8 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
{
if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
{
- if (pOutputDevice->GetMapMode().GetMapUnit() == MAP_100TH_MM)
- aSelection = OutputDevice::LogicToLogic(aSelection, MAP_100TH_MM, MAP_TWIP);
+ if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip);
}
}
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index ea37cf640e4d..52545fbcd768 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -2970,11 +2970,11 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix,
// force metric to pool metric
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
@@ -3122,11 +3122,11 @@ bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf
// force MapUnit to 100th mm
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 669689451666..f440b121d537 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2958,11 +2958,11 @@ bool SdrObject::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPo
// force MapUnit to 100th mm
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
@@ -3008,11 +3008,11 @@ void SdrObject::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const ba
// force metric to pool metric
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index bc917815586c..15e3dfe649fd 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -774,11 +774,11 @@ void SdrCaptionObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons
// force metric to pool metric
MapUnit eMapUnit = pModel->GetItemPool().GetMetric(0);
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 602ec30b3d65..766083354c77 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -584,7 +584,7 @@ Size SdrGrafObj::getOriginalSize() const
aSize = Size ( aCroppedWidth, aCroppedHeight);
}
- if ( GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL )
+ if ( GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, GetModel()->GetScaleUnit() );
else
aSize = OutputDevice::LogicToLogic( aSize, GetGrafPrefMapMode(), GetModel()->GetScaleUnit() );
@@ -1243,12 +1243,12 @@ void SdrGrafObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly )
{
Size aSize;
Size aMaxSize( rMaxRect.GetSize() );
- if ( pGraphic->GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
- aSize = Application::GetDefaultDevice()->PixelToLogic( pGraphic->GetPrefSize(), MAP_100TH_MM );
+ if ( pGraphic->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
+ aSize = Application::GetDefaultDevice()->PixelToLogic( pGraphic->GetPrefSize(), MapUnit::Map100thMM );
else
aSize = OutputDevice::LogicToLogic( pGraphic->GetPrefSize(),
pGraphic->GetPrefMapMode(),
- MapMode( MAP_100TH_MM ) );
+ MapMode( MapUnit::Map100thMM ) );
if( aSize.Height() != 0 && aSize.Width() != 0 )
{
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index dcfda7e93744..286e6088fdf8 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -1391,11 +1391,11 @@ bool SdrMeasureObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B
// force MapUnit to 100th mm
MapUnit eMapUnit = pModel->GetItemPool().GetMetric(0);
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
@@ -1428,11 +1428,11 @@ void SdrMeasureObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons
// force metric to pool metric
MapUnit eMapUnit = pModel->GetItemPool().GetMetric(0);
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aPosA.setX(ImplMMToTwips(aPosA.getX()));
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index ada1c4aaa57f..7a55d02b49e4 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -184,7 +184,7 @@ const uno::Reference< graphic::XGraphic > SdrMediaObj::getSnapshot() const
void SdrMediaObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly /* = false */ )
{
- Size aSize( Application::GetDefaultDevice()->PixelToLogic( getPreferredSize(), MAP_100TH_MM ) );
+ Size aSize( Application::GetDefaultDevice()->PixelToLogic( getPreferredSize(), MapUnit::Map100thMM ) );
Size aMaxSize( rMaxRect.GetSize() );
if( aSize.Height() != 0 && aSize.Width() != 0 )
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 2c9bdca4c8d1..6e6609164b75 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -227,7 +227,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj
{
try
{
- MapUnit aContainerMapUnit( MAP_100TH_MM );
+ MapUnit aContainerMapUnit( MapUnit::Map100thMM );
uno::Reference< embed::XVisualObject > xParentVis( mpObj->GetParentXModel(), uno::UNO_QUERY );
if ( xParentVis.is() )
aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) );
@@ -462,7 +462,7 @@ awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getPlacement()
throw uno::RuntimeException();
Rectangle aLogicRect = impl_getScaledRect_nothrow();
- MapUnit aContainerMapUnit( MAP_100TH_MM );
+ MapUnit aContainerMapUnit( MapUnit::Map100thMM );
uno::Reference< embed::XVisualObject > xParentVis( mpObj->GetParentXModel(), uno::UNO_QUERY );
if ( xParentVis.is() )
aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) );
@@ -512,7 +512,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl
return;
// new scaled object area
- MapUnit aContainerMapUnit( MAP_100TH_MM );
+ MapUnit aContainerMapUnit( MapUnit::Map100thMM );
uno::Reference< embed::XVisualObject > xParentVis( mpObj->GetParentXModel(), uno::UNO_QUERY );
if ( xParentVis.is() )
aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) );
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 0f6071dde53d..f91413b00426 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -2946,11 +2946,11 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP
// force MapUnit to 100th mm
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
@@ -3016,11 +3016,11 @@ void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b
// force metric to pool metric
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 8bf65851dacf..2b7774006df9 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1631,11 +1631,11 @@ bool SdrTextObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP
// force MapUnit to 100th mm
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
@@ -1696,11 +1696,11 @@ void SdrTextObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b
// force metric to pool metric
const MapUnit eMapUnit(GetObjectMapUnit());
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
// position
aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index 554731b220be..5b18a2b3cd24 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -575,27 +575,27 @@ long BigMulDiv(long nVal, long nMul, long nDiv)
FrPair GetInchOrMM(MapUnit eU)
{
switch (eU) {
- case MAP_1000TH_INCH: return FrPair(1000,1);
- case MAP_100TH_INCH : return FrPair( 100,1);
- case MAP_10TH_INCH : return FrPair( 10,1);
- case MAP_INCH : return FrPair( 1,1);
- case MAP_POINT : return FrPair( 72,1);
- case MAP_TWIP : return FrPair(1440,1);
- case MAP_100TH_MM : return FrPair( 100,1);
- case MAP_10TH_MM : return FrPair( 10,1);
- case MAP_MM : return FrPair( 1,1);
- case MAP_CM : return FrPair( 1,10);
- case MAP_PIXEL : {
+ case MapUnit::Map1000thInch: return FrPair(1000,1);
+ case MapUnit::Map100thInch : return FrPair( 100,1);
+ case MapUnit::Map10thInch : return FrPair( 10,1);
+ case MapUnit::MapInch : return FrPair( 1,1);
+ case MapUnit::MapPoint : return FrPair( 72,1);
+ case MapUnit::MapTwip : return FrPair(1440,1);
+ case MapUnit::Map100thMM : return FrPair( 100,1);
+ case MapUnit::Map10thMM : return FrPair( 10,1);
+ case MapUnit::MapMM : return FrPair( 1,1);
+ case MapUnit::MapCM : return FrPair( 1,10);
+ case MapUnit::MapPixel : {
ScopedVclPtrInstance< VirtualDevice > pVD;
- pVD->SetMapMode(MapMode(MAP_100TH_MM));
+ pVD->SetMapMode(MapMode(MapUnit::Map100thMM));
Point aP(pVD->PixelToLogic(Point(64,64))); // 64 pixels for more accuracy
return FrPair(6400,aP.X(),6400,aP.Y());
}
- case MAP_APPFONT: case MAP_SYSFONT: {
+ case MapUnit::MapAppFont: case MapUnit::MapSysFont: {
ScopedVclPtrInstance< VirtualDevice > pVD;
pVD->SetMapMode(MapMode(eU));
Point aP(pVD->LogicToPixel(Point(32,32))); // 32 units for more accuracy
- pVD->SetMapMode(MapMode(MAP_100TH_MM));
+ pVD->SetMapMode(MapMode(MapUnit::Map100thMM));
aP=pVD->PixelToLogic(aP);
return FrPair(3200,aP.X(),3200,aP.Y());
}
@@ -667,22 +667,22 @@ void GetMeterOrInch(MapUnit eMU, short& rnKomma, long& rnMul, long& rnDiv, bool&
bool bMetr = false, bInch = false;
switch (eMU) {
// Metrisch
- case MAP_100TH_MM : bMetr = true; nKomma=5; break;
- case MAP_10TH_MM : bMetr = true; nKomma=4; break;
- case MAP_MM : bMetr = true; nKomma=3; break;
- case MAP_CM : bMetr = true; nKomma=2; break;
+ case MapUnit::Map100thMM : bMetr = true; nKomma=5; break;
+ case MapUnit::Map10thMM : bMetr = true; nKomma=4; break;
+ case MapUnit::MapMM : bMetr = true; nKomma=3; break;
+ case MapUnit::MapCM : bMetr = true; nKomma=2; break;
// Inch
- case MAP_1000TH_INCH: bInch = true; nKomma=3; break;
- case MAP_100TH_INCH : bInch = true; nKomma=2; break;
- case MAP_10TH_INCH : bInch = true; nKomma=1; break;
- case MAP_INCH : bInch = true; nKomma=0; break;
- case MAP_POINT : bInch = true; rnDiv=72; break; // 1Pt = 1/72"
- case MAP_TWIP : bInch = true; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440"
+ case MapUnit::Map1000thInch: bInch = true; nKomma=3; break;
+ case MapUnit::Map100thInch : bInch = true; nKomma=2; break;
+ case MapUnit::Map10thInch : bInch = true; nKomma=1; break;
+ case MapUnit::MapInch : bInch = true; nKomma=0; break;
+ case MapUnit::MapPoint : bInch = true; rnDiv=72; break; // 1Pt = 1/72"
+ case MapUnit::MapTwip : bInch = true; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440"
// Sonstiges
- case MAP_PIXEL : break;
- case MAP_SYSFONT : break;
- case MAP_APPFONT : break;
- case MAP_RELATIVE : break;
+ case MapUnit::MapPixel : break;
+ case MapUnit::MapSysFont : break;
+ case MapUnit::MapAppFont : break;
+ case MapUnit::MapRelative : break;
default: break;
} // switch
rnKomma=nKomma;
@@ -840,76 +840,76 @@ void SdrFormatter::TakeUnitStr(MapUnit eUnit, OUString& rStr)
switch(eUnit)
{
// metrically
- case MAP_100TH_MM :
+ case MapUnit::Map100thMM :
{
rStr = "/100mm";
break;
}
- case MAP_10TH_MM :
+ case MapUnit::Map10thMM :
{
rStr = "/10mm";
break;
}
- case MAP_MM :
+ case MapUnit::MapMM :
{
rStr = "mm";
break;
}
- case MAP_CM :
+ case MapUnit::MapCM :
{
rStr = "cm";
break;
}
// Inch
- case MAP_1000TH_INCH:
+ case MapUnit::Map1000thInch:
{
rStr = "/1000\"";
break;
}
- case MAP_100TH_INCH :
+ case MapUnit::Map100thInch :
{
rStr = "/100\"";
break;
}
- case MAP_10TH_INCH :
+ case MapUnit::Map10thInch :
{
rStr = "/10\"";
break;
}
- case MAP_INCH :
+ case MapUnit::MapInch :
{
rStr = "\"";
break;
}
- case MAP_POINT :
+ case MapUnit::MapPoint :
{
rStr = "pt";
break;
}
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
rStr = "twip";
break;
}
// others
- case MAP_PIXEL :
+ case MapUnit::MapPixel :
{
rStr = "pixel";
break;
}
- case MAP_SYSFONT :
+ case MapUnit::MapSysFont :
{
rStr = "sysfont";
break;
}
- case MAP_APPFONT :
+ case MapUnit::MapAppFont :
{
rStr = "appfont";
break;
}
- case MAP_RELATIVE :
+ case MapUnit::MapRelative :
{
rStr = "%";
break;
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 83a4d99067a4..db9501b3ede3 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -2115,11 +2115,11 @@ void SvxTableController::updateSelectionOverlay()
Rectangle aSelectionEnd(aEndRect.Right(), aEndRect.Top(), aEndRect.Right(), aEndRect.Bottom());
Rectangle aSelection(a2DRange.getMinX(), a2DRange.getMinY(), a2DRange.getMaxX(), a2DRange.getMaxY());
- if (pOutDev->GetMapMode().GetMapUnit() == MAP_100TH_MM)
+ if (pOutDev->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
{
- aSelectionStart = OutputDevice::LogicToLogic(aSelectionStart, MAP_100TH_MM, MAP_TWIP);
- aSelectionEnd = OutputDevice::LogicToLogic(aSelectionEnd, MAP_100TH_MM, MAP_TWIP);
- aSelection = OutputDevice::LogicToLogic(aSelection, MAP_100TH_MM, MAP_TWIP);
+ aSelectionStart = OutputDevice::LogicToLogic(aSelectionStart, MapUnit::Map100thMM, MapUnit::MapTwip);
+ aSelectionEnd = OutputDevice::LogicToLogic(aSelectionEnd, MapUnit::Map100thMM, MapUnit::MapTwip);
+ aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip);
}
if(SfxViewShell* pViewShell = SfxViewShell::Current())
diff --git a/svx/source/table/tablertfexporter.cxx b/svx/source/table/tablertfexporter.cxx
index 7806c9d47249..eb5d9271d7e0 100644
--- a/svx/source/table/tablertfexporter.cxx
+++ b/svx/source/table/tablertfexporter.cxx
@@ -79,7 +79,7 @@ SdrTableRtfExporter::SdrTableRtfExporter( SvStream& rStrm, SdrTableObj& rObj )
long HundMMToTwips( long nIn )
{
- long nRet = OutputDevice::LogicToLogic( nIn, MAP_100TH_MM, MAP_TWIP );
+ long nRet = OutputDevice::LogicToLogic( nIn, MapUnit::Map100thMM, MapUnit::MapTwip );
return nRet;
}
diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx
index 22186a1a2aee..3dc19aec3b41 100644
--- a/svx/source/table/tablertfimporter.cxx
+++ b/svx/source/table/tablertfimporter.cxx
@@ -320,7 +320,7 @@ void SdrTableRTFParser::NextColumn()
long TwipsToHundMM( long nIn )
{
- long nRet = OutputDevice::LogicToLogic( nIn, MAP_TWIP, MAP_100TH_MM );
+ long nRet = OutputDevice::LogicToLogic( nIn, MapUnit::MapTwip, MapUnit::Map100thMM );
return nRet;
}
diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx b/svx/source/tbxctrls/bulletsnumbering.cxx
index 847d4022276d..9ac5972e3f4d 100644
--- a/svx/source/tbxctrls/bulletsnumbering.cxx
+++ b/svx/source/tbxctrls/bulletsnumbering.cxx
@@ -103,7 +103,7 @@ NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController,
}
}
- Size aItemSize( LogicToPixel( Size( 30, 42 ), MAP_APPFONT ) );
+ Size aItemSize( LogicToPixel( Size( 30, 42 ), MapUnit::MapAppFont ) );
mpValueSet->SetExtraSpacing( 2 );
mpValueSet->SetOutputSizePixel( mpValueSet->CalcWindowSizePixel( aItemSize ) );
mpValueSet->SetColor( GetSettings().GetStyleSettings().GetFieldColor() );
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index 61ecfa9f7ece..72b3ccbe0d57 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -190,13 +190,13 @@ SvxColorDockingWindow::SvxColorDockingWindow
nCount ( 0 )
{
SetText(SVX_RESSTR(STR_COLORTABLE));
- SetSizePixel(LogicToPixel(Size(150, 22), MapMode(MAP_APPFONT)));
+ SetSizePixel(LogicToPixel(Size(150, 22), MapMode(MapUnit::MapAppFont)));
SetHelpId(HID_CTRL_COLOR);
aColorSet->SetSelectHdl( LINK( this, SvxColorDockingWindow, SelectHdl ) );
aColorSet->SetHelpId(HID_COLOR_CTL_COLORS);
- aColorSet->SetPosSizePixel(LogicToPixel(Point(2, 2), MapMode(MAP_APPFONT)),
- LogicToPixel(Size(146, 18), MapMode(MAP_APPFONT)));
+ aColorSet->SetPosSizePixel(LogicToPixel(Point(2, 2), MapMode(MapUnit::MapAppFont)),
+ LogicToPixel(Size(146, 18), MapMode(MapUnit::MapAppFont)));
// Get the model from the view shell. Using SfxObjectShell::Current()
// is unreliable when called at the wrong times.
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index f29663067f81..bbbaf61f47ff 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -890,7 +890,7 @@ void FillControl::Resize()
void FillControl::SetOptimalSize()
{
const Size aLogicalAttrSize(50,0);
- Size aSize(LogicToPixel(aLogicalAttrSize,MAP_APPFONT));
+ Size aSize(LogicToPixel(aLogicalAttrSize,MapUnit::MapAppFont));
Point aAttrPnt = mpLbFillAttr->GetPosPixel();
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 5400cea008c6..0ee971dd8865 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -76,7 +76,7 @@ FontWorkGalleryDialog::FontWorkGalleryDialog( SdrView* pSdrView, vcl::Window* pP
{
get(mpOKButton, "ok");
get(mpCtlFavorites, "ctlFavorites");
- Size aSize(LogicToPixel(Size(200, 200), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(200, 200), MapUnit::MapAppFont));
mpCtlFavorites->set_width_request(aSize.Width());
mpCtlFavorites->set_height_request(aSize.Height());
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index ed7e047b5c2c..22cc91850634 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -672,11 +672,11 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView )
{
SfxItemSet aGrfAttr( rPool, SDRATTR_GRAFCROP, SDRATTR_GRAFCROP, 0 );
const MapUnit eOldMetric = rPool.GetMetric( 0 );
- const MapMode aMap100( MAP_100TH_MM );
- const MapMode aMapTwip( MAP_TWIP );
+ const MapMode aMap100( MapUnit::Map100thMM );
+ const MapMode aMapTwip( MapUnit::MapTwip );
aGrfAttr.Put(pObj->GetMergedItemSet());
- rPool.SetDefaultMetric( MAP_TWIP );
+ rPool.SetDefaultMetric( MapUnit::MapTwip );
SfxItemSet aCropDlgAttr( rPool,
SDRATTR_GRAFCROP, SDRATTR_GRAFCROP,
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 1b7da6d23514..0aa0942a5bf1 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -60,7 +60,7 @@ SvxLineBox::SvxLineBox( vcl::Window* pParent, const Reference< XFrame >& rFrame
mpSh ( nullptr ),
mxFrame ( rFrame )
{
- SetSizePixel( LogicToPixel( aLogicalSize, MAP_APPFONT ));
+ SetSizePixel( LogicToPixel( aLogicalSize, MapUnit::MapAppFont ));
Show();
aDelayTimer.SetTimeout( DELAY_TIMEOUT );
@@ -221,7 +221,7 @@ void SvxLineBox::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
{
- SetSizePixel(LogicToPixel(aLogicalSize, MAP_APPFONT));
+ SetSizePixel(LogicToPixel(aLogicalSize, MapUnit::MapAppFont));
}
LineLB::DataChanged( rDCEvt );
@@ -245,14 +245,14 @@ SvxMetricField::SvxMetricField(
vcl::Window* pParent, const Reference< XFrame >& rFrame, WinBits nBits )
: MetricField(pParent, nBits)
, aCurTxt()
- , ePoolUnit(MAP_CM)
+ , ePoolUnit(MapUnit::MapCM)
, mxFrame(rFrame)
{
Size aSize(GetTextWidth( "99,99mm" ),GetTextHeight());
aSize.Width() += 20;
aSize.Height() += 6;
SetSizePixel( aSize );
- aLogicalSize = PixelToLogic(aSize, MAP_APPFONT);
+ aLogicalSize = PixelToLogic(aSize, MapUnit::MapAppFont);
SetUnit( FUNIT_MM );
SetDecimalDigits( 2 );
SetMax( 5000 );
@@ -376,7 +376,7 @@ void SvxMetricField::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
{
- SetSizePixel(LogicToPixel(aLogicalSize, MAP_APPFONT));
+ SetSizePixel(LogicToPixel(aLogicalSize, MapUnit::MapAppFont));
}
MetricField::DataChanged( rDCEvt );
@@ -388,7 +388,7 @@ SvxFillTypeBox::SvxFillTypeBox( vcl::Window* pParent ) :
bSelect ( false ),
bRelease( true )
{
- SetSizePixel( LogicToPixel( Size(40, 40 ),MAP_APPFONT ));
+ SetSizePixel( LogicToPixel( Size(40, 40 ),MapUnit::MapAppFont ));
Fill();
SelectEntryPos( drawing::FillStyle_SOLID );
Show();
@@ -470,7 +470,7 @@ SvxFillAttrBox::SvxFillAttrBox( vcl::Window* pParent ) :
{
SetPosPixel( Point( 90, 0 ) );
- SetSizePixel( LogicToPixel( Size(50, 80 ), MAP_APPFONT ));
+ SetSizePixel( LogicToPixel( Size(50, 80 ), MapUnit::MapAppFont ));
Show();
}
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index c439d848b24d..868f834c2cfe 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -432,7 +432,7 @@ ColumnsWindow::ColumnsWindow( sal_uInt16 nId, const OUString& rCmd, const OUStri
SetText( rText );
- Size aLogicSize = LogicToPixel( Size( 95, 155 ), MapMode( MAP_10TH_MM ) );
+ Size aLogicSize = LogicToPixel( Size( 95, 155 ), MapMode( MapUnit::Map10thMM ) );
nMX = aLogicSize.Width();
SetOutputSizePixel( Size( nMX*nWidth-1, aLogicSize.Height()+nTextHeight ) );
StartCascading();
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index 9305a369a9da..7dcd54cc7987 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -85,7 +85,7 @@ SvxPopupWindowListBox::SvxPopupWindowListBox(sal_uInt16 nSlotId, const OUString&
WinBits nBits(m_pListBox->GetStyle());
nBits &= ~(WB_SIMPLEMODE);
m_pListBox->SetStyle(nBits);
- Size aSize(LogicToPixel(Size(100, 85), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(100, 85), MapUnit::MapAppFont));
m_pListBox->set_width_request(aSize.Width());
m_pListBox->set_height_request(aSize.Height());
m_pListBox->EnableMultiSelection( true, true );
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index 8d78bd1a3870..c0b1c3eb45a0 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -226,7 +226,7 @@ void SvxLineWidthToolBoxControl::StateChanged(
// Core-Unit handed over to MetricField
// Should not happen in CreateItemWin ()!
- MapUnit eUnit = MAP_100TH_MM; // CD!!! GetCoreMetric();
+ MapUnit eUnit = MapUnit::Map100thMM; // CD!!! GetCoreMetric();
pFld->SetCoreUnit( eUnit );
pFld->Update( static_cast<const XLineWidthItem*>(pState) );
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 1998590f69f3..cba6820ed361 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -360,7 +360,7 @@ SvxStyleBox_Impl::SvxStyleBox_Impl(vcl::Window* pParent,
m_pMenu->SetSelectHdl( LINK( this, SvxStyleBox_Impl, MenuSelectHdl ) );
for(VclPtr<MenuButton> & rpButton : m_pButtons)
rpButton = nullptr;
- aLogicalSize = PixelToLogic( GetSizePixel(), MAP_APPFONT );
+ aLogicalSize = PixelToLogic( GetSizePixel(), MapUnit::MapAppFont );
SetOptimalSize();
EnableAutocomplete( true );
EnableUserDraw( true );
@@ -617,7 +617,7 @@ bool SvxStyleBox_Impl::AdjustFontForItemHeight(OutputDevice* pDevice, Rectangle&
void SvxStyleBox_Impl::SetOptimalSize()
{
- Size aSize(LogicToPixel(aLogicalSize, MAP_APPFONT));
+ Size aSize(LogicToPixel(aLogicalSize, MapUnit::MapAppFont));
set_width_request(aSize.Width());
set_height_request(aSize.Height());
SetSizePixel(aSize);
@@ -1094,7 +1094,7 @@ bool SvxFontNameBox_Impl::Notify( NotifyEvent& rNEvt )
void SvxFontNameBox_Impl::SetOptimalSize()
{
- Size aSize(LogicToPixel(aLogicalSize, MAP_APPFONT));
+ Size aSize(LogicToPixel(aLogicalSize, MapUnit::MapAppFont));
set_width_request(aSize.Width());
set_height_request(aSize.Height());
SetSizePixel(aSize);
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index ff9bb9e1c55b..c6fc28f4a469 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -247,7 +247,7 @@ bool SvxFontSizeBox_Impl::Notify( NotifyEvent& rNEvt )
void SvxFontSizeBox_Impl::SetOptimalSize()
{
- Size aPrefSize(LogicToPixel(m_aLogicalSize, MAP_APPFONT));
+ Size aPrefSize(LogicToPixel(m_aLogicalSize, MapUnit::MapAppFont));
aPrefSize.Width() = get_preferred_size().Width();
SetSizePixel(aPrefSize);
}
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index f68aed90f6c1..b00726280c67 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -371,7 +371,7 @@ void DictionaryList::setColSizes()
long nRemainder = nWidth - (nWidth1 + nWidth2 + nWidth3);
long aStaticTabs[] = { 3, 0, nWidth1 + (nRemainder/2), nPos3 };
- SvSimpleTable::SetTabs(aStaticTabs, MAP_PIXEL);
+ SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
}
void DictionaryList::Resize()
@@ -414,7 +414,7 @@ void DictionaryList::init(const Reference< linguistic2::XConversionDictionary>&
rHeaderBar.InsertItem( 3, aColumn3, nWidth3, nBits );
long pTabs[] = { 3, 0, nWidth1, nWidth1 + nWidth2 };
- SetTabs( &pTabs[0], MAP_PIXEL );
+ SetTabs( &pTabs[0], MapUnit::MapPixel );
}
void ChineseDictionaryDialog::initDictionaryControl(DictionaryList *pList,
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index be81e31c7ca1..deedad6885b5 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -194,7 +194,7 @@ namespace {
{
// use 100th mm for primitive bitmap converter tool, input is pixel
// use a real OutDev to get the correct DPI, the static LogicToLogic assumes 72dpi which is wrong (!)
- const Size aSize100th(Application::GetDefaultDevice()->PixelToLogic(*pSize, MapMode(MAP_100TH_MM)));
+ const Size aSize100th(Application::GetDefaultDevice()->PixelToLogic(*pSize, MapMode(MapUnit::Map100thMM)));
aRange.expand(basegfx::B2DPoint(aSize100th.Width(), aSize100th.Height()));
@@ -205,7 +205,7 @@ namespace {
else
{
// use 100th mm for primitive bitmap converter tool
- const Size aSize100th(OutputDevice::LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MAP_100TH_MM)));
+ const Size aSize100th(OutputDevice::LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)));
aRange.expand(basegfx::B2DPoint(aSize100th.Width(), aSize100th.Height()));
}
@@ -394,7 +394,7 @@ IMPL_LINK(GraphicExporter, CalcFieldValueHdl, EditFieldInfo*, pInfo, void)
VclPtr<VirtualDevice> GraphicExporter::CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWidthPixel, sal_uIntPtr nHeightPixel ) const
{
VclPtr<VirtualDevice> pVDev = VclPtr<VirtualDevice>::Create();
- MapMode aMM( MAP_100TH_MM );
+ MapMode aMM( MapUnit::Map100thMM );
Point aPoint( 0, 0 );
Size aPageSize(pPage->GetSize());
diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx
index c62a7ed26d2c..15752f7bd7c4 100644
--- a/svx/source/unodraw/unopool.cxx
+++ b/svx/source/unodraw/unopool.cxx
@@ -120,7 +120,7 @@ void SvxUnoDrawPool::getAny( SfxItemPool* pPool, const comphelper::PropertyMapEn
const MapUnit eMapUnit = pPool->GetMetric((sal_uInt16)pEntry->mnHandle);
sal_uInt8 nMemberId = pEntry->mnMemberId & (~SFX_METRIC_ITEM);
- if( eMapUnit == MAP_100TH_MM )
+ if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
// DVO, OD 10.10.2003 #i18732#
@@ -133,7 +133,7 @@ void SvxUnoDrawPool::getAny( SfxItemPool* pPool, const comphelper::PropertyMapEn
// check for needed metric translation
const MapUnit eMapUnit = pPool->GetMetric((sal_uInt16)pEntry->mnHandle);
- if(pEntry->mnMemberId & SFX_METRIC_ITEM && eMapUnit != MAP_100TH_MM)
+ if(pEntry->mnMemberId & SFX_METRIC_ITEM && eMapUnit != MapUnit::Map100thMM)
{
SvxUnoConvertToMM( eMapUnit, rValue );
}
@@ -153,7 +153,7 @@ void SvxUnoDrawPool::putAny( SfxItemPool* pPool, const comphelper::PropertyMapEn
uno::Any aValue( rValue );
const MapUnit eMapUnit = pPool->GetMetric((sal_uInt16)pEntry->mnHandle);
- if(pEntry->mnMemberId & SFX_METRIC_ITEM && eMapUnit != MAP_100TH_MM)
+ if(pEntry->mnMemberId & SFX_METRIC_ITEM && eMapUnit != MapUnit::Map100thMM)
{
SvxUnoConvertFromMM( eMapUnit, aValue );
}
@@ -187,7 +187,7 @@ void SvxUnoDrawPool::putAny( SfxItemPool* pPool, const comphelper::PropertyMapEn
{
std::unique_ptr<SfxPoolItem> pNewItem( pPool->GetDefaultItem( nWhich ).Clone() );
sal_uInt8 nMemberId = pEntry->mnMemberId & (~SFX_METRIC_ITEM);
- if( pPool->GetMetric(nWhich) == MAP_100TH_MM )
+ if( pPool->GetMetric(nWhich) == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
if( !pNewItem->PutValue( aValue, nMemberId ) )
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 37b311ac8e0e..2d9f97c47a24 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -971,17 +971,17 @@ sal_Bool SvxMeasureUnitToMapUnit( const short eApi, int& eVcl ) throw()
{
switch( eVcl )
{
- case util::MeasureUnit::MM_100TH: eVcl = MAP_100TH_MM; break;
- case util::MeasureUnit::MM_10TH: eVcl = MAP_10TH_MM; break;
- case util::MeasureUnit::MM: eVcl = MAP_MM; break;
- case util::MeasureUnit::CM: eVcl = MAP_CM; break;
- case util::MeasureUnit::INCH_1000TH: eVcl = MAP_1000TH_INCH; break;
- case util::MeasureUnit::INCH_100TH: eVcl = MAP_100TH_INCH; break;
- case util::MeasureUnit::INCH_10TH: eVcl = MAP_10TH_INCH; break;
- case util::MeasureUnit::INCH: eVcl = MAP_INCH; break;
- case util::MeasureUnit::POINT: eVcl = MAP_POINT; break;
- case util::MeasureUnit::TWIP: eVcl = MAP_TWIP; break;
- case util::MeasureUnit::PERCENT: eVcl = MAP_RELATIVE; break;
+ case util::MeasureUnit::MM_100TH: eVcl = MapUnit::Map100thMM; break;
+ case util::MeasureUnit::MM_10TH: eVcl = MapUnit::Map10thMM; break;
+ case util::MeasureUnit::MM: eVcl = MapUnit::MapMM; break;
+ case util::MeasureUnit::CM: eVcl = MapUnit::MapCM; break;
+ case util::MeasureUnit::INCH_1000TH: eVcl = MapUnit::Map1000thInch; break;
+ case util::MeasureUnit::INCH_100TH: eVcl = MapUnit::Map100thInch; break;
+ case util::MeasureUnit::INCH_10TH: eVcl = MapUnit::Map10thInch; break;
+ case util::MeasureUnit::INCH: eVcl = MapUnit::MapInch; break;
+ case util::MeasureUnit::POINT: eVcl = MapUnit::MapPoint; break;
+ case util::MeasureUnit::TWIP: eVcl = MapUnit::MapTwip; break;
+ case util::MeasureUnit::PERCENT: eVcl = MapUnit::MapRelative; break;
default:
return false;
}
@@ -997,17 +997,17 @@ bool SvxMapUnitToMeasureUnit( const MapUnit eVcl, short& eApi ) throw()
{
switch( eVcl )
{
- case MAP_100TH_MM: eApi = util::MeasureUnit::MM_100TH; break;
- case MAP_10TH_MM: eApi = util::MeasureUnit::MM_10TH; break;
- case MAP_MM: eApi = util::MeasureUnit::MM; break;
- case MAP_CM: eApi = util::MeasureUnit::CM; break;
- case MAP_1000TH_INCH: eApi = util::MeasureUnit::INCH_1000TH; break;
- case MAP_100TH_INCH: eApi = util::MeasureUnit::INCH_100TH; break;
- case MAP_10TH_INCH: eApi = util::MeasureUnit::INCH_10TH; break;
- case MAP_INCH: eApi = util::MeasureUnit::INCH; break;
- case MAP_POINT: eApi = util::MeasureUnit::POINT; break;
- case MAP_TWIP: eApi = util::MeasureUnit::TWIP; break;
- case MAP_RELATIVE: eApi = util::MeasureUnit::PERCENT; break;
+ case MapUnit::Map100thMM: eApi = util::MeasureUnit::MM_100TH; break;
+ case MapUnit::Map10thMM: eApi = util::MeasureUnit::MM_10TH; break;
+ case MapUnit::MapMM: eApi = util::MeasureUnit::MM; break;
+ case MapUnit::MapCM: eApi = util::MeasureUnit::CM; break;
+ case MapUnit::Map1000thInch: eApi = util::MeasureUnit::INCH_1000TH; break;
+ case MapUnit::Map100thInch: eApi = util::MeasureUnit::INCH_100TH; break;
+ case MapUnit::Map10thInch: eApi = util::MeasureUnit::INCH_10TH; break;
+ case MapUnit::MapInch: eApi = util::MeasureUnit::INCH; break;
+ case MapUnit::MapPoint: eApi = util::MeasureUnit::POINT; break;
+ case MapUnit::MapTwip: eApi = util::MeasureUnit::TWIP; break;
+ case MapUnit::MapRelative: eApi = util::MeasureUnit::PERCENT; break;
default:
return false;
}
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 97fa794b71a9..4b0232d6074b 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -102,7 +102,7 @@ bool SvxOle2Shape::setPropertyValueImpl( const OUString& rName, const SfxItemPro
{
try
{
- MapUnit aMapUnit( MAP_100TH_MM ); // the API handles with MAP_100TH_MM map mode
+ MapUnit aMapUnit( MapUnit::Map100thMM ); // the API handles with MapUnit::Map100thMM map mode
MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( embed::Aspects::MSOLE_CONTENT ) );
aTmp = OutputDevice::LogicToLogic( aTmp, aMapUnit, aObjUnit );
xObj->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, awt::Size( aTmp.Width(), aTmp.Height() ) );
@@ -266,7 +266,7 @@ bool SvxOle2Shape::getPropertyValueImpl( const OUString& rName, const SfxItemPro
awt::Rectangle aVisArea;
if( dynamic_cast<const SdrOle2Obj* >(mpObj.get()) != nullptr)
{
- MapMode aMapMode( MAP_100TH_MM ); // the API uses this map mode
+ MapMode aMapMode( MapUnit::Map100thMM ); // the API uses this map mode
Size aTmp = static_cast<SdrOle2Obj*>(mpObj.get())->GetOrigObjSize( &aMapMode ); // get the size in the requested map mode
aVisArea = awt::Rectangle( 0, 0, aTmp.Width(), aTmp.Height() );
}
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 4b2037352c62..323df4fd5eb9 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -485,11 +485,11 @@ void SvxShape::ForceMetricToItemPoolMetric(Pair& rPoint) const throw()
if(mpModel)
{
MapUnit eMapUnit = mpModel->GetItemPool().GetMetric(0);
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
rPoint.A() = MM_TO_TWIPS(rPoint.A());
rPoint.B() = MM_TO_TWIPS(rPoint.B());
@@ -511,11 +511,11 @@ void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon
if(mpModel)
{
MapUnit eMapUnit = mpModel->GetItemPool().GetMetric(0);
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
basegfx::B2DHomMatrix aTransform;
const double fMMToTWIPS(72.0 / 127.0);
@@ -537,15 +537,15 @@ void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon
void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
{
DBG_TESTSOLARMUTEX();
- MapUnit eMapUnit = MAP_100TH_MM;
+ MapUnit eMapUnit = MapUnit::Map100thMM;
if(mpModel)
{
eMapUnit = mpModel->GetItemPool().GetMetric(0);
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
rPoint.A() = TWIPS_TO_MM(rPoint.A());
rPoint.B() = TWIPS_TO_MM(rPoint.B());
@@ -564,15 +564,15 @@ void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
void SvxShape::ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw()
{
DBG_TESTSOLARMUTEX();
- MapUnit eMapUnit = MAP_100TH_MM;
+ MapUnit eMapUnit = MapUnit::Map100thMM;
if(mpModel)
{
eMapUnit = mpModel->GetItemPool().GetMetric(0);
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
switch(eMapUnit)
{
- case MAP_TWIP :
+ case MapUnit::MapTwip :
{
basegfx::B2DHomMatrix aTransform;
const double fTWIPSToMM(127.0 / 72.0);
@@ -660,7 +660,7 @@ uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const
return aAny;
ScopedVclPtrInstance< VirtualDevice > pVDev;
- pVDev->SetMapMode(MapMode(MAP_100TH_MM));
+ pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
SdrModel* pModel = mpObj->GetModel();
SdrPage* pPage = mpObj->GetPage();
@@ -690,7 +690,7 @@ uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const
{
Graphic aGraph(aMtf);
aGraph.SetPrefSize(aSize);
- aGraph.SetPrefMapMode(MAP_100TH_MM);
+ aGraph.SetPrefMapMode(MapUnit::Map100thMM);
Reference< awt::XBitmap > xBmp( aGraph.GetXGraphic(), UNO_QUERY );
aAny <<= xBmp;
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index af5d94e83abe..d458802091a1 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -272,7 +272,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GraphicType::Bitmap ) )
{
ScopedVclPtrInstance< VirtualDevice > pVDev;
- const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MAP_100TH_MM ) );
+ const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MapUnit::Map100thMM ) );
if( pVDev->SetOutputSizePixel( aSize ) )
{
@@ -305,7 +305,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GraphicType::Bitmap ) )
{
ScopedVclPtrInstance< VirtualDevice > pVDev;
- const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MAP_100TH_MM ) );
+ const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MapUnit::Map100thMM ) );
if( pVDev->SetOutputSizePixel( aSize ) )
{
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 656e70e88a21..1a5e82549ad0 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -2208,7 +2208,7 @@ void XFillStyleItem::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr()));
OUString aPresentation;
- GetPresentation(SfxItemPresentation::Nameless, MAP_100TH_MM, MAP_100TH_MM, aPresentation);
+ GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation);
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr()));
xmlTextWriterEndElement(pWriter);
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index 962ff658fb05..d2d309b9bd70 100644
--- a/svx/source/xoutdev/xtabdash.cxx
+++ b/svx/source/xoutdev/xtabdash.cxx
@@ -101,7 +101,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash)
if(pDash && (pDash->GetDots() || pDash->GetDashes()))
{
- const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MAP_100TH_MM, MAP_PIXEL));
+ const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MapUnit::Map100thMM, MapUnit::MapPixel));
const basegfx::B2DVector aScaleVector(aScaleMatrix * basegfx::B2DVector(1.0, 0.0));
const double fScaleValue(aScaleVector.getLength() * (nFactor * (1.4 / 2.0)));
const double fLineWidthInUnits(fLineWidth / fScaleValue);
diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx
index 51b71def653d..34438a4f1ea5 100644
--- a/svx/source/xoutdev/xtabhtch.cxx
+++ b/svx/source/xoutdev/xtabhtch.cxx
@@ -112,7 +112,7 @@ Bitmap XHatchList::CreateBitmap( long nIndex, const Size& rSize) const
}
}
- const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MAP_100TH_MM, MAP_PIXEL));
+ const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MapUnit::Map100thMM, MapUnit::MapPixel));
const basegfx::B2DVector aScaleVector(aScaleMatrix * basegfx::B2DVector(1.0, 0.0));
const double fScaleValue(aScaleVector.getLength());
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 0b307d7e3119..344a3a4acf18 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -147,7 +147,7 @@ DECLARE_RTFIMPORT_TEST(testN192129, "n192129.rtf")
{
// We expect that the result will be 16x16px.
Size aExpectedSize(16, 16);
- MapMode aMap(MAP_100TH_MM);
+ MapMode aMap(MapUnit::Map100thMM);
aExpectedSize = Application::GetDefaultDevice()->PixelToLogic(aExpectedSize, aMap);
uno::Reference<text::XTextGraphicObjectsSupplier> xTextGraphicObjectsSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 54fec424c5f9..4775ccfd62e2 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -3095,8 +3095,8 @@ void SwAccessibleMap::FireEvents()
Rectangle SwAccessibleMap::GetVisibleArea() const
{
- MapMode aSrc( MAP_TWIP );
- MapMode aDest( MAP_100TH_MM );
+ MapMode aSrc( MapUnit::MapTwip );
+ MapMode aDest( MapUnit::Map100thMM );
return OutputDevice::LogicToLogic( GetVisArea().SVRect(), aSrc, aDest );
}
@@ -3104,8 +3104,8 @@ Rectangle SwAccessibleMap::GetVisibleArea() const
// relative to the screen!
Point SwAccessibleMap::LogicToPixel( const Point& rPoint ) const
{
- MapMode aSrc( MAP_100TH_MM );
- MapMode aDest( MAP_TWIP );
+ MapMode aSrc( MapUnit::Map100thMM );
+ MapMode aDest( MapUnit::MapTwip );
Point aPoint = rPoint;
@@ -3124,8 +3124,8 @@ Point SwAccessibleMap::LogicToPixel( const Point& rPoint ) const
Size SwAccessibleMap::LogicToPixel( const Size& rSize ) const
{
- MapMode aSrc( MAP_100TH_MM );
- MapMode aDest( MAP_TWIP );
+ MapMode aSrc( MapUnit::Map100thMM );
+ MapMode aDest( MapUnit::MapTwip );
Size aSize( OutputDevice::LogicToLogic( rSize, aSrc, aDest ) );
if( GetShell()->GetWin() )
{
diff --git a/sw/source/core/bastyp/swtypes.cxx b/sw/source/core/bastyp/swtypes.cxx
index 97bbfb343f6b..0e0556ba3b61 100644
--- a/sw/source/core/bastyp/swtypes.cxx
+++ b/sw/source/core/bastyp/swtypes.cxx
@@ -80,9 +80,9 @@ IMPL_FIXEDMEMPOOL_NEWDEL( SwCursor_SavePos )
Size GetGraphicSizeTwip(const Graphic& rGraphic, vcl::RenderContext* pOutDev)
{
- const MapMode aMapTwip(MAP_TWIP);
+ const MapMode aMapTwip(MapUnit::MapTwip);
Size aSize(rGraphic.GetPrefSize());
- if (MAP_PIXEL == rGraphic.GetPrefMapMode().GetMapUnit())
+ if (MapUnit::MapPixel == rGraphic.GetPrefMapMode().GetMapUnit())
{
if (!pOutDev)
pOutDev = Application::GetDefaultDevice();
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index e7853e3e45c4..6099b32aec51 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1610,7 +1610,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
{
OUString aStr;
GetDoc()->GetAttrPool().GetPresentation( *pItem,
- MAP_CM, aStr );
+ MapUnit::MapCM, aStr );
if (!sAttrs.isEmpty())
sAttrs += ", ";
sAttrs += aStr;
diff --git a/sw/source/core/doc/DocumentDeviceManager.cxx b/sw/source/core/doc/DocumentDeviceManager.cxx
index 2aae3a1ca6ce..1659263e0603 100644
--- a/sw/source/core/doc/DocumentDeviceManager.cxx
+++ b/sw/source/core/doc/DocumentDeviceManager.cxx
@@ -78,7 +78,7 @@ void DocumentDeviceManager::setPrinter(/*[in]*/ SfxPrinter *pP,/*[in]*/ bool bDe
if ( mpPrt )
{
MapMode aMapMode( mpPrt->GetMapMode() );
- aMapMode.SetMapUnit( MAP_TWIP );
+ aMapMode.SetMapUnit( MapUnit::MapTwip );
mpPrt->SetMapMode( aMapMode );
}
@@ -272,7 +272,7 @@ VirtualDevice& DocumentDeviceManager::CreateVirtualDevice_() const
pNewVir->Compat_ZeroExtleadBug();
MapMode aMapMode( pNewVir->GetMapMode() );
- aMapMode.SetMapUnit( MAP_TWIP );
+ aMapMode.SetMapUnit( MapUnit::MapTwip );
pNewVir->SetMapMode( aMapMode );
const_cast<DocumentDeviceManager*>(this)->setVirtualDevice( pNewVir );
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index b52b9f07b15a..509b55ee1137 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -284,7 +284,7 @@ void SwTextFormatColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
pFSize != pOldFSize )
{
if( 100 == pOldFSize->GetProp() &&
- MAP_RELATIVE == pOldFSize->GetPropUnit() )
+ MapUnit::MapRelative == pOldFSize->GetPropUnit() )
{
// We set it to absolute -> do not propagate it further, unless
// we set it!
diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx
index b156c4d3d066..ba17a92b0b0f 100644
--- a/sw/source/core/docnode/ndnotxt.cxx
+++ b/sw/source/core/docnode/ndnotxt.cxx
@@ -112,8 +112,8 @@ const tools::PolyPolygon *SwNoTextNode::HasContour() const
if( !bContourMapModeValid )
{
const MapMode aGrfMap( GetGraphic().GetPrefMapMode() );
- bool bPixelGrf = aGrfMap.GetMapUnit() == MAP_PIXEL;
- const MapMode aContourMap( bPixelGrf ? MAP_PIXEL : MAP_100TH_MM );
+ bool bPixelGrf = aGrfMap.GetMapUnit() == MapUnit::MapPixel;
+ const MapMode aContourMap( bPixelGrf ? MapUnit::MapPixel : MapUnit::Map100thMM );
if( bPixelGrf ? !bPixelContour : aGrfMap != aContourMap )
{
double nGrfDPIx = 0.0;
@@ -123,7 +123,7 @@ const tools::PolyPolygon *SwNoTextNode::HasContour() const
{
const Size aGrfPixelSize( GetGraphic().GetSizePixel() );
const Size aGrfPrefMapModeSize( GetGraphic().GetPrefSize() );
- if ( aGrfMap.GetMapUnit() == MAP_INCH )
+ if ( aGrfMap.GetMapUnit() == MapUnit::MapInch )
{
nGrfDPIx = aGrfPixelSize.Width() / ( (double)aGrfMap.GetScaleX() * aGrfPrefMapModeSize.Width() );
nGrfDPIy = aGrfPixelSize.Height() / ( (double)aGrfMap.GetScaleY() * aGrfPrefMapModeSize.Height() );
@@ -132,7 +132,7 @@ const tools::PolyPolygon *SwNoTextNode::HasContour() const
{
const Size aGrf1000thInchSize =
OutputDevice::LogicToLogic( aGrfPrefMapModeSize,
- aGrfMap, MAP_1000TH_INCH );
+ aGrfMap, MapUnit::Map1000thInch );
nGrfDPIx = 1000.0 * aGrfPixelSize.Width() / aGrf1000thInchSize.Width();
nGrfDPIy = 1000.0 * aGrfPixelSize.Height() / aGrf1000thInchSize.Height();
}
@@ -203,11 +203,11 @@ bool SwNoTextNode::GetContourAPI( tools::PolyPolygon &rContour ) const
if( bContourMapModeValid )
{
const MapMode aGrfMap( GetGraphic().GetPrefMapMode() );
- const MapMode aContourMap( MAP_100TH_MM );
- OSL_ENSURE( aGrfMap.GetMapUnit() != MAP_PIXEL ||
- aGrfMap == MapMode( MAP_PIXEL ),
+ const MapMode aContourMap( MapUnit::Map100thMM );
+ OSL_ENSURE( aGrfMap.GetMapUnit() != MapUnit::MapPixel ||
+ aGrfMap == MapMode( MapUnit::MapPixel ),
"scale factor for pixel unsupported" );
- if( aGrfMap.GetMapUnit() != MAP_PIXEL &&
+ if( aGrfMap.GetMapUnit() != MapUnit::MapPixel &&
aGrfMap != aContourMap )
{
sal_uInt16 nPolyCount = rContour.Count();
@@ -234,7 +234,7 @@ bool SwNoTextNode::IsPixelContour() const
if( bContourMapModeValid )
{
const MapMode aGrfMap( GetGraphic().GetPrefMapMode() );
- bRet = aGrfMap.GetMapUnit() == MAP_PIXEL;
+ bRet = aGrfMap.GetMapUnit() == MapUnit::MapPixel;
}
else
{
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index abebce508486..181319111863 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -751,9 +751,9 @@ void SwVirtFlyDrawObj::NbcCrop(const Point& rRef, const Fraction& xFact, const F
GraphicObject const *pGraphicObject = pSh->GetGraphicObj();
if (!pGraphicObject)
return;
- const MapMode aMapMode100thmm(MAP_100TH_MM);
+ const MapMode aMapMode100thmm(MapUnit::Map100thMM);
Size aGraphicSize(pGraphicObject->GetPrefSize());
- if( MAP_PIXEL == pGraphicObject->GetPrefMapMode().GetMapUnit() )
+ if( MapUnit::MapPixel == pGraphicObject->GetPrefMapMode().GetMapUnit() )
aGraphicSize = Application::GetDefaultDevice()->PixelToLogic( aGraphicSize, aMapMode100thmm );
else
aGraphicSize = OutputDevice::LogicToLogic( aGraphicSize, pGraphicObject->GetPrefMapMode(), aMapMode100thmm);
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index c8773e8c7192..a144ea8d8eb7 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -216,7 +216,7 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView* pView,
// without MapMode-Offset !!!!!
// without MapMode-Offset, without Offset, w ... !!!!!
aPt = pWindow->LogicToPixel(
- aPt, MapMode( MAP_TWIP ) );
+ aPt, MapMode( MapUnit::MapTwip ) );
sText += "?" + OUString::number( aPt.getX() )
+ "," + OUString::number( aPt.getY() );
}
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index abe22af36f10..3624b67e9cd2 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -57,7 +57,7 @@ SwDrawModel::SwDrawModel(SwDoc *const pDoc)
pDoc->GetDocShell(), true )
, m_pDoc( pDoc )
{
- SetScaleUnit( MAP_TWIP );
+ SetScaleUnit( MapUnit::MapTwip );
SetSwapGraphics();
// use common InitDrawModelAndDocShell which will set the associations as needed,
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index acb4df590ec3..330c677e97d1 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1252,7 +1252,7 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFormat, Graphic& rGrf )
const Size aSz( GetSelectedFlyFrame()->Prt().SSize() );
ScopedVclPtrInstance< VirtualDevice > pVirtDev(*GetWin());
- MapMode aTmp( MAP_TWIP );
+ MapMode aTmp( MapUnit::MapTwip );
pVirtDev->SetMapMode( aTmp );
if( pVirtDev->SetOutputSize( aSz ) )
{
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 5c1179ac10ef..ae5646b12414 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1506,7 +1506,7 @@ const SwFrameFormat* SwFEShell::IsURLGrfAtPos( const Point& rPt, OUString* pURL,
aPt -= pFly->Frame().Pos();
// without MapMode-Offset, without Offset, o ... !!!!!
aPt = GetOut()->LogicToPixel(
- aPt, MapMode( MAP_TWIP ) );
+ aPt, MapMode( MapUnit::MapTwip ) );
((( *pURL += "?" ) += OUString::number( aPt.getX() ))
+= "," ) += OUString::number(aPt.getY() );
}
@@ -2031,8 +2031,8 @@ void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedO
}
sal_Int32 nBaseline = ::comphelper::getINT32(aBaseline);
- const MapMode aSourceMapMode( MAP_100TH_MM );
- const MapMode aTargetMapMode( MAP_TWIP );
+ const MapMode aSourceMapMode( MapUnit::Map100thMM );
+ const MapMode aTargetMapMode( MapUnit::MapTwip );
nBaseline = OutputDevice::LogicToLogic( nBaseline, aSourceMapMode.GetMapUnit(), aTargetMapMode.GetMapUnit() );
OSL_ENSURE( nBaseline > 0, "Wrong value of Baseline while retrieving from Starmath!" );
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index c3d8cc09ad5f..6a58900fee1a 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1277,7 +1277,7 @@ void SwFormatSurround::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr()));
OUString aPresentation;
- GetPresentation(SfxItemPresentation::Nameless, MAP_100TH_MM, MAP_100TH_MM, aPresentation);
+ GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation);
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bAnchorOnly"), BAD_CAST(OString::boolean(bAnchorOnly).getStr()));
@@ -1730,7 +1730,7 @@ void SwFormatAnchor::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nOrder"), BAD_CAST(OString::number(mnOrder).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nOrderCounter"), BAD_CAST(OString::number(mnOrderCounter).getStr()));
OUString aPresentation;
- GetPresentation(SfxItemPresentation::Nameless, MAP_100TH_MM, MAP_100TH_MM, aPresentation);
+ GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation);
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr()));
xmlTextWriterEndElement(pWriter);
@@ -3440,8 +3440,8 @@ IMapObject* SwFrameFormat::GetIMapObject( const Point& rPoint,
{
Point aPos( rPoint );
Size aActSz ( pRef == pFly ? pFly->Frame().SSize() : pRef->Prt().SSize() );
- const MapMode aSrc ( MAP_TWIP );
- const MapMode aDest( MAP_100TH_MM );
+ const MapMode aSrc ( MapUnit::MapTwip );
+ const MapMode aDest( MapUnit::Map100thMM );
aOrigSz = OutputDevice::LogicToLogic( aOrigSz, aSrc, aDest );
aActSz = OutputDevice::LogicToLogic( aActSz, aSrc, aDest );
aPos -= pRef->Frame().Pos();
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 8f256462e05a..2e7649782a12 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2491,15 +2491,15 @@ bool SwFlyFrame::GetContour( tools::PolyPolygon& rContour,
static_cast<const SwNoTextFrame*>(Lower())->GetGrfArea( aClip, &aOrig );
// OD 16.04.2003 #i13147# - copy method code <SvxContourDlg::ScaleContour(..)>
// in order to avoid that graphic has to be loaded for contour scale.
- //SvxContourDlg::ScaleContour( rContour, aGrf, MAP_TWIP, aOrig.SSize() );
+ //SvxContourDlg::ScaleContour( rContour, aGrf, MapUnit::MapTwip, aOrig.SSize() );
{
OutputDevice* pOutDev = Application::GetDefaultDevice();
- const MapMode aDispMap( MAP_TWIP );
+ const MapMode aDispMap( MapUnit::MapTwip );
const MapMode aGrfMap( pGrfObj->GetPrefMapMode() );
const Size aGrfSize( pGrfObj->GetPrefSize() );
Size aOrgSize;
Point aNewPoint;
- bool bPixelMap = aGrfMap.GetMapUnit() == MAP_PIXEL;
+ bool bPixelMap = aGrfMap.GetMapUnit() == MapUnit::MapPixel;
if ( bPixelMap )
aOrgSize = pOutDev->PixelToLogic( aGrfSize, aDispMap );
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 5f7d71756566..7cb6448853c6 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -419,7 +419,7 @@ SwOLENode * SwNodes::MakeOLENode( const SwNodeIndex & rWhere,
Size SwOLENode::GetTwipSize() const
{
- MapMode aMapMode( MAP_TWIP );
+ MapMode aMapMode( MapUnit::MapTwip );
return const_cast<SwOLENode*>(this)->aOLEObj.GetObject().GetSize( &aMapMode );
}
@@ -909,8 +909,8 @@ const uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef()
if ( pFrame )
{
Size aSz( pFrame->Frame().SSize() );
- const MapMode aSrc ( MAP_TWIP );
- const MapMode aDest( MAP_100TH_MM );
+ const MapMode aSrc ( MapUnit::MapTwip );
+ const MapMode aDest( MapUnit::Map100thMM );
aSz = OutputDevice::LogicToLogic( aSz, aSrc, aDest );
aArea.SetSize( aSz );
}
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 51e9649552cd..c091114a7e33 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1547,7 +1547,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
mrOut.Push( PushFlags::MAPMODE );
MapMode aMapMode( mrOut.GetMapMode() );
- aMapMode.SetMapUnit( MAP_TWIP );
+ aMapMode.SetMapUnit( MapUnit::MapTwip );
mrOut.SetMapMode( aMapMode );
// Create new cursor and lock the view:
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 7208f40b9766..ad9b0507723b 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -565,7 +565,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rM
pOut = Application::GetDefaultDevice();
MapMode aOldMap( pOut->GetMapMode() );
- pOut->SetMapMode( MapMode( MAP_TWIP ) );
+ pOut->SetMapMode( MapMode( MapUnit::MapTwip ) );
rMin = 0;
rMax = 0;
@@ -804,7 +804,7 @@ sal_uInt16 SwTextNode::GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd
OSL_ENSURE( pOut, "GetScalingOfSelectedText without outdev" );
MapMode aOldMap( pOut->GetMapMode() );
- pOut->SetMapMode( MapMode( MAP_TWIP ) );
+ pOut->SetMapMode( MapMode( MapUnit::MapTwip ) );
if ( nStt == nEnd )
{
diff --git a/sw/source/core/text/noteurl.cxx b/sw/source/core/text/noteurl.cxx
index aa30769ee351..1de13e292764 100644
--- a/sw/source/core/text/noteurl.cxx
+++ b/sw/source/core/text/noteurl.cxx
@@ -45,7 +45,7 @@ void SwNoteURL::FillImageMap( ImageMap *pMap, const Point &rPos,
const size_t nCount = m_List.size();
if( nCount )
{
- MapMode aMap( MAP_100TH_MM );
+ MapMode aMap( MapUnit::Map100thMM );
for( size_t i = 0; i < nCount; ++i )
{
const SwURLNote &rNote = m_List[i];
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 1c853534fe1a..c881df08f7c9 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -395,7 +395,7 @@ bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff )
pOut = Application::GetDefaultDevice();
MapMode aOldMap( pOut->GetMapMode() );
- pOut->SetMapMode( MapMode( MAP_TWIP ) );
+ pOut->SetMapMode( MapMode( MapUnit::MapTwip ) );
aFnt.ChgFnt( pSh, *pOut );
rRegDiff = aFnt.GetHeight( pSh, *pOut );
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 5be3db8579de..f831297ec784 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -741,7 +741,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
bool bWinUsed = false;
vcl::Font aOldFnt;
- MapMode aOldMap( MAP_TWIP );
+ MapMode aOldMap( MapUnit::MapTwip );
OutputDevice* pOut = rInf.GetOut();
OutputDevice* pWin;
if( rInf.GetVsh() && rInf.GetVsh()->GetWin() )
@@ -790,7 +790,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
{
bWinUsed = true;
aOldMap = pWin->GetMapMode( );
- pWin->SetMapMode( MapMode( MAP_TWIP ) );
+ pWin->SetMapMode( MapMode( MapUnit::MapTwip ) );
aOldFnt = pWin->GetFont();
}
pWin->SetFont( rFnt.GetActualFont() );
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index a50b85d4285c..87c27640280a 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -510,7 +510,7 @@ void SwFntObj::GuessLeading( const SwViewShell&
GetpApp()->GetDefaultDevice();
if ( pWin )
{
- MapMode aTmpMap( MAP_TWIP );
+ MapMode aTmpMap( MapUnit::MapTwip );
MapMode aOldMap = pWin->GetMapMode( );
pWin->SetMapMode( aTmpMap );
const vcl::Font aOldFnt( pWin->GetFont() );
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index a0b08b5349d4..dda5d70eeef7 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1442,7 +1442,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
const SfxItemPool& rPool = pDoc->GetAttrPool();
const MapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
SvxUnoConvertFromMM(eMapUnit, aValue);
}
@@ -2248,7 +2248,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
const SwRect &rRect = pTmpFrame->Frame();
Size aMM100Size = OutputDevice::LogicToLogic(
Size( rRect.Width(), rRect.Height() ),
- MapMode( MAP_TWIP ), MapMode( MAP_100TH_MM ));
+ MapMode( MapUnit::MapTwip ), MapMode( MapUnit::Map100thMM ));
aAny <<= awt::Size( aMM100Size.Width(), aMM100Size.Height() );
}
}
@@ -2347,7 +2347,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
const SfxItemPool& rPool = pDoc->GetAttrPool();
const MapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
SvxUnoConvertToMM(eMapUnit, aAny);
}
@@ -2966,9 +2966,9 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
{
aSz.Width() = aSz.Height() = 5000;
aSz = OutputDevice::LogicToLogic
- ( aSz, MapMode( MAP_100TH_MM ), aRefMap );
+ ( aSz, MapMode( MapUnit::Map100thMM ), aRefMap );
}
- MapMode aMyMap( MAP_TWIP );
+ MapMode aMyMap( MapUnit::MapTwip );
aSz = OutputDevice::LogicToLogic( aSz, aRefMap, aMyMap );
SwFormatFrameSize aFrameSz;
aFrameSz.SetSize(aSz);
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 5715ac07e2bb..4ac356ece5b5 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -530,7 +530,7 @@ throw(uno::RuntimeException)
{
const MapUnit eMapUnit(rSet.GetPool()->GetMetric(rEntry.nWID));
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
SvxUnoConvertToMM(eMapUnit, rAny);
}
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index d76722df4abb..b8c92c32cf4c 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1571,7 +1571,7 @@ sal_uInt8 lcl_TranslateMetric(const SfxItemPropertySimpleEntry& rEntry, SwDoc* p
const SfxItemPool& rPool = pDoc->GetAttrPool();
const MapUnit eMapUnit(rPool.GetMetric(rEntry.nWID));
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
SvxUnoConvertFromMM(eMapUnit, o_aValue);
return rEntry.nMemberId & (~SFX_METRIC_ITEM);
}
@@ -2304,7 +2304,7 @@ uno::Any SwXStyle::GetStyleProperty<HINT_BEGIN>(const SfxItemPropertySimpleEntry
// since this means they are intended as percent values
if(XATTR_FILLBMP_SIZEX == rEntry.nWID || XATTR_FILLBMP_SIZEY == rEntry.nWID)
bAllowedConvert = !aResult.has<sal_Int32>() || aResult.get<sal_Int32>() > 0;
- if(eMapUnit != MAP_100TH_MM && bAllowedConvert)
+ if(eMapUnit != MapUnit::Map100thMM && bAllowedConvert)
SvxUnoConvertToMM(eMapUnit, aResult);
}
return aResult;
@@ -3603,7 +3603,7 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle(
const SfxItemPool& rPool = m_pDocShell->GetDoc()->GetAttrPool();
const MapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
SvxUnoConvertFromMM(eMapUnit, aValue);
}
@@ -4087,7 +4087,7 @@ uno::Sequence< uno::Any > SwXAutoStyle::GetPropertyValues_Impl(
const SfxItemPool& rPool = mrDoc.GetAttrPool();
const MapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
- if(eMapUnit != MAP_100TH_MM)
+ if(eMapUnit != MapUnit::Map100thMM)
{
SvxUnoConvertToMM(eMapUnit, aTarget);
}
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 4b9b49be5611..ddeebc4efb73 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -208,7 +208,7 @@ bool SwPagePreviewLayout::Init( const sal_uInt16 _nCols,
mbLayoutInfoValid = true;
// calculate scaling
- MapMode aMapMode( MAP_TWIP );
+ MapMode aMapMode( MapUnit::MapTwip );
Size aWinSize = mrParentViewShell.GetOut()->PixelToLogic( _rPxWinSize, aMapMode );
Fraction aXScale( aWinSize.Width(), mnPreviewLayoutWidth );
Fraction aYScale( aWinSize.Height(), mnPreviewLayoutHeight );
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index c88203f7b139..e0d11151b90d 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -102,7 +102,7 @@ void SwViewShell::PrintProspect(
//!! applying view options and formatting the document should now only be done in getRendererCount!
- MapMode aMapMode( MAP_TWIP );
+ MapMode aMapMode( MapUnit::MapTwip );
Size aPrtSize( pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), aMapMode ) );
SwTwips nMaxRowSz, nMaxColSz;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 3f62822018b0..1849c4caaeab 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1850,7 +1850,7 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
// setup the output device to draw the tile
MapMode aMapMode(rDevice.GetMapMode());
- aMapMode.SetMapUnit(MAP_TWIP);
+ aMapMode.SetMapUnit(MapUnit::MapTwip);
aMapMode.SetOrigin(Point(-tilePosX, -tilePosY));
// Scaling. Must convert from pixels to twips. We know
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 354328a401cf..885463791f1f 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -205,7 +205,7 @@ void SwViewShell::InitPrt( OutputDevice *pOutDev )
maPrtOffst += pOutDev->GetMapMode().GetOrigin();
MapMode aMapMode( pOutDev->GetMapMode() );
- aMapMode.SetMapUnit( MAP_TWIP );
+ aMapMode.SetMapUnit( MapUnit::MapTwip );
pOutDev->SetMapMode( aMapMode );
pOutDev->SetLineColor();
pOutDev->SetFillColor();
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 609b344a90a8..47c8c7f98baf 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -3400,7 +3400,7 @@ static void OutCSS1_SvxBorderLine( SwHTMLWriter& rHTMLWrt,
OStringBuffer sOut;
if( Application::GetDefaultDevice() &&
nWidth <= Application::GetDefaultDevice()->PixelToLogic(
- Size( 1, 1 ), MapMode( MAP_TWIP) ).Width() )
+ Size( 1, 1 ), MapMode( MapUnit::MapTwip) ).Width() )
{
// If the width is smaller than one pixel, then export as 1px
// so that Netscape and IE show the line.
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 2d05d4b8e347..a2f846365e5e 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -2609,7 +2609,7 @@ sal_uInt32 SwHTMLWriter::ToPixel( sal_uInt32 nVal, const bool bVert )
if( Application::GetDefaultDevice() && nVal )
{
Size aSz( bVert ? 0 : nVal, bVert ? nVal : 0 );
- aSz = Application::GetDefaultDevice()->LogicToPixel(aSz, MapMode( MAP_TWIP ));
+ aSz = Application::GetDefaultDevice()->LogicToPixel(aSz, MapMode( MapUnit::MapTwip ));
nVal = bVert ? aSz.Height() : aSz.Width();
if( !nVal ) // if there is a Twip, there should be a pixel as well
nVal = 1;
diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx
index aadcb2f17500..db0fae6876d2 100644
--- a/sw/source/filter/html/htmldrawreader.cxx
+++ b/sw/source/filter/html/htmldrawreader.cxx
@@ -93,7 +93,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj,
Size aTwipSpc( rPixSpace.Width(), rPixSpace.Height() );
aTwipSpc =
Application::GetDefaultDevice()->PixelToLogic( aTwipSpc,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
nLeftSpace = nRightSpace = (sal_uInt16)aTwipSpc.Width();
nUpperSpace = nLowerSpace = (sal_uInt16)aTwipSpc.Height();
}
@@ -465,7 +465,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
if( (aTwipSz.Width() || aTwipSz.Height()) && Application::GetDefaultDevice() )
{
aTwipSz = Application::GetDefaultDevice()
- ->PixelToLogic( aTwipSz, MapMode( MAP_TWIP ) );
+ ->PixelToLogic( aTwipSz, MapMode( MapUnit::MapTwip ) );
}
if( SVX_CSS1_LTYPE_TWIP== aPropInfo.eWidthType )
diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx
index a134f085c64a..2debe01231ba 100644
--- a/sw/source/filter/html/htmldrawwriter.cxx
+++ b/sw/source/filter/html/htmldrawwriter.cxx
@@ -219,7 +219,7 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt,
{
nAmount = Application::GetDefaultDevice()
->LogicToPixel( Size(nAmount,0),
- MapMode(MAP_TWIP) ).Width();
+ MapMode(MapUnit::MapTwip) ).Width();
}
if( nAmount )
{
@@ -247,7 +247,7 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt,
{
Size aPixelSz =
Application::GetDefaultDevice()->LogicToPixel( aTwipSz,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
if( !aPixelSz.Width() && aTwipSz.Width() )
aPixelSz.Width() = 1;
if( !aPixelSz.Height() && aTwipSz.Height() )
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index b82949226793..ebfcadbad895 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -626,7 +626,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat,
{
Size aPixelSpc =
Application::GetDefaultDevice()->LogicToPixel( aTwipSpc,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
if( !aPixelSpc.Width() && aTwipSpc.Width() )
aPixelSpc.Width() = 1;
if( !aPixelSpc.Height() && aTwipSpc.Height() )
@@ -699,7 +699,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat,
{
aPixelSz =
Application::GetDefaultDevice()->LogicToPixel( aTwipSz,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
if( !aPixelSz.Width() && aTwipSz.Width() )
aPixelSz.Width() = 1;
if( !aPixelSz.Height() && aTwipSz.Height() )
@@ -893,7 +893,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma
{
Size aPixelSpc =
Application::GetDefaultDevice()->LogicToPixel( aTwipSpc,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
if( !aPixelSpc.Width() && aTwipSpc.Width() )
aPixelSpc.Width() = 1;
if( !aPixelSpc.Height() && aTwipSpc.Height() )
@@ -964,7 +964,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma
{
aPixelSz =
Application::GetDefaultDevice()->LogicToPixel( aTwipSz,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
if( !aPixelSz.Width() && aTwipSz.Width() )
aPixelSz.Width() = 1;
if( !aPixelSz.Height() && aTwipSz.Height() )
@@ -1336,7 +1336,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat,
{
Size aPixelBorder =
Application::GetDefaultDevice()->LogicToPixel( aTwipBorder,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
if( !aPixelBorder.Width() && aTwipBorder.Width() )
aPixelBorder.Width() = 1;
if( !aPixelBorder.Height() && aTwipBorder.Height() )
@@ -1575,7 +1575,7 @@ static Writer & OutHTML_FrameFormatAsMulticol( Writer& rWrt,
{
nGutter = (sal_uInt16)Application::GetDefaultDevice()
->LogicToPixel( Size(nGutter,0),
- MapMode(MAP_TWIP) ).Width();
+ MapMode(MapUnit::MapTwip) ).Width();
}
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_gutter).
append("=\"").append(static_cast<sal_Int32>(nGutter)).append("\"");
@@ -1795,7 +1795,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF
Size aMM100Size;
const SwFormatFrameSize& rSize = rFrameFormat.GetFrameSize();
aMM100Size = OutputDevice::LogicToLogic( rSize.GetSize(),
- MapMode( MAP_TWIP ), MapMode( MAP_100TH_MM ));
+ MapMode( MapUnit::MapTwip ), MapMode( MapUnit::Map100thMM ));
sal_uInt16 nErr = XOutBitmap::WriteGraphic( pGrfNd->GetGrf(), aGraphicURL,
"JPG", nFlags, &aMM100Size );
@@ -1880,7 +1880,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat,
{
nSize -= HTML_PARSPACE;
nSize = (sal_Int16)Application::GetDefaultDevice()
- ->LogicToPixel( Size(nSize,0), MapMode(MAP_TWIP) ).Width();
+ ->LogicToPixel( Size(nSize,0), MapMode(MapUnit::MapTwip) ).Width();
aSpacer = OStringBuffer(OOO_STRING_SVTOOLS_HTML_spacer).
append(' ').append(OOO_STRING_SVTOOLS_HTML_O_type).
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 6ef302379f81..9d233891db18 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -471,7 +471,7 @@ void SwHTMLImageWatcher::init( sal_Int32 Width, sal_Int32 Height )
{
Size aTmp(aNewSz.Width, aNewSz.Height);
aTmp = Application::GetDefaultDevice()
- ->PixelToLogic( aTmp, MapMode( MAP_100TH_MM ) );
+ ->PixelToLogic( aTmp, MapMode( MapUnit::Map100thMM ) );
aNewSz.Width = aTmp.Width();
aNewSz.Height = aTmp.Height();
}
@@ -734,7 +734,7 @@ void SwHTMLParser::SetControlSize( const uno::Reference< drawing::XShape >& rSha
{
Size aTmpSz( aNewSz.Width, aNewSz.Height );
aTmpSz = Application::GetDefaultDevice()
- ->PixelToLogic( aTmpSz, MapMode( MAP_100TH_MM ) );
+ ->PixelToLogic( aTmpSz, MapMode( MapUnit::Map100thMM ) );
aNewSz.Width = aTmpSz.Width();
aNewSz.Height = aTmpSz.Height();
}
@@ -1694,7 +1694,7 @@ void SwHTMLParser::InsertInput()
if( (aSz.Width() || aSz.Height()) && Application::GetDefaultDevice() )
{
aSz = Application::GetDefaultDevice()
- ->PixelToLogic( aSz, MapMode( MAP_100TH_MM ) );
+ ->PixelToLogic( aSz, MapMode( MapUnit::Map100thMM ) );
}
aTmp <<= FormButtonType_SUBMIT;
xPropSet->setPropertyValue("ButtonType", aTmp );
@@ -1782,7 +1782,7 @@ void SwHTMLParser::InsertInput()
{
Size aNewSz( nSize, 0 );
aNewSz = Application::GetDefaultDevice()
- ->PixelToLogic( aNewSz, MapMode( MAP_100TH_MM ) );
+ ->PixelToLogic( aNewSz, MapMode( MapUnit::Map100thMM ) );
aSz.Width() = aNewSz.Width();
OSL_ENSURE( !aTextSz.Width(), "Text-Breite ist gegeben" );
bMinWidth = false;
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index d50fe551a8cf..6250b987b451 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -992,7 +992,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt,
{
aPixelSz =
Application::GetDefaultDevice()->LogicToPixel( aTwipSz,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
if( !aPixelSz.Width() && aTwipSz.Width() )
aPixelSz.Width() = 1;
if( !aPixelSz.Height() && aTwipSz.Height() )
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 401415ad1fd2..44e68132bc16 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -553,7 +553,7 @@ IMAGE_SETEVENT:
if( (aTwipSz.Width() || aTwipSz.Height()) && Application::GetDefaultDevice() )
{
aTwipSz = Application::GetDefaultDevice()
- ->PixelToLogic( aTwipSz, MapMode( MAP_TWIP ) );
+ ->PixelToLogic( aTwipSz, MapMode( MapUnit::MapTwip ) );
}
// CSS1-Groesse auf "normale" Groesse umrechnen
diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx
index 5d0988613579..bdbef48e5043 100644
--- a/sw/source/filter/html/htmlnumreader.cxx
+++ b/sw/source/filter/html/htmlnumreader.cxx
@@ -232,7 +232,7 @@ void SwHTMLParser::NewNumBulList( int nToken )
{
aTwipSz =
Application::GetDefaultDevice()->PixelToLogic( aTwipSz,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
pTwipSz = &aTwipSz;
}
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index d00f20c457af..fc5ba47e2d2b 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -138,7 +138,7 @@ void SwHTMLParser::SetFixSize( const Size& rPixSize,
{
aTwipSz =
Application::GetDefaultDevice()->PixelToLogic( aTwipSz,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
}
// die Breite bearbeiten
@@ -214,7 +214,7 @@ void SwHTMLParser::SetSpace( const Size& rPixSpace,
Size aTwipSpc( rPixSpace.Width(), rPixSpace.Height() );
aTwipSpc =
Application::GetDefaultDevice()->PixelToLogic( aTwipSpc,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
nLeftSpace = nRightSpace = aTwipSpc.Width();
nUpperSpace = nLowerSpace = (sal_uInt16)aTwipSpc.Height();
}
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index 7b8d2c8ed2ae..767d86378e26 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -603,7 +603,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss )
{
nTwipWidth = Application::GetDefaultDevice()
->PixelToLogic( Size(nWidth, 0),
- MapMode(MAP_TWIP) ).Width();
+ MapMode(MapUnit::MapTwip) ).Width();
}
if( !nPrcWidth && nTwipWidth < MINFLY )
@@ -694,7 +694,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss )
{
nGutter = (sal_uInt16)Application::GetDefaultDevice()
->PixelToLogic( Size(nGutter, 0),
- MapMode(MAP_TWIP) ).Width();
+ MapMode(MapUnit::MapTwip) ).Width();
}
SwFormatCol aFormatCol;
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 9ffcb7a0dfc3..0229c4aa6837 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2111,7 +2111,7 @@ void HTMLTable::InsertCell( HTMLTableCnts *pCnts,
if( (aTwipSz.Width() || aTwipSz.Height()) && Application::GetDefaultDevice() )
{
aTwipSz = Application::GetDefaultDevice()
- ->PixelToLogic( aTwipSz, MapMode( MAP_TWIP ) );
+ ->PixelToLogic( aTwipSz, MapMode( MapUnit::MapTwip ) );
}
// die Breite nur in die erste Zelle setzen!
@@ -2248,7 +2248,7 @@ void HTMLTable::InsertCol( sal_uInt16 nSpan, sal_uInt16 nColWidth, bool bRelWidt
if( aTwipSz.Width() && Application::GetDefaultDevice() )
{
aTwipSz = Application::GetDefaultDevice()
- ->PixelToLogic( aTwipSz, MapMode( MAP_TWIP ) );
+ ->PixelToLogic( aTwipSz, MapMode( MapUnit::MapTwip ) );
}
for( i=nCurCol; i<nColsReq; i++ )
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 3f98d4103c5e..3becd8c66092 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -116,10 +116,10 @@ void SwHTMLWrtTable::Pixelize( sal_uInt16& rValue )
if( rValue && Application::GetDefaultDevice() )
{
Size aSz( rValue, 0 );
- aSz = Application::GetDefaultDevice()->LogicToPixel( aSz, MapMode(MAP_TWIP) );
+ aSz = Application::GetDefaultDevice()->LogicToPixel( aSz, MapMode(MapUnit::MapTwip) );
if( !aSz.Width() )
aSz.Width() = 1;
- aSz = Application::GetDefaultDevice()->PixelToLogic( aSz, MapMode(MAP_TWIP) );
+ aSz = Application::GetDefaultDevice()->PixelToLogic( aSz, MapMode(MapUnit::MapTwip) );
rValue = (sal_uInt16)aSz.Width();
}
}
@@ -360,7 +360,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
{
Size aOldSz( aPixelSz );
aPixelSz = Application::GetDefaultDevice()->LogicToPixel( aPixelSz,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
if( aOldSz.Width() && !aPixelSz.Width() )
aPixelSz.Width() = 1;
if( aOldSz.Height() && !aPixelSz.Height() )
@@ -651,7 +651,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
else if( Application::GetDefaultDevice() )
{
sal_Int32 nPixWidth = Application::GetDefaultDevice()->LogicToPixel(
- Size(m_nTabWidth,0), MapMode(MAP_TWIP) ).Width();
+ Size(m_nTabWidth,0), MapMode(MapUnit::MapTwip) ).Width();
if( !nPixWidth )
nPixWidth = 1;
@@ -669,7 +669,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
{
Size aPixelSpc =
Application::GetDefaultDevice()->LogicToPixel( Size(nHSpace,nVSpace),
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
if( !aPixelSpc.Width() && nHSpace )
aPixelSpc.Width() = 1;
if( !aPixelSpc.Height() && nVSpace )
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index 556b8db75c4a..26fd9cec82e8 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -874,7 +874,7 @@ void SvxCSS1Parser::PixelToTwip( long &rWidth, long &rHeight )
{
Size aTwipSz( rWidth, rHeight );
aTwipSz = Application::GetDefaultDevice()->PixelToLogic( aTwipSz,
- MapMode(MAP_TWIP) );
+ MapMode(MapUnit::MapTwip) );
rWidth = aTwipSz.Width();
rHeight = aTwipSz.Height();
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index adf16e459d6a..81b6417e6db4 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -4892,7 +4892,7 @@ void SwHTMLParser::InsertSpacer()
{
nSize = Application::GetDefaultDevice()
->PixelToLogic( Size(0,nSize),
- MapMode(MAP_TWIP) ).Height();
+ MapMode(MapUnit::MapTwip) ).Height();
}
// einen Absatz-Abstand setzen
@@ -4940,7 +4940,7 @@ void SwHTMLParser::InsertSpacer()
{
nSize = Application::GetDefaultDevice()
->PixelToLogic( Size(nSize,0),
- MapMode(MAP_TWIP) ).Width();
+ MapMode(MapUnit::MapTwip) ).Width();
}
if( !m_pPam->GetPoint()->nContent.GetIndex() )
@@ -4975,7 +4975,7 @@ sal_uInt16 SwHTMLParser::ToTwips( sal_uInt16 nPixel )
if( nPixel && Application::GetDefaultDevice() )
{
long nTwips = Application::GetDefaultDevice()->PixelToLogic(
- Size( nPixel, nPixel ), MapMode( MAP_TWIP ) ).Width();
+ Size( nPixel, nPixel ), MapMode( MapUnit::MapTwip ) ).Width();
return nTwips <= USHRT_MAX ? (sal_uInt16)nTwips : USHRT_MAX;
}
else
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 741dd6fe80a7..147d17532208 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -646,7 +646,7 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt,
if( nGutter && Application::GetDefaultDevice() )
{
nGutter = (sal_uInt16)Application::GetDefaultDevice()
- ->LogicToPixel( Size(nGutter, 0), MapMode(MAP_TWIP) ).Width();
+ ->LogicToPixel( Size(nGutter, 0), MapMode(MapUnit::MapTwip) ).Width();
}
sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_gutter "=\"" + OString::number(nGutter) + "\"");
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 2f77017756ee..62e8e8f5ec6c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4140,9 +4140,9 @@ void DocxAttributeOutput::WriteSrcRect(const SdrObject* pSdrObj )
css::text::GraphicCrop aGraphicCropStruct;
xPropSet->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropStruct;
- const MapMode aMap100mm( MAP_100TH_MM );
+ const MapMode aMap100mm( MapUnit::Map100thMM );
const MapMode& rMapMode = aGrafObj.GetPrefMapMode();
- if (rMapMode.GetMapUnit() == MAP_PIXEL)
+ if (rMapMode.GetMapUnit() == MapUnit::MapPixel)
{
aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, aMap100mm);
}
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 54c04acdbbce..4de75bc3f9d6 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -175,9 +175,9 @@ namespace ww8
, mbForBullet(true)
, maGrf(rGrf)
{
- const MapMode aMap100mm( MAP_100TH_MM );
+ const MapMode aMap100mm( MapUnit::Map100thMM );
Size aSize( rGrf.GetPrefSize() );
- if ( MAP_PIXEL == rGrf.GetPrefMapMode().GetMapUnit() )
+ if ( MapUnit::MapPixel == rGrf.GetPrefMapMode().GetMapUnit() )
{
aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMap100mm );
}
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index ea93c9152709..d5d62a18c8c5 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1622,9 +1622,9 @@ void SwBasicEscherEx::WriteGrfBullet(const Graphic& rGrf)
OString aUniqueId = aGraphicObject.GetUniqueID();
if ( !aUniqueId.isEmpty() )
{
- const MapMode aMap100mm( MAP_100TH_MM );
+ const MapMode aMap100mm( MapUnit::Map100thMM );
Size aSize( rGrf.GetPrefSize() );
- if ( MAP_PIXEL == rGrf.GetPrefMapMode().GetMapUnit() )
+ if ( MapUnit::MapPixel == rGrf.GetPrefMapMode().GetMapUnit() )
{
aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMap100mm );
}
@@ -1706,10 +1706,10 @@ sal_Int32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrameFormat& rFormat, sal_uI
if (!aUniqueId.isEmpty())
{
- const MapMode aMap100mm( MAP_100TH_MM );
+ const MapMode aMap100mm( MapUnit::Map100thMM );
Size aSize( aGraphic.GetPrefSize() );
- if ( MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit() )
+ if ( MapUnit::MapPixel == aGraphic.GetPrefMapMode().GetMapUnit() )
{
aSize = Application::GetDefaultDevice()->PixelToLogic(
aSize, aMap100mm );
@@ -1914,8 +1914,8 @@ void SwBasicEscherEx::WriteBrushAttr(const SvxBrushItem &rBrush,
{
const Graphic &rGraphic = pGraphicObject->GetGraphic();
Size aSize(rGraphic.GetPrefSize());
- const MapMode aMap100mm(MAP_100TH_MM);
- if (MAP_PIXEL == rGraphic.GetPrefMapMode().GetMapUnit())
+ const MapMode aMap100mm(MapUnit::Map100thMM);
+ if (MapUnit::MapPixel == rGraphic.GetPrefMapMode().GetMapUnit())
{
aSize = Application::GetDefaultDevice()->PixelToLogic(
aSize, aMap100mm);
@@ -2211,7 +2211,7 @@ sal_Int32 SwEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat, MSO_SPT eS
void SwBasicEscherEx::Init()
{
- MapUnit eMap = MAP_TWIP;
+ MapUnit eMap = MapUnit::MapTwip;
if (SwDrawModel *pModel = rWrt.m_pDoc->getIDocumentDrawModelAccess().GetDrawModel())
{
// PPT arbeitet nur mit Einheiten zu 576DPI
@@ -2222,7 +2222,7 @@ void SwBasicEscherEx::Init()
// MS-DFF-Properties sind grossteils in EMU (English Metric Units) angegeben
// 1mm=36000emu, 1twip=635emu
Fraction aFact(360, 1);
- aFact /= GetMapFactor(MAP_100TH_MM, eMap).X();
+ aFact /= GetMapFactor(MapUnit::Map100thMM, eMap).X();
// create little values
aFact = Fraction(aFact.GetNumerator(), aFact.GetDenominator());
mnEmuMul = aFact.GetNumerator();
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 4d7229e4519b..63324ec652e6 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1583,10 +1583,10 @@ void MSWordExportBase::BulletDefinitions()
{
for (size_t i = 0; i < m_vecBulletPic.size(); ++i)
{
- const MapMode aMapMode(MAP_TWIP);
+ const MapMode aMapMode(MapUnit::MapTwip);
const Graphic& rGraphic = *m_vecBulletPic[i];
Size aSize(rGraphic.GetPrefSize());
- if (MAP_PIXEL == rGraphic.GetPrefMapMode().GetMapUnit())
+ if (MapUnit::MapPixel == rGraphic.GetPrefMapMode().GetMapUnit())
aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMapMode);
else
aSize = OutputDevice::LogicToLogic(aSize,rGraphic.GetPrefMapMode(), aMapMode);
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 33cf02b8677c..3f41f87415ea 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -2365,8 +2365,8 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString,
static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() );
aTmp <<= ((float)aSize.Height()) / 20.0;
- aFont.SetFontSize(OutputDevice::LogicToLogic(aSize, MAP_TWIP,
- MAP_100TH_MM));
+ aFont.SetFontSize(OutputDevice::LogicToLogic(aSize, MapUnit::MapTwip,
+ MapUnit::Map100thMM));
}
break;
@@ -2405,7 +2405,7 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString,
if (pOut)
{
pOut->Push( PushFlags::FONT | PushFlags::MAPMODE );
- pOut->SetMapMode( MapMode( MAP_100TH_MM ));
+ pOut->SetMapMode( MapMode( MapUnit::Map100thMM ));
pOut->SetFont( aFont );
aRet.Width = pOut->GetTextWidth(rString);
aRet.Width += 500; //plus size of button, total hack territory
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index cbecacd75432..7f88b578b634 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -164,7 +164,7 @@ static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp,
return false;
}
- rWMF.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
+ rWMF.SetPrefMapMode( MapMode( MapUnit::Map100thMM ) );
// Scale MetaFile to new size and save new size to MetaFile
Size aOldSiz( rWMF.GetPrefSize() );
@@ -270,7 +270,7 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf,
pTempSet->Put( aAnchor );
const Size aSizeTwip = OutputDevice::LogicToLogic(
- aGraph.GetPrefSize(), aGraph.GetPrefMapMode(), MAP_TWIP );
+ aGraph.GetPrefSize(), aGraph.GetPrefMapMode(), MapUnit::MapTwip );
pTempSet->Put( SwFormatFrameSize( ATT_FIX_SIZE, aSizeTwip.Width(),
aSizeTwip.Height() ) );
@@ -319,7 +319,7 @@ bool SwWW8ImplReader::ImportOleWMF(tools::SvRef<SotStorage> xSrc1,GDIMetaFile &r
aFinalSize.Width() = rX;
aFinalSize.Height() = rY;
aFinalSize = OutputDevice::LogicToLogic(
- aFinalSize, MAP_TWIP, rWMF.GetPrefMapMode() );
+ aFinalSize, MapUnit::MapTwip, rWMF.GetPrefMapMode() );
aOrigSize = rWMF.GetPrefSize();
Fraction aScaleX(aFinalSize.Width(),aOrigSize.Width());
Fraction aScaleY(aFinalSize.Height(),aOrigSize.Height());
@@ -354,7 +354,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
{
rGraph = *pGrf;
const Size aSizeTwip = OutputDevice::LogicToLogic(
- rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MAP_TWIP );
+ rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MapUnit::MapTwip );
nX = aSizeTwip.Width();
nY = aSizeTwip.Height();
}
@@ -368,7 +368,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
{
// 03-META stream is not available. Maybe it's a 03-PICT?
const Size aSizeTwip = OutputDevice::LogicToLogic(
- rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MAP_TWIP );
+ rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MapUnit::MapTwip );
nX = aSizeTwip.Width();
nY = aSizeTwip.Height();
// PICT: no WMF available -> Graphic instead of OLE
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index b87a04cfbea9..abbb8f5bc6c5 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -357,7 +357,7 @@ void SwXMLExport::GetViewSettings(Sequence<PropertyValue>& aProps)
SwDoc *pDoc = getDoc();
const Rectangle rRect =
pDoc->GetDocShell()->GetVisArea( ASPECT_CONTENT );
- bool bTwip = pDoc->GetDocShell()->GetMapUnit ( ) == MAP_TWIP;
+ bool bTwip = pDoc->GetDocShell()->GetMapUnit ( ) == MapUnit::MapTwip;
OSL_ENSURE( bTwip, "Map unit for visible area is not in TWIPS!" );
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 341154e71b82..4ee54299d8a2 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1021,8 +1021,8 @@ void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & aViewProps)
bool bChangeShowRedline = false, bChangeBrowseMode = false;
//TODO/LATER: why that cast?!
- bool bTwip = pDoc->GetDocShell()->GetMapUnit ( ) == MAP_TWIP;
- //sal_Bool bTwip = pDoc->GetDocShell()->SfxInPlaceObject::GetMapUnit ( ) == MAP_TWIP;
+ bool bTwip = pDoc->GetDocShell()->GetMapUnit ( ) == MapUnit::MapTwip;
+ //sal_Bool bTwip = pDoc->GetDocShell()->SfxInPlaceObject::GetMapUnit ( ) == MapUnit::MapTwip;
for (sal_Int32 i = 0; i < nCount ; i++)
{
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index f652a32b176d..651ba668ac59 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -132,7 +132,7 @@ static void lcl_addOutplaceProperties(
const rtl::Reference < XMLPropertySetMapper >& rMapper )
{
{
- MapMode aMode( MAP_100TH_MM ); // the API expects this map mode for the embedded objects
+ MapMode aMode( MapUnit::Map100thMM ); // the API expects this map mode for the embedded objects
Size aSize = rObj.GetSize( &aMode ); // get the size in the requested map mode
if( aSize.Width() && aSize.Height() )
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index b83ef45d8da7..784909fdbfdd 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -286,7 +286,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
if ( xObj.is() )
{
//TODO/LATER: is it enough to only set the VisAreaSize?
- lcl_setObjectVisualArea( xObj, nAspect, aTwipSize, MAP_TWIP );
+ lcl_setObjectVisualArea( xObj, nAspect, aTwipSize, MapUnit::MapTwip );
}
if( pTextCursor )
@@ -527,7 +527,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
pDoc->GetPersist()->GetEmbeddedObjectContainer().GetEmbeddedObject( aObjName );
if( xObj.is() )
lcl_setObjectVisualArea( xObj, ( nDrawAspect ? nDrawAspect : embed::Aspects::MSOLE_CONTENT ),
- aVisArea.GetSize(), MAP_100TH_MM );
+ aVisArea.GetSize(), MapUnit::Map100thMM );
}
return xPropSet;
@@ -656,7 +656,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet(
lcl_setObjectVisualArea( aAppletImpl.GetApplet(),
embed::Aspects::MSOLE_CONTENT,
Size( nWidth, nHeight ),
- MAP_100TH_MM );
+ MapUnit::Map100thMM );
SwFrameFormat *pFrameFormat = pDoc->getIDocumentContentOperations().Insert( *pTextCursor->GetPaM(),
::svt::EmbeddedObjectRef( aAppletImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT ),
@@ -718,7 +718,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin(
lcl_setObjectVisualArea( xObj,
embed::Aspects::MSOLE_CONTENT,
Size( nWidth, nHeight ),
- MAP_100TH_MM );
+ MapUnit::Map100thMM );
if ( svt::EmbeddedObjectRef::TryRunningState( xObj ) )
{
@@ -851,7 +851,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
lcl_setObjectVisualArea( xObj,
embed::Aspects::MSOLE_CONTENT,
Size( nWidth, nHeight ),
- MAP_100TH_MM );
+ MapUnit::Map100thMM );
if ( svt::EmbeddedObjectRef::TryRunningState( xObj ) )
{
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 77ba0cd65bdb..c7a0ac320d5c 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -348,7 +348,7 @@ void SwDropCapsPict::Paint(vcl::RenderContext& rRenderContext, const Rectangle&
if (!IsVisible())
return;
- rRenderContext.SetMapMode(MapMode(MAP_PIXEL));
+ rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel));
rRenderContext.SetLineColor();
rRenderContext.SetFillColor(maBackColor);
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 57310326943f..4577c53cf567 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -432,7 +432,7 @@ void SwCaptionPreview::SetPreviewText(const OUString& rText)
Size SwCaptionPreview::GetOptimalSize() const
{
- return LogicToPixel(Size(106 , 20), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(106 , 20), MapMode(MapUnit::MapAppFont));
}
void SwCaptionPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 05335159f7ec..bd0ab49f141e 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -648,7 +648,7 @@ static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
sal_Int32 nHeight, sal_uInt16 nFontHeightWhich)
{
float fSize = (float)nHeight / 10;
- nHeight = CalcToUnit( fSize, MAP_TWIP );
+ nHeight = CalcToUnit( fSize, MapUnit::MapTwip );
SwTextFormatColl *pColl = pWrtShell->GetTextCollFromPool(nType);
pColl->SetFormatAttr(SvxFontHeightItem(nHeight, 100, nFontHeightWhich));
}
@@ -677,27 +677,27 @@ bool SwStdFontTabPage::FillItemSet( SfxItemSet* )
if(bStandardHeightChanged)
{
float fSize = (float)m_pStandardHeightLB->GetValue() / 10;
- m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MAP_TWIP ), FONT_STANDARD, m_nFontGroup );
+ m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_STANDARD, m_nFontGroup );
}
if(bTitleHeightChanged)
{
float fSize = (float)m_pTitleHeightLB->GetValue() / 10;
- m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MAP_TWIP ), FONT_OUTLINE, m_nFontGroup );
+ m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_OUTLINE, m_nFontGroup );
}
if(bListHeightChanged)
{
float fSize = (float)m_pListHeightLB->GetValue() / 10;
- m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MAP_TWIP ), FONT_LIST, m_nFontGroup );
+ m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_LIST, m_nFontGroup );
}
if(bLabelHeightChanged)
{
float fSize = (float)m_pLabelHeightLB->GetValue() / 10;
- m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MAP_TWIP ), FONT_CAPTION, m_nFontGroup );
+ m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_CAPTION, m_nFontGroup );
}
if(bIndexHeightChanged)
{
float fSize = (float)m_pIndexHeightLB->GetValue() / 10;
- m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MAP_TWIP ), FONT_INDEX, m_nFontGroup );
+ m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_INDEX, m_nFontGroup );
}
if(m_pWrtShell)
@@ -725,7 +725,7 @@ bool SwStdFontTabPage::FillItemSet( SfxItemSet* )
if(bStandardHeightChanged)
{
float fSize = (float)m_pStandardHeightLB->GetValue() / 10;
- m_pWrtShell->SetDefault(SvxFontHeightItem( CalcToUnit( fSize, MAP_TWIP ), 100, nFontHeightWhich ) );
+ m_pWrtShell->SetDefault(SvxFontHeightItem( CalcToUnit( fSize, MapUnit::MapTwip ), 100, nFontHeightWhich ) );
SwTextFormatColl *pColl = m_pWrtShell->GetTextCollFromPool(RES_POOLCOLL_STANDARD);
pColl->ResetFormatAttr(nFontHeightWhich);
bMod = true;
@@ -949,11 +949,11 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet)
aFontMetric = m_pFontList->Get(sIdxBackup, sIdxBackup );
m_pIndexHeightLB->Fill( &aFontMetric, m_pFontList );
- m_pStandardHeightLB->SetValue( CalcToPoint( nStandardHeight, MAP_TWIP, 10 ) );
- m_pTitleHeightLB-> SetValue( CalcToPoint( nTitleHeight , MAP_TWIP, 10 ) );
- m_pListHeightLB-> SetValue( CalcToPoint( nListHeight , MAP_TWIP, 10 ) );
- m_pLabelHeightLB-> SetValue( CalcToPoint( nLabelHeight , MAP_TWIP, 10 ));
- m_pIndexHeightLB-> SetValue( CalcToPoint( nIndexHeight , MAP_TWIP, 10 ));
+ m_pStandardHeightLB->SetValue( CalcToPoint( nStandardHeight, MapUnit::MapTwip, 10 ) );
+ m_pTitleHeightLB-> SetValue( CalcToPoint( nTitleHeight , MapUnit::MapTwip, 10 ) );
+ m_pListHeightLB-> SetValue( CalcToPoint( nListHeight , MapUnit::MapTwip, 10 ) );
+ m_pLabelHeightLB-> SetValue( CalcToPoint( nLabelHeight , MapUnit::MapTwip, 10 ));
+ m_pIndexHeightLB-> SetValue( CalcToPoint( nIndexHeight , MapUnit::MapTwip, 10 ));
m_pStandardBox->SaveValue();
m_pTitleBox->SaveValue();
@@ -985,19 +985,19 @@ IMPL_LINK_NOARG(SwStdFontTabPage, StandardHdl, Button*, void)
m_pStandardHeightLB->SetValue( CalcToPoint(
SwStdFontConfig::GetDefaultHeightFor(FONT_STANDARD + nFontOffset, m_eLanguage),
- MAP_TWIP, 10 ) );
+ MapUnit::MapTwip, 10 ) );
m_pTitleHeightLB ->SetValue(CalcToPoint(
SwStdFontConfig::GetDefaultHeightFor(FONT_OUTLINE +
- nFontOffset, m_eLanguage), MAP_TWIP, 10 ));
+ nFontOffset, m_eLanguage), MapUnit::MapTwip, 10 ));
m_pListHeightLB ->SetValue(CalcToPoint(
SwStdFontConfig::GetDefaultHeightFor(FONT_LIST + nFontOffset, m_eLanguage),
- MAP_TWIP, 10 ));
+ MapUnit::MapTwip, 10 ));
m_pLabelHeightLB ->SetValue(CalcToPoint(
SwStdFontConfig::GetDefaultHeightFor(FONT_CAPTION + nFontOffset, m_eLanguage),
- MAP_TWIP, 10 ));
+ MapUnit::MapTwip, 10 ));
m_pIndexHeightLB ->SetValue(CalcToPoint(
SwStdFontConfig::GetDefaultHeightFor(FONT_INDEX + nFontOffset, m_eLanguage),
- MAP_TWIP, 10 ));
+ MapUnit::MapTwip, 10 ));
}
IMPL_LINK( SwStdFontTabPage, ModifyHdl, Edit&, rBox, void )
@@ -1570,7 +1570,7 @@ SwMarkPreview::SwMarkPreview( vcl::Window *pParent, WinBits nWinBits ) :
{
m_aInitialSize = getPreviewOptionsSize(this);
InitColors();
- SetMapMode(MAP_PIXEL);
+ SetMapMode(MapUnit::MapPixel);
}
VCL_BUILDER_FACTORY_ARGS(SwMarkPreview, 0)
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index d001831e308e..682e5b76035a 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -159,7 +159,7 @@ void SwAddrSourceLB::setColSizes()
long nTabs[] = { 2, 0, nWidth/2 };
- SvSimpleTable::SetTabs(&nTabs[0], MAP_PIXEL);
+ SvSimpleTable::SetTabs(&nTabs[0], MapUnit::MapPixel);
}
SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
@@ -195,7 +195,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
m_pTablePB->SetClickHdl(LINK( this, SwAddressListDialog, TableSelectHdl_Impl));
SvSimpleTableContainer *pHeaderTreeContainer = get<SvSimpleTableContainer>("sources");
- Size aSize = pHeaderTreeContainer->LogicToPixel(Size(182 , 102), MAP_APPFONT);
+ Size aSize = pHeaderTreeContainer->LogicToPixel(Size(182 , 102), MapUnit::MapAppFont);
pHeaderTreeContainer->set_width_request(aSize.Width());
pHeaderTreeContainer->set_height_request(aSize.Height());
m_pListLB = VclPtr<SwAddrSourceLB>::Create(*pHeaderTreeContainer);
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index ebb3e0eb1b6a..cf8b9f83e545 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -148,8 +148,8 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
std::vector< OUString >::iterator aHeaderIter;
- long nFTXPos = m_pWindow->LogicToPixel(Point(RSC_SP_CTRL_X, RSC_SP_CTRL_X), MAP_APPFONT).X();
- long nFTHeight = m_pWindow->LogicToPixel(Size(RSC_BS_CHARHEIGHT, RSC_BS_CHARHEIGHT), MAP_APPFONT).Height();
+ long nFTXPos = m_pWindow->LogicToPixel(Point(RSC_SP_CTRL_X, RSC_SP_CTRL_X), MapUnit::MapAppFont).X();
+ long nFTHeight = m_pWindow->LogicToPixel(Size(RSC_BS_CHARHEIGHT, RSC_BS_CHARHEIGHT), MapUnit::MapAppFont).Height();
long nFTWidth = 0;
//determine the width of the FixedTexts
@@ -164,12 +164,12 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
//add some pixels
nFTWidth += 2;
long nEDXPos = nFTWidth + nFTXPos +
- m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_X, RSC_SP_CTRL_DESC_X), MAP_APPFONT).Width();
- long nEDHeight = m_pWindow->LogicToPixel(Size(RSC_CD_TEXTBOX_HEIGHT, RSC_CD_TEXTBOX_HEIGHT), MAP_APPFONT).Height();
+ m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_X, RSC_SP_CTRL_DESC_X), MapUnit::MapAppFont).Width();
+ long nEDHeight = m_pWindow->LogicToPixel(Size(RSC_CD_TEXTBOX_HEIGHT, RSC_CD_TEXTBOX_HEIGHT), MapUnit::MapAppFont).Height();
long nEDWidth = m_aWinOutputSize.Width() - nEDXPos - nFTXPos;
- m_nLineHeight = nEDHeight + m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_GROUP_Y, RSC_SP_CTRL_GROUP_Y), MAP_APPFONT).Height();
+ m_nLineHeight = nEDHeight + m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_GROUP_Y, RSC_SP_CTRL_GROUP_Y), MapUnit::MapAppFont).Height();
- long nEDYPos = m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_Y, RSC_SP_CTRL_DESC_Y), MAP_APPFONT).Height();
+ long nEDYPos = m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_Y, RSC_SP_CTRL_DESC_Y), MapUnit::MapAppFont).Height();
long nFTYPos = nEDYPos + nEDHeight - nFTHeight;
Link<Control&,void> aFocusLink = LINK(this, SwAddressControl_Impl, GotFocusHdl_Impl);
@@ -206,7 +206,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
{
//the m_aWindow has to be at least as high as the ScrollBar and it must include the last Edit
sal_Int32 nContentHeight = pLastEdit->GetPosPixel().Y() + nEDHeight +
- m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_GROUP_Y, RSC_SP_CTRL_GROUP_Y), MAP_APPFONT).Height();
+ m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_GROUP_Y, RSC_SP_CTRL_GROUP_Y), MapUnit::MapAppFont).Height();
if(nContentHeight < m_pScrollBar->GetSizePixel().Height())
{
nContentHeight = m_pScrollBar->GetSizePixel().Height();
@@ -358,7 +358,7 @@ bool SwAddressControl_Impl::PreNotify( NotifyEvent& rNEvt )
Size SwAddressControl_Impl::GetOptimalSize() const
{
- return LogicToPixel(Size(250, 160), MAP_APPFONT);
+ return LogicToPixel(Size(250, 160), MapUnit::MapAppFont);
}
void SwAddressControl_Impl::Resize()
diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.cxx b/sw/source/ui/dbui/dbtablepreviewdialog.cxx
index 6b07ce4b4cfc..e501fe9772a1 100644
--- a/sw/source/ui/dbui/dbtablepreviewdialog.cxx
+++ b/sw/source/ui/dbui/dbtablepreviewdialog.cxx
@@ -37,7 +37,7 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(vcl::Window* pParent, uno::Sequen
{
get(m_pDescriptionFI, "description");
get(m_pBeamerWIN, "beamer");
- Size aSize(LogicToPixel(Size(338, 150), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(338, 150), MapUnit::MapAppFont));
m_pBeamerWIN->set_width_request(aSize.Width());
m_pBeamerWIN->set_height_request(aSize.Height());
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 5d92cec760b0..cbb93621468c 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -64,14 +64,14 @@ SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage( SwMailMergeWizard* _pP
get(m_pSettingsFI, "settingsft");
get(m_pAddressCB, "address");
get(m_pSettingsWIN, "settingspreview");
- Size aSize(LogicToPixel(Size(164 , 45), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(164 , 45), MapUnit::MapAppFont));
m_pSettingsWIN->set_width_request(aSize.Width());
m_pSettingsWIN->set_height_request(aSize.Height());
get(m_pSettingsPB, "settings");
get(m_pHideEmptyParagraphsCB, "hideempty");
get(m_pAssignPB, "assign");
get(m_pPreviewWIN, "addresspreview");
- aSize = LogicToPixel(Size(176, 46), MAP_APPFONT);
+ aSize = LogicToPixel(Size(176, 46), MapUnit::MapAppFont);
m_pPreviewWIN->set_width_request(aSize.Width());
m_pPreviewWIN->set_height_request(aSize.Height());
get(m_pDocumentIndexFI, "documentindex");
@@ -322,7 +322,7 @@ SwSelectAddressBlockDialog::SwSelectAddressBlockDialog(
, m_rConfig(rConfig)
{
get(m_pPreview, "preview");
- Size aSize(m_pPreview->LogicToPixel(Size(192, 100), MAP_APPFONT));
+ Size aSize(m_pPreview->LogicToPixel(Size(192, 100), MapUnit::MapAppFont));
m_pPreview->set_width_request(aSize.Width());
m_pPreview->set_height_request(aSize.Height());
get(m_pNewPB, "new");
@@ -858,7 +858,7 @@ SwAssignFieldsControl::SwAssignFieldsControl(vcl::Window* pParent, WinBits nBits
Size SwAssignFieldsControl::GetOptimalSize() const
{
- return LogicToPixel(Size(248 , 120), MAP_APPFONT);
+ return LogicToPixel(Size(248 , 120), MapUnit::MapAppFont);
}
void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem)
@@ -1163,7 +1163,7 @@ SwAssignFieldsDialog::SwAssignFieldsDialog(
get(m_pPreviewFI, "PREVIEW_LABEL");
get(m_pOK, "ok");
get(m_pPreviewWIN, "PREVIEW");
- Size aSize(LogicToPixel(Size(248 , 45), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(248 , 45), MapUnit::MapAppFont));
m_pPreviewWIN->set_width_request(aSize.Width());
m_pPreviewWIN->set_height_request(aSize.Height());
get(m_pFieldsControl, "FIELDS");
@@ -1327,7 +1327,7 @@ void AddressMultiLineEdit::dispose()
Size AddressMultiLineEdit::GetOptimalSize() const
{
- return LogicToPixel(Size(160, 60), MAP_APPFONT);
+ return LogicToPixel(Size(160, 60), MapUnit::MapAppFont);
}
VCL_BUILDER_DECL_FACTORY(AddressMultiLineEdit)
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index c77e2f77ec24..4a6ed92e73b2 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -86,7 +86,7 @@ SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(SwMailMergeWizard* pParent)
//Temp hack until all pages are converted to .ui and wizard
//base class adapted
- SetSizePixel(LogicToPixel(Size(260 , 250), MapMode(MAP_APPFONT)));
+ SetSizePixel(LogicToPixel(Size(260 , 250), MapMode(MapUnit::MapAppFont)));
}
SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage()
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index c27e9c35bc68..54cddf71f813 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -250,7 +250,7 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage(SwMailMergeWizard* _pParent)
get(m_pNeutralCB, "general");
get(m_pPreviewFI, "previewft");
get(m_pPreviewWIN, "preview");
- Size aSize(LogicToPixel(Size(186, 21), MapMode(MAP_APPFONT)));
+ Size aSize(LogicToPixel(Size(186, 21), MapMode(MapUnit::MapAppFont)));
m_pPreviewWIN->set_width_request(aSize.Width());
m_pPreviewWIN->set_height_request(aSize.Height());
get(m_pAssignPB, "assign");
@@ -427,7 +427,7 @@ SwMailBodyDialog::SwMailBodyDialog(vcl::Window* pParent) :
get(m_pBodyFT, "bodyft");
get(m_pBodyMLE, "bodymle");
m_pBodyMLE->SetStyle(m_pBodyMLE->GetStyle() | WB_HSCROLL | WB_VSCROLL | WB_IGNORETAB);
- Size aSize(LogicToPixel(Size(180, 50), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(180, 50), MapUnit::MapAppFont));
m_pBodyMLE->set_width_request(aSize.Width());
m_pBodyMLE->set_height_request(aSize.Height());
get(m_pOK, "ok");
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 15838bbf25de..f2f9ff4be585 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -91,7 +91,7 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
get(m_pUpPB, "up");
get(m_pDownPB, "down");
get(m_pExampleContainerWIN, "example");
- Size aSize(LogicToPixel(Size(124, 159), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(124, 159), MapUnit::MapAppFont));
m_pExampleContainerWIN->set_width_request(aSize.Width());
m_pExampleContainerWIN->set_height_request(aSize.Height());
get(m_pZoomLB, "zoom");
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 73413e40dc56..5e42b2f8b973 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -271,7 +271,7 @@ SwSendMailDialog::SwSendMailDialog(vcl::Window *pParent, SwMailMergeConfigItem&
m_nSendCount(0),
m_nErrorCount(0)
{
- Size aSize = m_pContainer->LogicToPixel(Size(226, 80), MAP_APPFONT);
+ Size aSize = m_pContainer->LogicToPixel(Size(226, 80), MapUnit::MapAppFont);
m_pContainer->set_width_request(aSize.Width());
m_pContainer->set_height_request(aSize.Height());
m_pStatus = VclPtr<SvSimpleTable>::Create(*m_pContainer);
@@ -296,7 +296,7 @@ SwSendMailDialog::SwSendMailDialog(vcl::Window *pParent, SwMailMergeConfigItem&
static long nTabs[] = {2, 0, nPos1};
m_pStatus->SetStyle( m_pStatus->GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
m_pStatus->SetSelectionMode( SelectionMode::Single );
- m_pStatus->SetTabs(&nTabs[0], MAP_PIXEL);
+ m_pStatus->SetTabs(&nTabs[0], MapUnit::MapPixel);
m_pStatus->SetSpaceBetweenEntries(3);
UpdateTransferStatus();
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index 230e191e724e..66f01dc07bdd 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -86,7 +86,7 @@ void SwAddressTable::setColSizes()
nTabs_Impl[1] = 0;
nTabs_Impl[2] = nWidth;
- SvSimpleTable::SetTabs(&nTabs_Impl[0], MAP_PIXEL);
+ SvSimpleTable::SetTabs(&nTabs_Impl[0], MapUnit::MapPixel);
}
SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent,
@@ -101,7 +101,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent,
get(m_pPreviewPB, "preview");
SvSimpleTableContainer *pHeaderTreeContainer = get<SvSimpleTableContainer>("table");
- Size aSize = pHeaderTreeContainer->LogicToPixel(Size(238 , 50), MAP_APPFONT);
+ Size aSize = pHeaderTreeContainer->LogicToPixel(Size(238 , 50), MapUnit::MapAppFont);
pHeaderTreeContainer->set_width_request(aSize.Width());
pHeaderTreeContainer->set_height_request(aSize.Height());
m_pTable = VclPtr<SwAddressTable>::Create(*pHeaderTreeContainer);
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index a15de6dcc864..733b42cd1718 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -235,7 +235,7 @@ IMPL_LINK( SwEnvFormatPage, ModifyHdl, SpinField&, rEdit, void )
long nRotatedWidth = lHeight;
long nRotatedHeight = lWidth;
Paper ePaper = SvxPaperInfo::GetSvxPaper(
- Size(nRotatedWidth, nRotatedHeight), MAP_TWIP, true);
+ Size(nRotatedWidth, nRotatedHeight), MapUnit::MapTwip, true);
for (size_t i = 0; i < aIDs.size(); ++i)
if (aIDs[i] == (sal_uInt16)ePaper)
m_pSizeFormatBox->SelectEntryPos(static_cast<sal_Int32>(i));
@@ -517,7 +517,7 @@ void SwEnvFormatPage::Reset(const SfxItemSet* rSet)
Paper ePaper = SvxPaperInfo::GetSvxPaper(
Size( std::min(rItem.lWidth, rItem.lHeight),
- std::max(rItem.lWidth, rItem.lHeight)), MAP_TWIP, true);
+ std::max(rItem.lWidth, rItem.lHeight)), MapUnit::MapTwip, true);
for (size_t i = 0; i < aIDs.size(); ++i)
if (aIDs[i] == (sal_uInt16)ePaper)
m_pSizeFormatBox->SelectEntryPos(static_cast<sal_Int32>(i));
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index d027f0270f2a..c73699fbde24 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -49,12 +49,12 @@ using namespace ::com::sun::star;
SwEnvPreview::SwEnvPreview(vcl::Window* pParent, WinBits nStyle)
: Window(pParent, nStyle)
{
- SetMapMode(MapMode(MAP_PIXEL));
+ SetMapMode(MapMode(MapUnit::MapPixel));
}
Size SwEnvPreview::GetOptimalSize() const
{
- return LogicToPixel(Size(84 , 63), MAP_APPFONT);
+ return LogicToPixel(Size(84 , 63), MapUnit::MapAppFont);
}
VCL_BUILDER_FACTORY_ARGS(SwEnvPreview, 0)
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index cc9b92391201..75ee218a6bc3 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -112,7 +112,7 @@ SwLabPreview::SwLabPreview(vcl::Window* pParent)
, m_aPWidthStr(SW_RESSTR(STR_PWIDTH))
, m_aPHeightStr(SW_RESSTR(STR_PHEIGHT))
{
- SetMapMode(MAP_PIXEL);
+ SetMapMode(MapUnit::MapPixel);
// FIXME RenderContext
@@ -139,7 +139,7 @@ SwLabPreview::SwLabPreview(vcl::Window* pParent)
Size SwLabPreview::GetOptimalSize() const
{
- return LogicToPixel(Size(146 , 161), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(146 , 161), MapMode(MapUnit::MapAppFont));
}
VCL_BUILDER_FACTORY(SwLabPreview)
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index ed26ffbe74fc..fe769115b0a2 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -58,7 +58,7 @@ SwFieldDBPage::SwFieldDBPage(vcl::Window* pParent, const SfxItemSet *const pCore
m_pTypeLB->set_height_request(nHeight);
m_pDatabaseTLB->set_height_request(nHeight);
- long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width();
+ long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width();
m_pTypeLB->set_width_request(nWidth);
m_pDatabaseTLB->set_width_request(nWidth*2);
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 7f92d992b82a..e556eb1f7a44 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -66,7 +66,7 @@ SwFieldDokInfPage::SwFieldDokInfPage(vcl::Window* pParent, const SfxItemSet *con
m_pSelectionLB->set_height_request(nHeight);
m_pFormatLB->set_height_request(nHeight);
- long nWidth = m_pTypeTLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width();
+ long nWidth = m_pTypeTLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width();
m_pTypeTLB->set_width_request(nWidth);
m_pFormatLB->set_width_request(nWidth);
m_pSelectionLB->set_width_request(nWidth);
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index 1d4dce0d107c..df89661bcc2f 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -62,7 +62,7 @@ SwFieldDokPage::SwFieldDokPage(vcl::Window* pParent, const SfxItemSet *const pCo
m_pSelectionLB->set_height_request(nHeight);
m_pFormatLB->set_height_request(nHeight);
- long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width();
+ long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width();
m_pTypeLB->set_width_request(nWidth);
m_pSelectionLB->set_width_request(nWidth);
m_pFormatLB->set_width_request(nWidth);
diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index 60a17d53eb4f..edf169f2e5e9 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -76,7 +76,7 @@ SwFieldFuncPage::SwFieldFuncPage(vcl::Window* pParent, const SfxItemSet *const p
m_pTypeLB->set_height_request(nHeight);
m_pFormatLB->set_height_request(nHeight);
- long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width();
+ long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width();
m_pTypeLB->set_width_request(nWidth);
m_pFormatLB->set_width_request(nWidth);
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index ab7ce0e6e2cf..83356a0e9e7a 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -86,7 +86,7 @@ SwFieldRefPage::SwFieldRefPage(vcl::Window* pParent, const SfxItemSet *const pCo
m_pTypeLB->set_height_request(nHeight);
m_pFormatLB->set_height_request(nHeight);
- long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width();
+ long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width();
m_pTypeLB->set_width_request(nWidth);
m_pFormatLB->set_width_request(nWidth);
m_pSelection->set_width_request(nWidth*2);
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index 95a367e968ab..3c3cbac9839a 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -67,7 +67,7 @@ SwFieldVarPage::SwFieldVarPage(vcl::Window* pParent, const SfxItemSet *const pCo
m_pSelectionLB->set_height_request(nHeight);
m_pFormatLB->set_height_request(nHeight/2);
- long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MAP_APPFONT)).Width();
+ long nWidth = m_pTypeLB->LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width();
m_pTypeLB->set_width_request(nWidth);
m_pSelectionLB->set_width_request(nWidth);
m_pFormatLB->set_width_request(nWidth);
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index f56babc26998..f3d5931111e0 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -523,7 +523,7 @@ SwColumnPage::SwColumnPage(vcl::Window *pParent, const SfxItemSet &rSet)
long nLineWidth = static_cast<long>(MetricField::ConvertDoubleValue(
m_pLineWidthEdit->GetValue( ),
m_pLineWidthEdit->GetDecimalDigits( ),
- m_pLineWidthEdit->GetUnit(), MAP_TWIP ));
+ m_pLineWidthEdit->GetUnit(), MapUnit::MapTwip ));
m_pLineTypeDLB->SetWidth( nLineWidth );
// Fill the color listbox
@@ -753,7 +753,7 @@ IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr, Edit&, void )
long nLineWidth = static_cast<long>(MetricField::ConvertDoubleValue(
m_pLineWidthEdit->GetValue( ),
m_pLineWidthEdit->GetDecimalDigits( ),
- m_pLineWidthEdit->GetUnit(), MAP_TWIP ));
+ m_pLineWidthEdit->GetUnit(), MapUnit::MapTwip ));
if( !bEnable )
m_pColMgr->SetNoLine();
else
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 7b16081b027a..1312236faf24 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2639,7 +2639,7 @@ BmpWindow::BmpWindow(vcl::Window* pPar, WinBits nStyle)
Size BmpWindow::GetOptimalSize() const
{
- return LogicToPixel(Size(127 , 66), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(127 , 66), MapMode(MapUnit::MapAppFont));
}
VCL_BUILDER_FACTORY_ARGS(BmpWindow, 0)
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 744d2952119c..52421db6dc87 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -235,7 +235,7 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(vcl::Window* pParent, const SfxItemSet&
{
get(m_pShowExampleCB, "showexample");
get(m_pExampleContainerWIN, "example");
- Size aWinSize(LogicToPixel(Size(150, 188), MapMode(MAP_APPFONT)));
+ Size aWinSize(LogicToPixel(Size(150, 188), MapMode(MapUnit::MapAppFont)));
m_pExampleContainerWIN->set_width_request(aWinSize.Width());
m_pExampleContainerWIN->set_height_request(aWinSize.Height());
m_pExampleContainerWIN->SetSizePixel(aWinSize);
@@ -624,7 +624,7 @@ void SwIndexTreeLB::setColSizes()
for(sal_uInt16 i = 1; i <= MAXLEVEL; ++i)
nTabs_Impl[i+1] = nTabs_Impl[i] + nWidth;
- SvSimpleTable::SetTabs(&nTabs_Impl[0], MAP_PIXEL);
+ SvSimpleTable::SetTabs(&nTabs_Impl[0], MapUnit::MapPixel);
}
class SwAddStylesDlg_Impl : public SfxModalDialog
@@ -658,7 +658,7 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(vcl::Window* pParent,
get(m_pRightPB, "right");
OUString sHBFirst = get<FixedText>("notapplied")->GetText();
SvSimpleTableContainer *pHeaderTreeContainer = get<SvSimpleTableContainer>("styles");
- Size aSize = pHeaderTreeContainer->LogicToPixel(Size(273, 164), MAP_APPFONT);
+ Size aSize = pHeaderTreeContainer->LogicToPixel(Size(273, 164), MapUnit::MapAppFont);
pHeaderTreeContainer->set_width_request(aSize.Width());
pHeaderTreeContainer->set_height_request(aSize.Height());
m_pHeaderTree = VclPtr<SwIndexTreeLB>::Create(*pHeaderTreeContainer);
@@ -3940,7 +3940,7 @@ std::vector<long> SwEntryBrowseBox::GetOptimalColWidths() const
Size SwEntryBrowseBox::GetOptimalSize() const
{
- Size aSize = LogicToPixel(Size(276 , 175), MapMode(MAP_APPFONT));
+ Size aSize = LogicToPixel(Size(276 , 175), MapMode(MapUnit::MapAppFont));
std::vector<long> aWidths = GetOptimalColWidths();
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 329fef44ad73..591d5d0875fd 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -350,7 +350,7 @@ BookmarkTable::BookmarkTable(SvSimpleTableContainer& rParent) :
{
static long nTabs[] = {3, 0, 40, 150};
- SetTabs(nTabs, MAP_PIXEL);
+ SetTabs(nTabs, MapUnit::MapPixel);
SetSelectionMode(SelectionMode::Multiple);
InsertHeaderEntry(OUString(SW_RES(STR_PAGE)));
InsertHeaderEntry(OUString(SW_RES(STR_BOOKMARK_NAME)));
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 5a7f52cb3c31..fa2804d0ffbf 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -56,7 +56,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(vcl::Window * pParent,
get(m_pGroupTLB, "group");
const int nAppFontUnits = 130;
- long nWidth = LogicToPixel(Size(nAppFontUnits, 0), MAP_APPFONT).Width();
+ long nWidth = LogicToPixel(Size(nAppFontUnits, 0), MapUnit::MapAppFont).Width();
m_pPathLB->set_width_request(nWidth);
//just has to be something small, real size will be available space
m_pGroupTLB->set_width_request(nWidth);
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index c906e674623b..62e7a9125939 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -845,7 +845,7 @@ SwGlTreeListBox::SwGlTreeListBox(vcl::Window* pParent, WinBits nBits)
Size SwGlTreeListBox::GetOptimalSize() const
{
- return LogicToPixel(Size(212, 84), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(212, 84), MapMode(MapUnit::MapAppFont));
}
VCL_BUILDER_FACTORY_ARGS(SwGlTreeListBox, WB_BORDER | WB_TABSTOP)
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index cc55e81cd023..43a51888edf1 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -89,7 +89,7 @@ IMPL_LINK_NOARG(SwFootNotePage, LineWidthChanged_Impl, Edit&, void)
sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
m_pLineWidthEdit->GetValue( ),
m_pLineWidthEdit->GetDecimalDigits( ),
- m_pLineWidthEdit->GetUnit(), MAP_TWIP ));
+ m_pLineWidthEdit->GetUnit(), MapUnit::MapTwip ));
m_pLineTypeBox->SetWidth( nVal );
}
@@ -191,7 +191,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet)
sal_Int64 nWidthPt = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
sal_Int64( pFootnoteInfo->GetLineWidth() ), m_pLineWidthEdit->GetDecimalDigits(),
- MAP_TWIP, m_pLineWidthEdit->GetUnit( ) ));
+ MapUnit::MapTwip, m_pLineWidthEdit->GetUnit( ) ));
m_pLineWidthEdit->SetValue( nWidthPt );
// Separator style
@@ -290,7 +290,7 @@ bool SwFootNotePage::FillItemSet(SfxItemSet *rSet)
long nWidth = static_cast<long>(MetricField::ConvertDoubleValue(
m_pLineWidthEdit->GetValue( ),
m_pLineWidthEdit->GetDecimalDigits( ),
- m_pLineWidthEdit->GetUnit(), MAP_TWIP ));
+ m_pLineWidthEdit->GetUnit(), MapUnit::MapTwip ));
rFootnoteInfo.SetLineWidth( nWidth );
// Separator color
diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx
index e26316305c34..eef978327342 100644
--- a/sw/source/uibase/app/appenv.cxx
+++ b/sw/source/uibase/app/appenv.cxx
@@ -345,7 +345,7 @@ void SwModule::InsertEnv( SfxRequest& rReq )
// Borders (are put together by Shift-Offset and alignment)
Size aPaperSize = pPrt->PixelToLogic( pPrt->GetPaperSizePixel(),
- MAP_TWIP);
+ MapUnit::MapTwip);
if ( !aPaperSize.Width() && !aPaperSize.Height() )
aPaperSize = SvxPaperInfo::GetPaperSize(PAPER_A4);
if ( aPaperSize.Width() > aPaperSize.Height() )
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index 51955a3b4c3a..23361fcff200 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -105,7 +105,7 @@ using namespace ::com::sun::star;
bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
{
bool bRet = SfxObjectShell::InitNew( xStor );
- OSL_ENSURE( GetMapUnit() == MAP_TWIP, "map unit is not twip!" );
+ OSL_ENSURE( GetMapUnit() == MapUnit::MapTwip, "map unit is not twip!" );
bool bHTMLTemplSet = false;
if( bRet )
{
@@ -413,7 +413,7 @@ void SwDocShell::Init_Impl()
SetAutoStyleFilterIndex(3);
// set map unit to twip
- SetMapUnit( MAP_TWIP );
+ SetMapUnit( MapUnit::MapTwip );
}
void SwDocShell::AddLink()
diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index 441239e69272..a91511610f1f 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -164,7 +164,7 @@ VCL_BUILDER_DECL_FACTORY(SwDBTreeList)
Size SwDBTreeList::GetOptimalSize() const
{
- return LogicToPixel(Size(100, 62), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(100, 62), MapMode(MapUnit::MapAppFont));
}
SwDBTreeList::~SwDBTreeList()
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
index 105da59eb028..69d329a686c6 100644
--- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -770,7 +770,7 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
GetDrawOutliner().GetEmptyItemSet().GetPool(),
OutlinerMode::TextObject );
aTmpOutliner.SetRefDevice( pDoc->getIDocumentDeviceAccess().getPrinter( false ) );
- MapMode aMapMode (MAP_TWIP);
+ MapMode aMapMode (MapUnit::MapTwip);
aTmpOutliner.SetRefMapMode(aMapMode);
aTmpOutliner.SetPaperSize( pTextObj->GetLogicRect().GetSize() );
aTmpOutliner.SetSpeller( xSpell );
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 3821e8929933..3f7c245404aa 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -835,7 +835,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
// --> OD #i98753#
// set size of embedded object at the object description structure
- m_aObjDesc.maSize = OutputDevice::LogicToLogic( m_pWrtShell->GetObjSize(), MAP_TWIP, MAP_100TH_MM );
+ m_aObjDesc.maSize = OutputDevice::LogicToLogic( m_pWrtShell->GetObjSize(), MapUnit::MapTwip, MapUnit::Map100thMM );
// <--
PrepareOLE( m_aObjDesc );
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
@@ -982,7 +982,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
//Now adjust it. Thus in GetData the first query can still
//be answered with delayed rendering.
Size aSz( OLESIZE );
- m_aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MAP_TWIP, MAP_100TH_MM );
+ m_aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MapUnit::MapTwip, MapUnit::Map100thMM );
PrepareOLE( m_aObjDesc );
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
@@ -1075,7 +1075,7 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, const OUString& rStr
//Now adjust it. Thus in GetData the first query can still
//be answered with delayed rendering.
Size aSz( OLESIZE );
- m_aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MAP_TWIP, MAP_100TH_MM );
+ m_aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MapUnit::MapTwip, MapUnit::Map100thMM );
PrepareOLE( m_aObjDesc );
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
@@ -1857,7 +1857,7 @@ bool SwTransferable::PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
// if no other graphic is provided
// TODO/LATER: in future a default bitmap could be used
OUString aMimeType;
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
aGraphic.SetPrefSize( Size( 2500, 2500 ) );
aGraphic.SetPrefMapMode( aMapMode );
xObjRef.SetGraphic( aGraphic, aMimeType );
@@ -1872,7 +1872,7 @@ bool SwTransferable::PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
aSize = aObjDesc.maSize;
else
{
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
aSize = xObjRef.GetSize( &aMapMode );
}
}
@@ -1880,7 +1880,7 @@ bool SwTransferable::PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
{
aSize = Size( aObjDesc.maSize ); //always 100TH_MM
MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( aObjDesc.mnViewAspect ) );
- aSize = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aUnit );
+ aSize = OutputDevice::LogicToLogic( aSize, MapUnit::Map100thMM, aUnit );
awt::Size aSz;
try
{
@@ -3095,7 +3095,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
//be answered with delayed rendering.
m_aObjDesc.maDragStartPos = rSttPos;
m_aObjDesc.maSize = OutputDevice::LogicToLogic( Size( OLESIZE ),
- MAP_TWIP, MAP_100TH_MM );
+ MapUnit::MapTwip, MapUnit::Map100thMM );
PrepareOLE( m_aObjDesc );
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
}
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index c443ccfe5763..dea74020b11f 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -257,7 +257,7 @@ bool SwHeaderFooterWin::Contains( const Point &rDocPt ) const
void SwHeaderFooterWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
{
// Use pixels for the rest of the drawing
- SetMapMode(MapMode(MAP_PIXEL));
+ SetMapMode(MapMode(MapUnit::MapPixel));
const Rectangle aRect(Rectangle(Point(0, 0), rRenderContext.PixelToLogic(GetSizePixel())));
drawinglayer::primitive2d::Primitive2DContainer aSeq(3);
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index a081b8ed19b5..03fcc6b56535 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -102,7 +102,7 @@ SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwFrame *pFrame ) :
m_pMousePt( nullptr )
{
// Use pixels for the rest of the drawing
- SetMapMode( MapMode ( MAP_PIXEL ) );
+ SetMapMode( MapMode ( MapUnit::MapPixel ) );
// Create the line control
m_pLine = VclPtr<SwBreakDashedLine>::Create( GetEditWin(), &SwViewOption::GetPageBreakColor, this );
diff --git a/sw/source/uibase/docvw/SidebarScrollBar.cxx b/sw/source/uibase/docvw/SidebarScrollBar.cxx
index 70c589b3dc9e..45e2732b0e62 100644
--- a/sw/source/uibase/docvw/SidebarScrollBar.cxx
+++ b/sw/source/uibase/docvw/SidebarScrollBar.cxx
@@ -39,7 +39,7 @@ void SidebarScrollBar::LogicInvalidate(const Rectangle* pRectangle)
Push(PushFlags::MAPMODE);
EnableMapMode();
MapMode aMapMode = GetMapMode();
- aMapMode.SetMapUnit(MAP_TWIP);
+ aMapMode.SetMapUnit(MapUnit::MapTwip);
SetMapMode(aMapMode);
aRectangle = Rectangle(Point(0, 0), PixelToLogic(GetSizePixel()));
Pop();
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index cbccdcc21a1f..3c839781cb84 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -96,7 +96,7 @@ void lcl_translateTwips(vcl::Window& rParent, vcl::Window& rChild, MouseEvent* p
if (!rChild.IsMapModeEnabled())
{
MapMode aMapMode(rChild.GetMapMode());
- aMapMode.SetMapUnit(MAP_TWIP);
+ aMapMode.SetMapUnit(MapUnit::MapTwip);
aMapMode.SetScaleX(rParent.GetMapMode().GetScaleX());
aMapMode.SetScaleY(rParent.GetMapMode().GetScaleY());
rChild.SetMapMode(aMapMode);
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index a32e294d42f4..a79423a7f323 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5108,7 +5108,7 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView):
// initially use the input language
m_bUseInputLanguage = true;
- SetMapMode(MapMode(MAP_TWIP));
+ SetMapMode(MapMode(MapUnit::MapTwip));
SetPointer( PointerStyle::Text );
m_aTimer.SetTimeoutHdl(LINK(this, SwEditWin, TimerHandler));
diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx
index 4998f49882db..95865fe04031 100644
--- a/sw/source/uibase/docvw/srcedtw.cxx
+++ b/sw/source/uibase/docvw/srcedtw.cxx
@@ -994,7 +994,7 @@ void SwSrcEditWindow::SetFont()
//font height is stored in point and set in twip
aSize.Height() =
officecfg::Office::Common::Font::SourceViewFont::FontHeight::get() * 20;
- aFont.SetFontSize(m_pOutWin->LogicToPixel(aSize, MAP_TWIP));
+ aFont.SetFontSize(m_pOutWin->LogicToPixel(aSize, MapUnit::MapTwip));
GetTextEngine()->SetFont( aFont );
m_pOutWin->SetFont(aFont);
}
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index 4a42b146c3ad..60eb0c3abcf3 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -356,7 +356,7 @@ SwColumnOnlyExample::SwColumnOnlyExample(vcl::Window* pParent)
: Window(pParent)
, m_aFrameSize(1,1)
{
- SetMapMode( MapMode( MAP_TWIP ) );
+ SetMapMode( MapMode( MapUnit::MapTwip ) );
m_aWinSize = GetOptimalSize();
m_aWinSize.Height() -= 4;
m_aWinSize.Width() -= 4;
@@ -513,7 +513,7 @@ void SwColumnOnlyExample::SetColumns(const SwFormatCol& rCol)
Size SwColumnOnlyExample::GetOptimalSize() const
{
- return LogicToPixel(Size(75, 46), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(75, 46), MapMode(MapUnit::MapAppFont));
}
SwPageGridExample::~SwPageGridExample()
diff --git a/sw/source/uibase/lingu/sdrhhcwrap.cxx b/sw/source/uibase/lingu/sdrhhcwrap.cxx
index a5a7494ec37f..6a4fa73a0f48 100644
--- a/sw/source/uibase/lingu/sdrhhcwrap.cxx
+++ b/sw/source/uibase/lingu/sdrhhcwrap.cxx
@@ -67,7 +67,7 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw,
{
SetRefDevice( pView->GetDocShell()->GetDoc()->getIDocumentDeviceAccess().getPrinter( false ) );
- MapMode aMapMode (MAP_TWIP);
+ MapMode aMapMode (MapUnit::MapTwip);
SetRefMapMode(aMapMode);
Size aSize( 1, 1 );
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 33c4dacc4cd6..0da1e18ea824 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -1204,7 +1204,7 @@ void SwRedlineAcceptDlg::Initialize(const OUString& rExtraData)
{
sal_Int32 n3 = aStr.indexOf(';');
aStr = aStr.copy(n3 + 1);
- m_pTable->SetTab(i, aStr.toInt32(), MAP_PIXEL);
+ m_pTable->SetTab(i, aStr.toInt32(), MapUnit::MapPixel);
}
}
}
diff --git a/sw/source/uibase/shells/grfshex.cxx b/sw/source/uibase/shells/grfshex.cxx
index 69a18da6a07b..741e3cd54863 100644
--- a/sw/source/uibase/shells/grfshex.cxx
+++ b/sw/source/uibase/shells/grfshex.cxx
@@ -116,9 +116,9 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq )
if( aPrefSize.Width() && aPrefSize.Height() )
{
if( pWindow )
- aSize = pWindow->PixelToLogic( aPrefSize, MAP_TWIP );
+ aSize = pWindow->PixelToLogic( aPrefSize, MapUnit::MapTwip );
else
- aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_TWIP );
+ aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::MapTwip );
}
else
aSize = Size( 2835, 2835 );
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 2524dfb38d16..b5663aec62f9 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -355,7 +355,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
{
Size aSize(static_cast<const SvxSizeItem*>(pItem)->GetSize());
aSize = OutputDevice::LogicToLogic
- ( aSize, MapMode( MAP_TWIP ), MapMode( MAP_100TH_MM ) );
+ ( aSize, MapMode( MapUnit::MapTwip ), MapMode( MapUnit::Map100thMM ) );
if(aSize.Width() > MINLAY&& aSize.Height()> MINLAY)
{
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx b/sw/source/uibase/sidebar/PageFormatPanel.cxx
index 8e3b1a343e98..078f5e3f6ad1 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx
@@ -162,7 +162,7 @@ void PageFormatPanel::NotifyItemUpdate(
if(mpPaperOrientation->GetSelectEntryPos() == 1)
Swap(aPaperSize);
- Paper ePaper = SvxPaperInfo::GetSvxPaper(aPaperSize, static_cast<MapUnit>(meUnit),true);
+ Paper ePaper = SvxPaperInfo::GetSvxPaper(aPaperSize, meUnit,true);
mpPaperSizeBox->SetSelection( ePaper );
}
}
diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx
index 885bb515b26c..85825ce720c5 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.cxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.cxx
@@ -260,8 +260,8 @@ void PageMarginControl::SetMetricFieldMaxValues( const Size& rPageSize )
const long nMT = m_pTopMarginEdit->Denormalize( m_pTopMarginEdit->GetValue( FUNIT_TWIP ) );
const long nMB = m_pBottomMarginEdit->Denormalize( m_pBottomMarginEdit->GetValue( FUNIT_TWIP ) );
- const long nPH = LogicToLogic( rPageSize.Height(), (MapUnit)m_eUnit, MAP_TWIP );
- const long nPW = LogicToLogic( rPageSize.Width(), (MapUnit)m_eUnit, MAP_TWIP );
+ const long nPH = LogicToLogic( rPageSize.Height(), (MapUnit)m_eUnit, MapUnit::MapTwip );
+ const long nPW = LogicToLogic( rPageSize.Width(), (MapUnit)m_eUnit, MapUnit::MapTwip );
// Left
long nMax = nPW - nMR - MINBODY;
diff --git a/sw/source/uibase/table/chartins.cxx b/sw/source/uibase/table/chartins.cxx
index a96c78ea4e69..eec72eb2ecf1 100644
--- a/sw/source/uibase/table/chartins.cxx
+++ b/sw/source/uibase/table/chartins.cxx
@@ -73,7 +73,7 @@ Point SwGetChartDialogPos( const vcl::Window *pParentWin, const Size& rDialogSiz
pParentWin->OutputToAbsoluteScreenPixel( aObjPixel.BottomRight() ) );
Rectangle aDesktop = pParentWin->GetDesktopRectPixel();
- Size aSpace = pParentWin->LogicToPixel( Size( 8, 12 ), MAP_APPFONT );
+ Size aSpace = pParentWin->LogicToPixel( Size( 8, 12 ), MapUnit::MapAppFont );
bool bLayoutRTL = ::GetActiveView()->GetWrtShell().IsTableRightToLeft();
bool bCenterHor = false;
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 167049dc18d1..903ef5cda361 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -196,7 +196,7 @@ SwPagePreviewWin::SwPagePreviewWin( vcl::Window *pParent, SwPagePreview& rPView
SetHelpId(HID_PAGEPREVIEW);
SetFillColor( GetBackground().GetColor() );
SetLineColor( GetBackground().GetColor());
- SetMapMode( MapMode(MAP_TWIP) );
+ SetMapMode( MapMode(MapUnit::MapTwip) );
const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(false);
mnRow = pUsrPref->GetPagePrevRow(); // 1 row
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index b900589433f2..554645dbfb52 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -688,10 +688,10 @@ sal_Int32 SwSrcView::PrintSource(
pOutDev->Push();
TextEngine* pTextEngine = aEditWin->GetTextEngine();
- pOutDev->SetMapMode( MAP_100TH_MM );
+ pOutDev->SetMapMode( MapUnit::Map100thMM );
vcl::Font aFont( aEditWin->GetOutWin()->GetFont() );
Size aSize( aFont.GetFontSize() );
- aSize = aEditWin->GetOutWin()->PixelToLogic( aSize, MAP_100TH_MM );
+ aSize = aEditWin->GetOutWin()->PixelToLogic( aSize, MapUnit::Map100thMM );
aFont.SetFontSize( aSize );
aFont.SetColor( COL_BLACK );
pOutDev->SetFont( aFont );
diff --git a/sw/source/uibase/uiview/swcli.cxx b/sw/source/uibase/uiview/swcli.cxx
index 93c6cfeb4394..f5f8f174e544 100644
--- a/sw/source/uibase/uiview/swcli.cxx
+++ b/sw/source/uibase/uiview/swcli.cxx
@@ -138,7 +138,7 @@ void SwOleClient::ViewChanged()
// first convert to TWIPS before scaling, because scaling factors are calculated for
// the TWIPS mapping and so they will produce the best results if applied to TWIPS based
// coordinates
- const MapMode aMyMap ( MAP_TWIP );
+ const MapMode aMyMap ( MapUnit::MapTwip );
const MapMode aObjMap( VCLUnoHelper::UnoEmbed2VCLMapUnit( GetObject()->getMapUnit( GetAspect() ) ) );
aVisSize = OutputDevice::LogicToLogic( aVisSize, aObjMap, aMyMap );
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 477d52610f2a..bc1a23105f11 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1441,7 +1441,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
Size aRootSize( aRootRect.SSize() );
- const MapMode aTmpMap( MAP_TWIP );
+ const MapMode aTmpMap( MapUnit::MapTwip );
const Size& rEditSize = GetEditWin().GetOutputSizePixel();
const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 07887a7f9b91..5325d2fd15e3 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -176,9 +176,9 @@ void SwView::ExecDraw(SfxRequest& rReq)
if( aPrefSize.Width() && aPrefSize.Height() )
{
if( pWin )
- aSize = pWin->PixelToLogic( aPrefSize, MAP_TWIP );
+ aSize = pWin->PixelToLogic( aPrefSize, MapUnit::MapTwip );
else
- aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_TWIP );
+ aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::MapTwip );
}
else
aSize = Size( 2835, 2835 );
diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx
index 8c7ccf7e1693..c416a6631bcb 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -102,7 +102,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes())
aPageSize.Width() += pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth();
- const MapMode aTmpMap( MAP_TWIP );
+ const MapMode aTmpMap( MapUnit::MapTwip );
const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
if( nsUseOnPage::PD_MIRROR == rDesc.GetUseOn() ) // mirrored pages
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index fab131719b7a..0c70ff66c855 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -964,7 +964,7 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize )
Size aSize( rSize );
aSize.Width() -= (aBorder.Left() + aBorder.Right());
aSize.Height() -= (aBorder.Top() + aBorder.Bottom());
- Size aObjSizePixel = GetWindow()->LogicToPixel( aObjSize, MAP_TWIP );
+ Size aObjSizePixel = GetWindow()->LogicToPixel( aObjSize, MapUnit::MapTwip );
SfxViewShell::SetZoomFactor( Fraction( aSize.Width(), aObjSizePixel.Width() ),
Fraction( aSize.Height(), aObjSizePixel.Height() ) );
}
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 901a3011bdfb..ecc6e4f32d08 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2762,7 +2762,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
// HTML source view and prospect adapt to the printer's paper size
aTmpSize = pPrinter->GetPaperSize();
aTmpSize = OutputDevice::LogicToLogic( aTmpSize,
- pPrinter->GetMapMode(), MapMode( MAP_100TH_MM ));
+ pPrinter->GetMapMode(), MapMode( MapUnit::Map100thMM ));
aPageSize = awt::Size( aTmpSize.Width(), aTmpSize.Height() );
#if 0
// #i115048# it seems users didn't like getting double the formatted page size
@@ -2859,7 +2859,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
if ( pPrinter )
{
awt::Size aNewPageSize;
- const Size aPageSize = pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) );
+ const Size aPageSize = pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), MapMode( MapUnit::Map100thMM ) );
aNewPageSize = awt::Size( aPageSize.Width(), aPageSize.Height() );
if ( ( pPagePrintSettings->GetLandscape() &&
aPageSize.Width() < aPageSize.Height() ) ||
diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx
index 965157df48b4..ad3b9eb92bba 100644
--- a/sw/source/uibase/utlui/attrdesc.cxx
+++ b/sw/source/uibase/utlui/attrdesc.cxx
@@ -496,7 +496,7 @@ bool SwFormatCol::GetPresentation
const long nWdth = static_cast<long>(GetLineWidth());
rText = rText + " " + SW_RESSTR( STR_LINE_WIDTH ) + " " +
::GetMetricText( nWdth, eCoreUnit,
- MAP_POINT, pIntl );
+ MapUnit::MapPoint, pIntl );
}
}
else
diff --git a/sw/source/uibase/utlui/shdwcrsr.cxx b/sw/source/uibase/utlui/shdwcrsr.cxx
index 40543dc88abc..0fcfa7f3543f 100644
--- a/sw/source/uibase/utlui/shdwcrsr.cxx
+++ b/sw/source/uibase/utlui/shdwcrsr.cxx
@@ -73,7 +73,7 @@ void SwShadowCursor::DrawCursor( const Point& rPt, long nHeight, sal_uInt16 nMod
pWin->Push();
- pWin->SetMapMode( MAP_PIXEL );
+ pWin->SetMapMode( MapUnit::MapPixel );
pWin->SetRasterOp( RasterOp::Xor );
pWin->SetLineColor( Color( aCol.GetColor() ^ COL_WHITE ) );
diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx
index 040c44861512..a23774cc862f 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -541,7 +541,7 @@ void SwFrameCtrlWindow::Command( const CommandEvent& rCEvt )
Size SwFrameCtrlWindow::GetOptimalSize() const
{
- return LogicToPixel(Size(82, 124), MapMode(MAP_APPFONT));
+ return LogicToPixel(Size(82, 124), MapMode(MapUnit::MapAppFont));
}
void SwFrameCtrlWindow::Resize()
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index dbe9b27335ab..0b9bc15f19e2 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -413,7 +413,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
{
SwRect aArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, nullptr, xObj.GetObject() );
aArea.Pos() += GetAnyCurRect( RECT_FLY_EMBEDDED, nullptr, xObj.GetObject() ).Pos();
- MapMode aMapMode( MAP_TWIP );
+ MapMode aMapMode( MapUnit::MapTwip );
Size aSize = xObj.GetSize( &aMapMode );
aArea.Width( aSize.Width() );
aArea.Height( aSize.Height() );
@@ -504,7 +504,7 @@ bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrame
CalcBoundRect( aBound, aFrameMgr.GetAnchor() );
//The Size should be suggested by the OLE server
- MapMode aMapMode( MAP_TWIP );
+ MapMode aMapMode( MapUnit::MapTwip );
Size aSz = xRef.GetSize( &aMapMode );
//Object size can be limited
@@ -650,7 +650,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
// TODO/LATER: needs complete VisArea?!
- Size aSize( OutputDevice::LogicToLogic( aRect.SVRect(), MAP_TWIP, aUnit ).GetSize() );
+ Size aSize( OutputDevice::LogicToLogic( aRect.SVRect(), MapUnit::MapTwip, aUnit ).GetSize() );
awt::Size aSz;
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
@@ -755,7 +755,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
// nothing can be scaled.
if( _aVisArea.Width() && _aVisArea.Height() )
{
- const MapMode aTmp( MAP_TWIP );
+ const MapMode aTmp( MapUnit::MapTwip );
MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
_aVisArea = OutputDevice::LogicToLogic( _aVisArea, aUnit, aTmp);
Size aObjArea;
diff --git a/toolkit/source/awt/vclxcontainer.cxx b/toolkit/source/awt/vclxcontainer.cxx
index a0c7d305f156..7ec45d791f51 100644
--- a/toolkit/source/awt/vclxcontainer.cxx
+++ b/toolkit/source/awt/vclxcontainer.cxx
@@ -244,7 +244,7 @@ throw(css::uno::RuntimeException, std::exception)
Value >>= nVal;
Size aSize( nVal, nVal );
vcl::Window* pWindow = GetWindow();
- MapMode aMode( MAP_APPFONT );
+ MapMode aMode( MapUnit::MapAppFont );
toolkit::ScrollableInterface* pScrollable = dynamic_cast< toolkit::ScrollableInterface* >( pWindow );
if ( pWindow && pScrollable )
{
diff --git a/toolkit/source/awt/vclxdevice.cxx b/toolkit/source/awt/vclxdevice.cxx
index 63ccd601e244..9e4ec71462be 100644
--- a/toolkit/source/awt/vclxdevice.cxx
+++ b/toolkit/source/awt/vclxdevice.cxx
@@ -149,7 +149,7 @@ css::awt::DeviceInfo VCLXDevice::getInfo() throw(css::uno::RuntimeException, std
aInfo.Width = aDevSz.Width();
aInfo.Height = aDevSz.Height();
- Size aTmpSz = mpOutputDevice->LogicToPixel( Size( 1000, 1000 ), MapMode( MAP_CM ) );
+ Size aTmpSz = mpOutputDevice->LogicToPixel( Size( 1000, 1000 ), MapMode( MapUnit::MapCM ) );
aInfo.PixelPerMeterX = aTmpSz.Width()/10;
aInfo.PixelPerMeterY = aTmpSz.Height()/10;
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index 540d63677b7c..2d72a2fffcbc 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -1382,7 +1382,7 @@ void ControlContainerBase::ImplSetPosSize( Reference< XControl >& rxCtrl )
xP->getPropertyValue("PositionY") >>= nY;
xP->getPropertyValue("Width") >>= nWidth;
xP->getPropertyValue("Height") >>= nHeight;
- MapMode aMode( MAP_APPFONT );
+ MapMode aMode( MapUnit::MapAppFont );
OutputDevice*pOutDev = Application::GetDefaultDevice();
if ( pOutDev )
{
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index 490b644faa81..896037750be1 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -495,7 +495,7 @@ void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar ) thro
}
static ::Size ImplMapPixelToAppFont( OutputDevice* pOutDev, const ::Size& aSize )
{
- ::Size aTmp = pOutDev->PixelToLogic( aSize, MAP_APPFONT );
+ ::Size aTmp = pOutDev->PixelToLogic( aSize, MapUnit::MapAppFont );
return aTmp;
}
// css::awt::XWindowListener
@@ -506,7 +506,7 @@ throw (css::uno::RuntimeException, std::exception)
DBG_ASSERT( pOutDev, "Missing Default Device!" );
if ( pOutDev && !mbSizeModified )
{
- // Currentley we are simply using MAP_APPFONT
+ // Currentley we are simply using MapUnit::MapAppFont
::Size aAppFontSize( e.Width, e.Height );
Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
@@ -547,7 +547,7 @@ throw (css::uno::RuntimeException, std::exception)
DBG_ASSERT( pOutDev, "Missing Default Device!" );
if ( pOutDev && !mbPosModified )
{
- // Currentley we are simply using MAP_APPFONT
+ // Currentley we are simply using MapUnit::MapAppFont
::Size aTmp( e.X, e.Y );
aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx
index c2353f0a7cd7..488d72a325ed 100644
--- a/toolkit/source/controls/tabpagemodel.cxx
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -234,7 +234,7 @@ void UnoControlTabPage::createPeer( const Reference< XToolkit > & rxToolkit, con
static ::Size ImplMapPixelToAppFont( OutputDevice* pOutDev, const ::Size& aSize )
{
- ::Size aTmp = pOutDev->PixelToLogic( aSize, MAP_APPFONT );
+ ::Size aTmp = pOutDev->PixelToLogic( aSize, MapUnit::MapAppFont );
return aTmp;
}
// css::awt::XWindowListener
@@ -245,7 +245,7 @@ throw (css::uno::RuntimeException, std::exception)
DBG_ASSERT( pOutDev, "Missing Default Device!" );
if ( pOutDev && !mbSizeModified )
{
- // Currentley we are simply using MAP_APPFONT
+ // Currentley we are simply using MapUnit::MapAppFont
::Size aAppFontSize( e.Width, e.Height );
Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
@@ -283,7 +283,7 @@ throw (css::uno::RuntimeException, std::exception)
DBG_ASSERT( pOutDev, "Missing Default Device!" );
if ( pOutDev && !mbPosModified )
{
- // Currentley we are simply using MAP_APPFONT
+ // Currentley we are simply using MapUnit::MapAppFont
::Size aTmp( e.X, e.Y );
aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index dda017297fb2..e6c8dfcbcdac 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -448,58 +448,58 @@ MapUnit VCLUnoHelper::UnoEmbed2VCLMapUnit( sal_Int32 nUnoEmbedMapUnit )
switch( nUnoEmbedMapUnit )
{
case css::embed::EmbedMapUnits::ONE_100TH_MM:
- return MAP_100TH_MM;
+ return MapUnit::Map100thMM;
case css::embed::EmbedMapUnits::ONE_10TH_MM:
- return MAP_10TH_MM;
+ return MapUnit::Map10thMM;
case css::embed::EmbedMapUnits::ONE_MM:
- return MAP_MM;
+ return MapUnit::MapMM;
case css::embed::EmbedMapUnits::ONE_CM:
- return MAP_CM;
+ return MapUnit::MapCM;
case css::embed::EmbedMapUnits::ONE_1000TH_INCH:
- return MAP_1000TH_INCH;
+ return MapUnit::Map1000thInch;
case css::embed::EmbedMapUnits::ONE_100TH_INCH:
- return MAP_100TH_INCH;
+ return MapUnit::Map100thInch;
case css::embed::EmbedMapUnits::ONE_10TH_INCH:
- return MAP_10TH_INCH;
+ return MapUnit::Map10thInch;
case css::embed::EmbedMapUnits::ONE_INCH:
- return MAP_INCH;
+ return MapUnit::MapInch;
case css::embed::EmbedMapUnits::POINT:
- return MAP_POINT;
+ return MapUnit::MapPoint;
case css::embed::EmbedMapUnits::TWIP:
- return MAP_TWIP;
+ return MapUnit::MapTwip;
case css::embed::EmbedMapUnits::PIXEL:
- return MAP_PIXEL;
+ return MapUnit::MapPixel;
}
OSL_FAIL( "Unexpected UNO map mode is provided!\n" );
- return MAP_LASTENUMDUMMY;
+ return MapUnit::LASTENUMDUMMY;
}
sal_Int32 VCLUnoHelper::VCL2UnoEmbedMapUnit( MapUnit nVCLMapUnit )
{
switch( nVCLMapUnit )
{
- case MAP_100TH_MM:
+ case MapUnit::Map100thMM:
return css::embed::EmbedMapUnits::ONE_100TH_MM;
- case MAP_10TH_MM:
+ case MapUnit::Map10thMM:
return css::embed::EmbedMapUnits::ONE_10TH_MM;
- case MAP_MM:
+ case MapUnit::MapMM:
return css::embed::EmbedMapUnits::ONE_MM;
- case MAP_CM:
+ case MapUnit::MapCM:
return css::embed::EmbedMapUnits::ONE_CM;
- case MAP_1000TH_INCH:
+ case MapUnit::Map1000thInch:
return css::embed::EmbedMapUnits::ONE_1000TH_INCH;
- case MAP_100TH_INCH:
+ case MapUnit::Map100thInch:
return css::embed::EmbedMapUnits::ONE_100TH_INCH;
- case MAP_10TH_INCH:
+ case MapUnit::Map10thInch:
return css::embed::EmbedMapUnits::ONE_10TH_INCH;
- case MAP_INCH:
+ case MapUnit::MapInch:
return css::embed::EmbedMapUnits::ONE_INCH;
- case MAP_POINT:
+ case MapUnit::MapPoint:
return css::embed::EmbedMapUnits::POINT;
- case MAP_TWIP:
+ case MapUnit::MapTwip:
return css::embed::EmbedMapUnits::TWIP;
- case MAP_PIXEL:
+ case MapUnit::MapPixel:
return css::embed::EmbedMapUnits::PIXEL;
default: ; // avoid compiler warning
}
@@ -589,55 +589,55 @@ MapUnit /* MapModeUnit */ VCLUnoHelper::ConvertToMapModeUnit(sal_Int16 /* com.su
switch(_nMeasureUnit)
{
case css::util::MeasureUnit::MM_100TH:
- eMode = MAP_100TH_MM;
+ eMode = MapUnit::Map100thMM;
break;
case css::util::MeasureUnit::MM_10TH:
- eMode = MAP_10TH_MM;
+ eMode = MapUnit::Map10thMM;
break;
case css::util::MeasureUnit::MM:
- eMode = MAP_MM;
+ eMode = MapUnit::MapMM;
break;
case css::util::MeasureUnit::CM:
- eMode = MAP_CM;
+ eMode = MapUnit::MapCM;
break;
case css::util::MeasureUnit::INCH_1000TH:
- eMode = MAP_1000TH_INCH;
+ eMode = MapUnit::Map1000thInch;
break;
case css::util::MeasureUnit::INCH_100TH:
- eMode = MAP_100TH_INCH;
+ eMode = MapUnit::Map100thInch;
break;
case css::util::MeasureUnit::INCH_10TH:
- eMode = MAP_10TH_INCH;
+ eMode = MapUnit::Map10thInch;
break;
case css::util::MeasureUnit::INCH:
- eMode = MAP_INCH;
+ eMode = MapUnit::MapInch;
break;
case css::util::MeasureUnit::POINT:
- eMode = MAP_POINT;
+ eMode = MapUnit::MapPoint;
break;
case css::util::MeasureUnit::TWIP:
- eMode = MAP_TWIP;
+ eMode = MapUnit::MapTwip;
break;
case css::util::MeasureUnit::PIXEL:
- eMode = MAP_PIXEL;
+ eMode = MapUnit::MapPixel;
break;
case css::util::MeasureUnit::APPFONT:
- eMode = MAP_APPFONT;
+ eMode = MapUnit::MapAppFont;
break;
case css::util::MeasureUnit::SYSFONT:
- eMode = MAP_SYSFONT;
+ eMode = MapUnit::MapSysFont;
break;
default:
diff --git a/uui/source/fltdlg.cxx b/uui/source/fltdlg.cxx
index c45605de66e5..8bec836f8b66 100644
--- a/uui/source/fltdlg.cxx
+++ b/uui/source/fltdlg.cxx
@@ -51,7 +51,7 @@ FilterDialog::FilterDialog( vcl::Window* pParentWindow )
{
get(m_pFtURL, "url");
get(m_pLbFilters, "filters");
- Size aSize(pParentWindow->LogicToPixel(Size(182, 175), MAP_APPFONT));
+ Size aSize(pParentWindow->LogicToPixel(Size(182, 175), MapUnit::MapAppFont));
m_pLbFilters->set_height_request(aSize.Height());
m_pLbFilters->set_width_request(aSize.Width());
m_pFtURL->SetSizePixel(Size(aSize.Width(), m_pFtURL->GetOptimalSize().Height()));
diff --git a/vcl/README.GDIMetaFile b/vcl/README.GDIMetaFile
index 5d0358db29cc..80749c88b372 100644
--- a/vcl/README.GDIMetaFile
+++ b/vcl/README.GDIMetaFile
@@ -87,7 +87,7 @@ DISPLACEMENT FUNCTIONS
- Move( long nX, long nX)
- Move( long nX, long nX, long nDPIX, long nDPIY ) - Move method getting specifics how to
- handle MapMode( MAP_PIXEL )
+ handle MapMode( MapUnit::MapPixel )
TRANSFORMATION FUNCTIONS
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index fa2f88b13c61..4eba68e093bd 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -449,7 +449,7 @@ bool AquaSalInfoPrinter::StartJob( const OUString* i_pFileName,
// also SetPaperSizeUser has the advantage that we can share a
// platform independent paper matching algorithm
VclPtr<Printer> pPrinter( i_rController.getPrinter() );
- pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ pPrinter->SetMapMode( MapMode( MapUnit::Map100thMM ) );
pPrinter->SetPaperSizeUser( aCurSize, true );
// create view
diff --git a/vcl/qa/cppunit/mapmode.cxx b/vcl/qa/cppunit/mapmode.cxx
index 87c20a3bd666..d4c7e820d4a6 100644
--- a/vcl/qa/cppunit/mapmode.cxx
+++ b/vcl/qa/cppunit/mapmode.cxx
@@ -31,31 +31,31 @@ public:
void VclMapModeTest::testMultiplier()
{
MapMode aMapMode;
- CPPUNIT_ASSERT_MESSAGE( "Default map mode is MAP_PIXEL, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
- aMapMode.SetMapUnit( MAP_SYSFONT );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_SYSFONT, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
- aMapMode.SetMapUnit( MAP_APPFONT );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_APPFONT, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
- aMapMode.SetMapUnit( MAP_100TH_MM );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_100TH_MM, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
- aMapMode.SetMapUnit( MAP_10TH_MM );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_10TH_MM, multiplier should be 10", aMapMode.GetUnitMultiplier() == 10 );
- aMapMode.SetMapUnit( MAP_MM );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_MM, multiplier should be 100", aMapMode.GetUnitMultiplier() == 100 );
- aMapMode.SetMapUnit( MAP_CM );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_CM, multiplier should be 1000", aMapMode.GetUnitMultiplier() == 1000 );
- aMapMode.SetMapUnit( MAP_1000TH_INCH );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_1000TH_INCH, multiplier should be 2.54", aMapMode.GetUnitMultiplier() == 2.54 );
- aMapMode.SetMapUnit( MAP_100TH_INCH );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_100TH_INCH, multiplier should be 2.54", aMapMode.GetUnitMultiplier() == 25.4 );
- aMapMode.SetMapUnit( MAP_10TH_INCH );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_10TH_INCH, multiplier should be 254", aMapMode.GetUnitMultiplier() == 254 );
- aMapMode.SetMapUnit( MAP_INCH );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_INCH, multiplier should be 2540", aMapMode.GetUnitMultiplier() == 2540 );
- aMapMode.SetMapUnit( MAP_TWIP );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_TWIP, multiplier should be 1.76388889", aMapMode.GetUnitMultiplier() == 1.76388889 );
- aMapMode.SetMapUnit( MAP_POINT );
- CPPUNIT_ASSERT_MESSAGE( "Map mode is MAP_POINT, multiplier should be 35.27777778", aMapMode.GetUnitMultiplier() == 35.27777778 );
+ CPPUNIT_ASSERT_MESSAGE( "Default map mode is MapUnit::MapPixel, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
+ aMapMode.SetMapUnit( MapUnit::MapSysFont );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapSysFont, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
+ aMapMode.SetMapUnit( MapUnit::MapAppFont );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapAppFont, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
+ aMapMode.SetMapUnit( MapUnit::Map100thMM );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::Map100thMM, multiplier should be 1", aMapMode.GetUnitMultiplier() == 1 );
+ aMapMode.SetMapUnit( MapUnit::Map10thMM );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::Map10thMM, multiplier should be 10", aMapMode.GetUnitMultiplier() == 10 );
+ aMapMode.SetMapUnit( MapUnit::MapMM );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapMM, multiplier should be 100", aMapMode.GetUnitMultiplier() == 100 );
+ aMapMode.SetMapUnit( MapUnit::MapCM );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapCM, multiplier should be 1000", aMapMode.GetUnitMultiplier() == 1000 );
+ aMapMode.SetMapUnit( MapUnit::Map1000thInch );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::Map1000thInch, multiplier should be 2.54", aMapMode.GetUnitMultiplier() == 2.54 );
+ aMapMode.SetMapUnit( MapUnit::Map100thInch );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::Map100thInch, multiplier should be 2.54", aMapMode.GetUnitMultiplier() == 25.4 );
+ aMapMode.SetMapUnit( MapUnit::Map10thInch );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::Map10thInch, multiplier should be 254", aMapMode.GetUnitMultiplier() == 254 );
+ aMapMode.SetMapUnit( MapUnit::MapInch );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapInch, multiplier should be 2540", aMapMode.GetUnitMultiplier() == 2540 );
+ aMapMode.SetMapUnit( MapUnit::MapTwip );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapTwip, multiplier should be 1.76388889", aMapMode.GetUnitMultiplier() == 1.76388889 );
+ aMapMode.SetMapUnit( MapUnit::MapPoint );
+ CPPUNIT_ASSERT_MESSAGE( "Map mode is MapUnit::MapPoint, multiplier should be 35.27777778", aMapMode.GetUnitMultiplier() == 35.27777778 );
}
CPPUNIT_TEST_SUITE_REGISTRATION(VclMapModeTest);
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 6a97396677cc..1cab69d178dc 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -2056,7 +2056,7 @@ const Size& StyleSettings::GetListBoxPreviewDefaultPixelSize() const
if(0 == mxData->maListBoxPreviewDefaultPixelSize.Width() || 0 == mxData->maListBoxPreviewDefaultPixelSize.Height())
{
const_cast< StyleSettings* >(this)->mxData->maListBoxPreviewDefaultPixelSize =
- Application::GetDefaultDevice()->LogicToPixel(mxData->maListBoxPreviewDefaultLogicSize, MAP_APPFONT);
+ Application::GetDefaultDevice()->LogicToPixel(mxData->maListBoxPreviewDefaultLogicSize, MapUnit::MapAppFont);
}
return mxData->maListBoxPreviewDefaultPixelSize;
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 98dfacdb2d48..becfa0f9b0e9 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -723,7 +723,7 @@ void Application::SetSettings( const AllSettings& rSettings )
while ( pFrame )
{
// restore AppFont cache data
- pFrame->mpWindowImpl->mpFrameData->meMapUnit = MAP_PIXEL;
+ pFrame->mpWindowImpl->mpFrameData->meMapUnit = MapUnit::MapPixel;
// call UpdateSettings from ClientWindow in order to prevent updating data twice
vcl::Window* pClientWin = pFrame;
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 658a8b0d19c1..4e5904eb56c0 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1081,7 +1081,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
// prepare single line hint (needed on mac to decide between normal push button and
// rectangular bevel button look)
Size aFontSize(Application::GetSettings().GetStyleSettings().GetPushButtonFont().GetFontSize());
- aFontSize = rRenderContext.LogicToPixel(aFontSize, MapMode(MAP_POINT));
+ aFontSize = rRenderContext.LogicToPixel(aFontSize, MapMode(MapUnit::MapPoint));
Size aInRectSize(rRenderContext.LogicToPixel(Size(aInRect.GetWidth(), aInRect.GetHeight())));
aControlValue.mbSingleLine = (aInRectSize.Height() < 2 * aFontSize.Height());
@@ -2471,7 +2471,7 @@ void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize
{
if ( !maImage )
{
- MapMode aResMapMode( MAP_100TH_MM );
+ MapMode aResMapMode( MapUnit::Map100thMM );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
Size aImageSize = pDev->LogicToPixel( Size( 300, 300 ), aResMapMode );
@@ -2866,7 +2866,7 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, DrawButtonFlags
void RadioButton::ImplSetMinimumNWFSize()
{
Push( PushFlags::MAPMODE );
- SetMapMode( MAP_PIXEL );
+ SetMapMode( MapUnit::MapPixel );
ImplControlValue aControlValue;
Size aCurSize( GetSizePixel() );
@@ -3358,7 +3358,7 @@ void CheckBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
DrawFlags nFlags )
{
- MapMode aResMapMode( MAP_100TH_MM );
+ MapMode aResMapMode( MapUnit::Map100thMM );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
Size aImageSize = pDev->LogicToPixel( Size( 300, 300 ), aResMapMode );
@@ -3729,7 +3729,7 @@ Image CheckBox::GetCheckImage( const AllSettings& rSettings, DrawButtonFlags nFl
void CheckBox::ImplSetMinimumNWFSize()
{
Push( PushFlags::MAPMODE );
- SetMapMode( MAP_PIXEL );
+ SetMapMode( MapUnit::MapPixel );
ImplControlValue aControlValue;
Size aCurSize( GetSizePixel() );
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 9ed2710ff3f6..c71ae85c40f0 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1141,30 +1141,30 @@ static FieldUnit ImplMap2FieldUnit( MapUnit meUnit, long& nDecDigits )
{
switch( meUnit )
{
- case MAP_100TH_MM :
+ case MapUnit::Map100thMM :
nDecDigits -= 2;
return FUNIT_MM;
- case MAP_10TH_MM :
+ case MapUnit::Map10thMM :
nDecDigits -= 1;
return FUNIT_MM;
- case MAP_MM :
+ case MapUnit::MapMM :
return FUNIT_MM;
- case MAP_CM :
+ case MapUnit::MapCM :
return FUNIT_CM;
- case MAP_1000TH_INCH :
+ case MapUnit::Map1000thInch :
nDecDigits -= 3;
return FUNIT_INCH;
- case MAP_100TH_INCH :
+ case MapUnit::Map100thInch :
nDecDigits -= 2;
return FUNIT_INCH;
- case MAP_10TH_INCH :
+ case MapUnit::Map10thInch :
nDecDigits -= 1;
return FUNIT_INCH;
- case MAP_INCH :
+ case MapUnit::MapInch :
return FUNIT_INCH;
- case MAP_POINT :
+ case MapUnit::MapPoint :
return FUNIT_POINT;
- case MAP_TWIP :
+ case MapUnit::MapTwip :
return FUNIT_TWIP;
default:
OSL_FAIL( "default eInUnit" );
@@ -1264,10 +1264,10 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
if ( eOutUnit == FUNIT_PERCENT ||
eOutUnit == FUNIT_CUSTOM ||
eOutUnit == FUNIT_NONE ||
- eInUnit == MAP_PIXEL ||
- eInUnit == MAP_SYSFONT ||
- eInUnit == MAP_APPFONT ||
- eInUnit == MAP_RELATIVE )
+ eInUnit == MapUnit::MapPixel ||
+ eInUnit == MapUnit::MapSysFont ||
+ eInUnit == MapUnit::MapAppFont ||
+ eInUnit == MapUnit::MapRelative )
{
OSL_FAIL( "invalid parameters" );
return nValue;
@@ -1319,10 +1319,10 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
eInUnit == FUNIT_SECOND ||
eInUnit == FUNIT_MILLISECOND ||
eInUnit == FUNIT_PIXEL ||
- eOutUnit == MAP_PIXEL ||
- eOutUnit == MAP_SYSFONT ||
- eOutUnit == MAP_APPFONT ||
- eOutUnit == MAP_RELATIVE )
+ eOutUnit == MapUnit::MapPixel ||
+ eOutUnit == MapUnit::MapSysFont ||
+ eOutUnit == MapUnit::MapAppFont ||
+ eOutUnit == MapUnit::MapRelative )
{
OSL_FAIL( "invalid parameters" );
return nValue;
diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx
index 03b9e481bbc5..86cb9c09619e 100644
--- a/vcl/source/control/morebtn.cxx
+++ b/vcl/source/control/morebtn.cxx
@@ -32,7 +32,7 @@ struct ImplMoreButtonData
void MoreButton::ImplInit( vcl::Window* pParent, WinBits nStyle )
{
mpMBData = new ImplMoreButtonData;
- meUnit = MAP_PIXEL;
+ meUnit = MapUnit::MapPixel;
mbState = false;
mpMBData->mpItemList = nullptr;
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 7d2a23923599..c16f4f52de57 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -861,7 +861,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
if (rMEvt.IsLeft() || rMEvt.IsMiddle() || rMEvt.IsRight())
{
Point aPosPixel;
- if (!IsMapModeEnabled() && GetMapMode().GetMapUnit() == MAP_TWIP)
+ if (!IsMapModeEnabled() && GetMapMode().GetMapUnit() == MapUnit::MapTwip)
{
// rMEvt coordinates are in twips.
Push(PushFlags::MAPMODE);
@@ -872,7 +872,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
aPosPixel = LogicToPixel(rMEvt.GetPosPixel());
Pop();
}
- const Point& rMousePos = (GetMapMode().GetMapUnit() != MAP_TWIP ? rMEvt.GetPosPixel() : aPosPixel);
+ const Point& rMousePos = (GetMapMode().GetMapUnit() != MapUnit::MapTwip ? rMEvt.GetPosPixel() : aPosPixel);
StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE;
bool bHorizontal = ( GetStyle() & WB_HORZ ) != 0;
bool bIsInside = false;
@@ -1040,7 +1040,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
else
{
Point aPosPixel;
- if (!IsMapModeEnabled() && GetMapMode().GetMapUnit() == MAP_TWIP)
+ if (!IsMapModeEnabled() && GetMapMode().GetMapUnit() == MapUnit::MapTwip)
{
// rTEvt coordinates are in twips.
Push(PushFlags::MAPMODE);
@@ -1051,7 +1051,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt )
aPosPixel = LogicToPixel(rTEvt.GetMouseEvent().GetPosPixel());
Pop();
}
- const Point rMousePos = (GetMapMode().GetMapUnit() != MAP_TWIP ? rTEvt.GetMouseEvent().GetPosPixel() : aPosPixel);
+ const Point rMousePos = (GetMapMode().GetMapUnit() != MapUnit::MapTwip ? rTEvt.GetMouseEvent().GetPosPixel() : aPosPixel);
// Dragging is treated in a special way
if ( meScrollType == ScrollType::Drag )
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index dc4998262784..84562282cfc5 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -1253,7 +1253,7 @@ void TabControl::setAllocation(const Size &rAllocation)
long nPrefWidth = mpTabCtrlData->mpListBox->get_preferred_size().Width();
if( nPrefWidth > aTabCtrlSize.Width() )
nPrefWidth = aTabCtrlSize.Width();
- Size aNewSize( nPrefWidth, LogicToPixel( Size( 12, 12 ), MapMode( MAP_APPFONT ) ).Height() );
+ Size aNewSize( nPrefWidth, LogicToPixel( Size( 12, 12 ), MapMode( MapUnit::MapAppFont ) ).Height() );
Point aNewPos( (aTabCtrlSize.Width() - nPrefWidth) / 2, 0 );
mpTabCtrlData->mpListBox->SetPosSizePixel( aNewPos, aNewSize );
}
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index dba350de110a..379b8c5a8ff2 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -846,10 +846,10 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
Size aOriginalSize;
Size aPrefSize( rGraphic.GetPrefSize() );
MapMode aPrefMapMode( rGraphic.GetPrefMapMode() );
- if ( aPrefMapMode == MAP_PIXEL )
- aOriginalSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM );
+ if ( aPrefMapMode == MapUnit::MapPixel )
+ aOriginalSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM );
else
- aOriginalSize = OutputDevice::LogicToLogic( aPrefSize, aPrefMapMode, MAP_100TH_MM );
+ aOriginalSize = OutputDevice::LogicToLogic( aPrefSize, aPrefMapMode, MapUnit::Map100thMM );
if ( !nLogicalWidth )
nLogicalWidth = aOriginalSize.Width();
if ( !nLogicalHeight )
@@ -861,7 +861,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
if( nMode == 1 )
{
Bitmap aBitmap( rGraphic.GetBitmap() );
- MapMode aMap( MAP_100TH_INCH );
+ MapMode aMap( MapUnit::Map100thInch );
sal_Int32 nDPI = rConfigItem.ReadInt32( "Resolution", 75 );
Fraction aFrac( 1, std::min( std::max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) );
@@ -879,7 +879,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
else if( nMode == 2 )
{
aGraphic = rGraphic;
- aGraphic.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
+ aGraphic.SetPrefMapMode( MapMode( MapUnit::Map100thMM ) );
aGraphic.SetPrefSize( Size( nLogicalWidth, nLogicalHeight ) );
}
else
@@ -898,7 +898,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
if( ( nMode == 1 ) || ( nMode == 2 ) )
{
GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() );
- Size aNewSize( OutputDevice::LogicToLogic( Size( nLogicalWidth, nLogicalHeight ), MAP_100TH_MM, aMtf.GetPrefMapMode() ) );
+ Size aNewSize( OutputDevice::LogicToLogic( Size( nLogicalWidth, nLogicalHeight ), MapUnit::Map100thMM, aMtf.GetPrefMapMode() ) );
if( aNewSize.Width() && aNewSize.Height() )
{
@@ -1916,11 +1916,11 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString
aSizePixel.Height()=(sal_uLong)(((double)aSizePixel.Height())*fFak);
}
- aVirDev->SetMapMode(MapMode(MAP_PIXEL));
+ aVirDev->SetMapMode(MapMode(MapUnit::MapPixel));
aVirDev->SetOutputSizePixel(aSizePixel);
Graphic aGraphic2=aGraphic;
aGraphic2.Draw(aVirDev.get(),Point(0,0),aSizePixel); // this changes the MapMode
- aVirDev->SetMapMode(MapMode(MAP_PIXEL));
+ aVirDev->SetMapMode(MapMode(MapUnit::MapPixel));
aGraphic=Graphic(aVirDev->GetBitmap(Point(0,0),aSizePixel));
}
}
diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx
index 4e57a0172980..66c83e9cfc92 100644
--- a/vcl/source/filter/graphicfilter2.cxx
+++ b/vcl/source/filter/graphicfilter2.cxx
@@ -335,10 +335,10 @@ bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, bool bExtendedInfo )
if ( nUnits && nHorizontalResolution && nVerticalResolution )
{
MapMode aMap;
- aMap.SetMapUnit( nUnits == 1 ? MAP_INCH : MAP_CM );
+ aMap.SetMapUnit( nUnits == 1 ? MapUnit::MapInch : MapUnit::MapCM );
aMap.SetScaleX( Fraction( 1, nHorizontalResolution ) );
aMap.SetScaleY( Fraction( 1, nVerticalResolution ) );
- aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap, MapMode( MAP_100TH_MM ) );
+ aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap, MapMode( MapUnit::Map100thMM ) );
}
}
}
@@ -490,10 +490,10 @@ bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, bool bExtendedInfo )
nDPIy = nTemp16;
// set logical size
- MapMode aMap( MAP_INCH, Point(),
+ MapMode aMap( MapUnit::MapInch, Point(),
Fraction( 1, nDPIx ), Fraction( 1, nDPIy ) );
aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap,
- MapMode( MAP_100TH_MM ) );
+ MapMode( MapUnit::Map100thMM ) );
// number of color planes
cByte = 5; // Illegal value in case of EOF.
@@ -1035,7 +1035,7 @@ bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, bool bExtendedInfo )
rStm.ReadUInt16( nTemp16 );
aLogSize = OutputDevice::LogicToLogic( aLogSize,
MapMode( (MapUnit) nTemp16 ),
- MapMode( MAP_100TH_MM ) );
+ MapMode( MapUnit::Map100thMM ) );
}
}
}
@@ -1063,7 +1063,7 @@ bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, bool bExtendedInfo )
rStm.SeekRel( 0x06 );
ReadMapMode( rStm, aMapMode );
ReadPair( rStm, aLogSize );
- aLogSize = OutputDevice::LogicToLogic( aLogSize, aMapMode, MapMode( MAP_100TH_MM ) );
+ aLogSize = OutputDevice::LogicToLogic( aLogSize, aMapMode, MapMode( MapUnit::Map100thMM ) );
}
}
}
diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx
index 7b9ac2ab799c..bc739efa9ba1 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -874,7 +874,7 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic )
if( nLogWidth100 && nLogHeight100 )
{
rGraphic.SetPrefSize( Size( nLogWidth100, nLogHeight100 ) );
- rGraphic.SetPrefMapMode( MAP_100TH_MM );
+ rGraphic.SetPrefMapMode( MapUnit::Map100thMM );
}
}
else
diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx
index b1582d8da2b6..cde54c49dbde 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -227,11 +227,11 @@ bool JPEGReader::CreateBitmap(JPEGCreateBitmapParam& rParam)
Point aEmptyPoint;
Fraction aFractX( 1, rParam.X_density );
Fraction aFractY( 1, rParam.Y_density );
- MapMode aMapMode( nUnit == 1 ? MAP_INCH : MAP_CM, aEmptyPoint, aFractX, aFractY );
- Size aPrefSize = OutputDevice::LogicToLogic( aSize, aMapMode, MAP_100TH_MM );
+ MapMode aMapMode( nUnit == 1 ? MapUnit::MapInch : MapUnit::MapCM, aEmptyPoint, aFractX, aFractY );
+ Size aPrefSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapUnit::Map100thMM );
maBitmap.SetPrefSize(aPrefSize);
- maBitmap.SetPrefMapMode(MapMode(MAP_100TH_MM));
+ maBitmap.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
}
}
diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx
index a2a51200a543..468c18cf52dc 100644
--- a/vcl/source/filter/sgfbram.cxx
+++ b/vcl/source/filter/sgfbram.cxx
@@ -433,7 +433,7 @@ bool SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt
}
rMtf.Stop();
rMtf.WindStart();
- MapMode aMap( MAP_10TH_MM, Point(),
+ MapMode aMap( MapUnit::Map10thMM, Point(),
Fraction( 1, 4 ), Fraction( 1, 4 ) );
rMtf.SetPrefMapMode( aMap );
rMtf.SetPrefSize( Size( (short)rHead.Xsize, (short)rHead.Ysize ) );
diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx
index c4f474f043b5..cc0207513233 100644
--- a/vcl/source/filter/sgvmain.cxx
+++ b/vcl/source/filter/sgvmain.cxx
@@ -899,7 +899,7 @@ bool SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
rMtf.Stop();
rMtf.WindStart();
- MapMode aMap(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4));
+ MapMode aMap(MapUnit::Map10thMM,Point(),Fraction(1,4),Fraction(1,4));
rMtf.SetPrefMapMode(aMap);
rMtf.SetPrefSize(Size((sal_Int16)aPage.Paper.Size.x,(sal_Int16)aPage.Paper.Size.y));
bRet=true;
diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx
index c062c50474ff..404dd4206c9b 100644
--- a/vcl/source/filter/sgvtext.cxx
+++ b/vcl/source/filter/sgvtext.cxx
@@ -681,7 +681,7 @@ void FormatLine(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType&
sal_uInt16 i,j,k,h;
sal_uInt16 re,li;
- vOut->SetMapMode(MapMode(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4)));
+ vOut->SetMapMode(MapMode(MapUnit::Map10thMM,Point(),Fraction(1,4),Fraction(1,4)));
nChars=0;
SetTextContext(*vOut.get(),AktAtr,false,0,1,1,1,1);
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index b13f4459af5d..dda3d56f7db8 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -243,7 +243,7 @@ bool EMFWriter::WriteEMF(const GDIMetaFile& rMtf)
maVDev->EnableOutput( false );
maVDev->SetMapMode( rMtf.GetPrefMapMode() );
// don't work with pixel as destination map mode -> higher resolution preferable
- maDestMapMode.SetMapUnit( MAP_100TH_MM );
+ maDestMapMode.SetMapUnit( MapUnit::Map100thMM );
mHandlesUsed = std::vector<bool>(MAXHANDLES, false);
mnHandleCount = mnRecordCount = mnRecordPos = mnRecordPlusPos = 0;
mbRecordOpen = mbRecordPlusOpen = false;
@@ -252,7 +252,7 @@ bool EMFWriter::WriteEMF(const GDIMetaFile& rMtf)
mnHorTextAlign = 0;
const Size aMtfSizePix( maVDev->LogicToPixel( rMtf.GetPrefSize(), rMtf.GetPrefMapMode() ) );
- const Size aMtfSizeLog( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_100TH_MM ) );
+ const Size aMtfSizeLog( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::Map100thMM ) );
// seek over header
// use [MS-EMF 2.2.11] HeaderExtension2 Object, otherwise resulting EMF cannot be converted with GetWinMetaFileBits()
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index b6d7d76ba682..fba68a2b467e 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -871,7 +871,7 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :
WinMtfOutput::~WinMtfOutput()
{
mpGDIMetaFile->AddAction( new MetaPopAction() );
- mpGDIMetaFile->SetPrefMapMode( MAP_100TH_MM );
+ mpGDIMetaFile->SetPrefMapMode( MapUnit::Map100thMM );
if ( mrclFrame.IsEmpty() )
mpGDIMetaFile->SetPrefSize( Size( mnDevWidth, mnDevHeight ) );
else
@@ -1458,7 +1458,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b
SolarMutexGuard aGuard;
ScopedVclPtrInstance< VirtualDevice > pVDev;
sal_Int32 nTextWidth;
- pVDev->SetMapMode( MapMode( MAP_100TH_MM ) );
+ pVDev->SetMapMode( MapMode( MapUnit::Map100thMM ) );
pVDev->SetFont( maFont );
if( pDXArry )
{
@@ -1506,7 +1506,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b
SolarMutexGuard aGuard;
ScopedVclPtrInstance< VirtualDevice > pVDev;
pDX = new long[ rText.getLength() ];
- pVDev->SetMapMode( MAP_100TH_MM );
+ pVDev->SetMapMode( MapUnit::Map100thMM );
pVDev->SetFont( maLatestFont );
pVDev->GetTextArray( rText, pDX, 0, rText.getLength());
}
@@ -1523,7 +1523,7 @@ void WinMtfOutput::ImplDrawBitmap( const Point& rPos, const Size& rSize, const B
if ( mbComplexClip )
{
VclPtrInstance< VirtualDevice > pVDev;
- MapMode aMapMode( MAP_100TH_MM );
+ MapMode aMapMode( MapUnit::Map100thMM );
aMapMode.SetOrigin( Point( -rPos.X(), -rPos.Y() ) );
const Size aOutputSizePixel( pVDev->LogicToPixel( rSize, aMapMode ) );
const Size aSizePixel( rBitmap.GetSizePixel() );
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index bb56e7c91ed5..f1b907f8f1c4 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -1256,8 +1256,8 @@ bool WMFReader::ReadHeader()
if( ( labs( aWMFSize.Width() ) > 1 ) && ( labs( aWMFSize.Height() ) > 1 ) )
{
const Fraction aFrac( 1, nUnitsPerInch );
- MapMode aWMFMap( MAP_INCH, Point(), aFrac, aFrac );
- Size aSize100( OutputDevice::LogicToLogic( aWMFSize, aWMFMap, MAP_100TH_MM ) );
+ MapMode aWMFMap( MapUnit::MapInch, Point(), aFrac, aFrac );
+ Size aSize100( OutputDevice::LogicToLogic( aWMFSize, aWMFMap, MapUnit::Map100thMM ) );
aDevExt = Size( labs( aSize100.Width() ), labs( aSize100.Height() ) );
}
pOut->SetDevExt( aDevExt );
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index 7973b4368be1..3d8bb911df40 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -1400,7 +1400,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
if (aSrcMapMode!=pA->GetMapMode())
{
- if( pA->GetMapMode().GetMapUnit() == MAP_RELATIVE )
+ if( pA->GetMapMode().GetMapUnit() == MapUnit::MapRelative )
{
MapMode aMM = pA->GetMapMode();
Fraction aScaleX = aMM.GetScaleX();
@@ -1637,7 +1637,7 @@ void WMFWriter::WriteHeader( const GDIMetaFile &, bool bPlaceable )
if( bPlaceable )
{
sal_uInt16 nCheckSum, nValue;
- Size aSize( OutputDevice::LogicToLogic(Size(1,1),MapMode(MAP_INCH), aTargetMapMode) );
+ Size aSize( OutputDevice::LogicToLogic(Size(1,1),MapMode(MapUnit::MapInch), aTargetMapMode) );
sal_uInt16 nUnitsPerInch = (sal_uInt16) ( ( aSize.Width() + aSize.Height() ) >> 1 );
nCheckSum=0;
@@ -1721,7 +1721,7 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
}
else
{
- aTargetMapMode = MapMode( MAP_INCH );
+ aTargetMapMode = MapMode( MapUnit::MapInch );
const long nUnit = pVirDev->LogicToPixel( Size( 1, 1 ), aTargetMapMode ).Width();
const Fraction aFrac( 1, nUnit );
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index a2187f3eceaf..e9461d1e5f6a 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -55,7 +55,7 @@ Bitmap::Bitmap(const Bitmap& rBitmap)
Bitmap::Bitmap(SalBitmap* pSalBitmap)
: mxImpBmp(new ImpBitmap(pSalBitmap))
- , maPrefMapMode(MapMode(MAP_PIXEL))
+ , maPrefMapMode(MapMode(MapUnit::MapPixel))
, maPrefSize(mxImpBmp->ImplGetSize())
{
}
@@ -1531,7 +1531,7 @@ bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal
if (xImpBmp->ImplCreate(*mxImpBmp) && xImpBmp->ImplReplace(rSearchColor, rReplaceColor, nTol))
{
ImplSetImpBitmap(xImpBmp);
- maPrefMapMode = MapMode( MAP_PIXEL );
+ maPrefMapMode = MapMode( MapUnit::MapPixel );
maPrefSize = xImpBmp->ImplGetSize();
return true;
}
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index f4223fe385a8..acc6c4baeac0 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -904,7 +904,7 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag n
{
ImplSetImpBitmap(xImpBmp);
SAL_INFO( "vcl.opengl", "Ref count: " << mxImpBmp.use_count() );
- maPrefMapMode = MapMode( MAP_PIXEL );
+ maPrefMapMode = MapMode( MapUnit::MapPixel );
maPrefSize = xImpBmp->ImplGetSize();
return true;
}
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index a3e6a07015db..ebe9d895e20f 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -943,7 +943,7 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_u
if(bRet && aHeader.nXPelsPerMeter && aHeader.nYPelsPerMeter)
{
MapMode aMapMode(
- MAP_MM,
+ MapUnit::MapMM,
Point(),
Fraction(1000, aHeader.nXPelsPerMeter),
Fraction(1000, aHeader.nYPelsPerMeter));
@@ -1358,7 +1358,7 @@ bool ImplWriteDIBBits(SvStream& rOStm, BitmapReadAccess& rAcc, BitmapReadAccess*
bool ImplWriteDIBBody(const Bitmap& rBitmap, SvStream& rOStm, BitmapReadAccess& rAcc, BitmapReadAccess* pAccAlpha, bool bCompressed)
{
- const MapMode aMapPixel(MAP_PIXEL);
+ const MapMode aMapPixel(MapUnit::MapPixel);
DIBV5Header aHeader;
sal_uLong nImageSizePos(0);
sal_uLong nEndPos(0);
@@ -1421,7 +1421,7 @@ bool ImplWriteDIBBody(const Bitmap& rBitmap, SvStream& rOStm, BitmapReadAccess&
// MapMode is integer-based, and suffers from roundoffs,
// especially if maPrefSize is small. Trying to circumvent
// that by performing part of the math in floating point.
- const Size aScale100000(OutputDevice::LogicToLogic(Size(100000, 100000), MAP_100TH_MM, rBitmap.GetPrefMapMode()));
+ const Size aScale100000(OutputDevice::LogicToLogic(Size(100000, 100000), MapUnit::Map100thMM, rBitmap.GetPrefMapMode()));
const double fBmpWidthM((double)rBitmap.GetPrefSize().Width() / aScale100000.Width());
const double fBmpHeightM((double)rBitmap.GetPrefSize().Height() / aScale100000.Height());
diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx
index b8adfdf18109..877ca9a302f1 100644
--- a/vcl/source/gdi/gdimetafiletools.cxx
+++ b/vcl/source/gdi/gdimetafiletools.cxx
@@ -276,7 +276,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource)
// start with empty region
aClips.push_back(basegfx::B2DPolyPolygon());
- // start with default MapMode (MAP_PIXEL)
+ // start with default MapMode (MapUnit::MapPixel)
aMapModes.push_back(MapMode());
for(sal_uLong i(0); i < nObjCount; ++i)
@@ -715,7 +715,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource)
// combination with the current MapMode
Size aLogicalSize(rBitmapEx.GetPrefSize());
- if(MAP_PIXEL == rBitmapEx.GetPrefMapMode().GetMapUnit())
+ if(MapUnit::MapPixel == rBitmapEx.GetPrefMapMode().GetMapUnit())
{
aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, aMapModes.back().GetMapUnit());
}
@@ -742,7 +742,7 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource)
// combination with the current MapMode
Size aLogicalSize(rBitmap.GetPrefSize());
- if(MAP_PIXEL == rBitmap.GetPrefMapMode().GetMapUnit())
+ if(MapUnit::MapPixel == rBitmap.GetPrefMapMode().GetMapUnit())
{
aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, aMapModes.back().GetMapUnit());
}
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 7954574c6a7a..74bdd0747026 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -419,7 +419,7 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
BitmapEx aBitmapEx;
if( aBitmapEx.Create( xBitmapCanvas, aSize ) )
{
- if ( pOut->GetMapMode() == MAP_PIXEL )
+ if ( pOut->GetMapMode() == MapUnit::MapPixel )
pOut->DrawBitmapEx( rPos, aBitmapEx );
else
pOut->DrawBitmapEx( rPos, rLogicDestSize, aBitmapEx );
@@ -706,7 +706,7 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY )
( MetaActionType::POP == nType ) )
{
pModAct->Execute( aMapVDev.get() );
- if( aMapVDev->GetMapMode().GetMapUnit() == MAP_PIXEL )
+ if( aMapVDev->GetMapMode().GetMapUnit() == MapUnit::MapPixel )
{
aOffset = aMapVDev->LogicToPixel( aBaseOffset, GetPrefMapMode() );
MapMode aMap( aMapVDev->GetMapMode() );
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 791a65971294..77c8fad22fa1 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -92,7 +92,7 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
if ( aSize.Width() > 0 && aSize.Height() > 0 && pFont && pText && pText->getLength()
&& !(!pOutDev->IsOutputEnabled() /*&& pOutDev->GetConnectMetaFile() */) )
{
- MapMode aMapMode( MAP_POINT );
+ MapMode aMapMode( MapUnit::MapPoint );
Size aSz = pOutDev->LogicToLogic( Size( 0, 12 ), &aMapMode, nullptr );
long nThreshold = aSz.Height() / 2;
long nStep = nThreshold / 3;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 2a7dce6480fc..ce3b42c4f681 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -696,7 +696,7 @@ MapMode ImpGraphic::ImplGetPrefMapMode() const
if(maSvgData.get() && maEx.IsEmpty())
{
// svg not yet buffered in maEx, return default PrefMapMode
- aMapMode = MapMode(MAP_100TH_MM);
+ aMapMode = MapMode(MapUnit::Map100thMM);
}
else
{
@@ -1075,7 +1075,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
rOStm.WriteInt32( 0 );
rOStm.WriteInt32( aSize.Width() );
rOStm.WriteInt32( aSize.Height() );
- rOStm.WriteInt32( aMapMode.GetMapUnit() );
+ rOStm.WriteInt32( (sal_uInt16)aMapMode.GetMapUnit() );
rOStm.WriteInt32( aMapMode.GetScaleX().GetNumerator() );
rOStm.WriteInt32( aMapMode.GetScaleX().GetDenominator() );
rOStm.WriteInt32( aMapMode.GetScaleY().GetNumerator() );
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index 26a4c6d520d2..d3b97e9ec35a 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -713,7 +713,7 @@ bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
if( rMtf.GetActionSize() )
{
- MapMode aMap( MAP_100TH_MM );
+ MapMode aMap( MapUnit::Map100thMM );
ScopedVclPtrInstance< VirtualDevice > aVDev;
const Size aLogSize1( aVDev->PixelToLogic( Size( 1, 1 ), aMap ) );
diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx
index 06523e0ead4c..e981a5d26253 100644
--- a/vcl/source/gdi/mapmod.cxx
+++ b/vcl/source/gdi/mapmod.cxx
@@ -49,7 +49,7 @@ MapMode::ImplMapMode::ImplMapMode() :
maScaleX( 1, 1 ),
maScaleY( 1, 1 )
{
- meUnit = MAP_PIXEL;
+ meUnit = MapUnit::MapPixel;
mbSimple = true;
}
@@ -134,38 +134,38 @@ double MapMode::GetUnitMultiplier() const
double nMul;
switch ( GetMapUnit() )
{
- case MAP_PIXEL :
- case MAP_SYSFONT :
- case MAP_APPFONT :
+ case MapUnit::MapPixel :
+ case MapUnit::MapSysFont :
+ case MapUnit::MapAppFont :
- case MAP_100TH_MM :
+ case MapUnit::Map100thMM :
nMul = 1;
break;
- case MAP_10TH_MM :
+ case MapUnit::Map10thMM :
nMul = 10;
break;
- case MAP_MM :
+ case MapUnit::MapMM :
nMul = 100;
break;
- case MAP_CM :
+ case MapUnit::MapCM :
nMul = 1000;
break;
- case MAP_1000TH_INCH :
+ case MapUnit::Map1000thInch :
nMul = 2.54;
break;
- case MAP_100TH_INCH :
+ case MapUnit::Map100thInch :
nMul = 25.4;
break;
- case MAP_10TH_INCH :
+ case MapUnit::Map10thInch :
nMul = 254;
break;
- case MAP_INCH :
+ case MapUnit::MapInch :
nMul = 2540;
break;
- case MAP_TWIP :
+ case MapUnit::MapTwip :
nMul = 1.76388889;
break;
- case MAP_POINT :
+ case MapUnit::MapPoint :
nMul = 35.27777778;
break;
default:
@@ -215,7 +215,7 @@ SvStream& WriteMapMode( SvStream& rOStm, const MapMode& rMapMode )
{
VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 );
- rOStm.WriteUInt16( rMapMode.mpImplMapMode->meUnit );
+ rOStm.WriteUInt16( (sal_uInt16)rMapMode.mpImplMapMode->meUnit );
WritePair( rOStm, rMapMode.mpImplMapMode->maOrigin );
WriteFraction( rOStm, rMapMode.mpImplMapMode->maScaleX );
WriteFraction( rOStm, rMapMode.mpImplMapMode->maScaleY );
diff --git a/vcl/source/gdi/oldprintadaptor.cxx b/vcl/source/gdi/oldprintadaptor.cxx
index 2c0fedd478a8..1f354febbd25 100644
--- a/vcl/source/gdi/oldprintadaptor.cxx
+++ b/vcl/source/gdi/oldprintadaptor.cxx
@@ -57,7 +57,7 @@ OldStylePrintAdaptor::~OldStylePrintAdaptor()
void OldStylePrintAdaptor::StartPage()
{
- Size aPaperSize( getPrinter()->PixelToLogic( getPrinter()->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
+ Size aPaperSize( getPrinter()->PixelToLogic( getPrinter()->GetPaperSizePixel(), MapMode( MapUnit::Map100thMM ) ) );
mpData->maPages.push_back( AdaptorPage() );
mpData->maPages.back().maPageSize.Width = aPaperSize.getWidth();
mpData->maPages.back().maPageSize.Height = aPaperSize.getHeight();
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 66b79c0785c4..8a662bc01546 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -177,7 +177,7 @@ void doTestCode()
aWriter.BeginStructureElement( PDFWriter::Document );
// set duration of 3 sec for first page
aWriter.SetAutoAdvanceTime( 3 );
- aWriter.SetMapMode( MapMode( MAP_100TH_MM ) );
+ aWriter.SetMapMode( MapMode( MapUnit::Map100thMM ) );
aWriter.SetFillColor( Color( COL_LIGHTRED ) );
aWriter.SetLineColor( Color( COL_LIGHTGREEN ) );
@@ -229,7 +229,7 @@ void doTestCode()
aWriter.AddStream( "text/plain", new PDFTestOutputStream(), true );
// set transitional mode
aWriter.SetPageTransition( PDFWriter::WipeRightToLeft, 1500 );
- aWriter.SetMapMode( MapMode( MAP_100TH_MM ) );
+ aWriter.SetMapMode( MapMode( MapUnit::Map100thMM ) );
aWriter.SetTextColor( Color( COL_BLACK ) );
aWriter.SetFont( Font( OUString( "Times" ), Size( 0, 500 ) ) );
aWriter.DrawText( Rectangle( Point( 4500, 1500 ), Size( 12000, 3000 ) ),
@@ -301,7 +301,7 @@ void doTestCode()
for( int nY = 0; nY < 256; nY++ )
pAcc->SetPixel( nX, nY, BitmapColor( (sal_uInt8)((nX+nY)/2) ) );
aTransMask.ReleaseAccess( pAcc );
- aTransMask.SetPrefMapMode( MAP_MM );
+ aTransMask.SetPrefMapMode( MapUnit::MapMM );
aTransMask.SetPrefSize( Size( 10, 10 ) );
aWriter.DrawBitmap( Point( 600, 13500 ), Size( 3000, 3000 ), aTransMask );
@@ -349,13 +349,13 @@ void doTestCode()
aWriter.DrawPolyLine( aLIPoly, aLI );
aWriter.NewPage( 595, 842 );
- aWriter.SetMapMode( MapMode( MAP_100TH_MM ) );
+ aWriter.SetMapMode( MapMode( MapUnit::Map100thMM ) );
Wallpaper aWall( aTransMask );
aWall.SetStyle( WallpaperStyle::Tile );
aWriter.DrawWallpaper( Rectangle( Point( 4400, 4200 ), Size( 10200, 6300 ) ), aWall );
aWriter.NewPage( 595, 842 );
- aWriter.SetMapMode( MapMode( MAP_100TH_MM ) );
+ aWriter.SetMapMode( MapMode( MapUnit::Map100thMM ) );
aWriter.SetFont( Font( OUString( "Times" ), Size( 0, 500 ) ) );
aWriter.SetTextColor( Color( COL_BLACK ) );
aRect = Rectangle( Point( 4500, 6000 ), Size( 6000, 1500 ) );
@@ -1370,7 +1370,7 @@ template < class GEOMETRY >
GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, OutputDevice* _pPixelConversion, const GEOMETRY& _rObject )
{
GEOMETRY aPoint;
- if ( MAP_PIXEL == _rSource.GetMapUnit() )
+ if ( MapUnit::MapPixel == _rSource.GetMapUnit() )
{
aPoint = _pPixelConversion->PixelToLogic( _rObject, _rDest );
}
@@ -1713,7 +1713,7 @@ void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal
PDFWriter& i_rOuterFace)
:
m_pReferenceDevice( nullptr ),
- m_aMapMode( MAP_POINT, Point(), Fraction( 1, pointToPixel(1) ), Fraction( 1, pointToPixel(1) ) ),
+ m_aMapMode( MapUnit::MapPoint, Point(), Fraction( 1, pointToPixel(1) ), Fraction( 1, pointToPixel(1) ) ),
m_nCurrentStructElement( 0 ),
m_bEmitStructure( true ),
m_nNextFID( 1 ),
@@ -2206,7 +2206,7 @@ OutputDevice* PDFWriterImpl::getReferenceDevice()
pVDev->SetReferenceDevice( m_aContext.DPIx, m_aContext.DPIy );
pVDev->SetOutputSizePixel( Size( 640, 480 ) );
- pVDev->SetMapMode( MAP_MM );
+ pVDev->SetMapMode( MapUnit::MapMM );
m_pReferenceDevice->mpPDFWriter = this;
m_pReferenceDevice->ImplUpdateFontData();
@@ -3571,7 +3571,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical
OutputDevice* pRef = getReferenceDevice();
pRef->Push( PushFlags::FONT | PushFlags::MAPMODE );
- pRef->SetMapMode( MapMode( MAP_PIXEL ) );
+ pRef->SetMapMode( MapMode( MapUnit::MapPixel ) );
Font aFont( pFont->GetFamilyName(), pFont->GetStyleName(), Size( 0, 1000 ) );
aFont.SetWeight( pFont->GetWeight() );
aFont.SetItalic( pFont->GetItalic() );
@@ -10792,7 +10792,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
ScopedVclPtrInstance< VirtualDevice > aDev;
aDev->SetOutputSizePixel( rObject.m_aSize );
- aDev->SetMapMode( MapMode( MAP_PIXEL ) );
+ aDev->SetMapMode( MapMode( MapUnit::MapPixel ) );
if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
aDev->SetDrawMode( aDev->GetDrawMode() |
( DrawModeFlags::GrayLine | DrawModeFlags::GrayFill | DrawModeFlags::GrayText |
@@ -11546,7 +11546,7 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize,
sal_Int32 PDFWriterImpl::createGradient( const Gradient& rGradient, const Size& rSize )
{
Size aPtSize( lcl_convert( m_aGraphicsStack.front().m_aMapMode,
- MapMode( MAP_POINT ),
+ MapMode( MapUnit::MapPoint ),
getReferenceDevice(),
rSize ) );
// check if we already have this gradient
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index f72a4a1a3cb1..e7feb6ba99a3 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -107,7 +107,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
if( i_rContext.m_nMaxImageResolution > 50 )
{
// do downsampling if necessary
- const Size aDstSizeTwip( i_pDummyVDev->PixelToLogic( i_pDummyVDev->LogicToPixel( aSize ), MAP_TWIP ) );
+ const Size aDstSizeTwip( i_pDummyVDev->PixelToLogic( i_pDummyVDev->LogicToPixel( aSize ), MapUnit::MapTwip ) );
const Size aBmpSize( aBitmapEx.GetSizePixel() );
const double fBmpPixelX = aBmpSize.Width();
const double fBmpPixelY = aBmpSize.Height();
@@ -427,7 +427,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
}
else
{
- const Size aDstSizeTwip( pDummyVDev->PixelToLogic( pDummyVDev->LogicToPixel( rSize ), MAP_TWIP ) );
+ const Size aDstSizeTwip( pDummyVDev->PixelToLogic( pDummyVDev->LogicToPixel( rSize ), MapUnit::MapTwip ) );
// i#115962# Always use at least 300 DPI for bitmap conversion of transparence gradients,
// else the quality is not acceptable (see bugdoc as example)
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index 00497a337b0a..c26a84129de4 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -90,7 +90,7 @@ private:
sal_Int32 mnChunkLen; // Length of current PNG chunk
Size maOrigSize; // pixel size of the full image
Size maTargetSize; // pixel size of the result image
- Size maPhysSize; // preferred size in MAP_100TH_MM units
+ Size maPhysSize; // preferred size in MapUnit::Map100thMM units
sal_uInt32 mnBPP; // number of bytes per pixel
sal_uInt32 mnScansize; // max size of scanline
sal_uInt32 mnYpos; // latest y position in full image
@@ -408,7 +408,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
{
mbpHYs = true;
- // convert into MAP_100TH_MM
+ // convert into MapUnit::Map100thMM
maPhysSize.Width() = (sal_Int32)( (100000.0 * maOrigSize.Width()) / nXPixelPerMeter );
maPhysSize.Height() = (sal_Int32)( (100000.0 * maOrigSize.Height()) / nYPixelPerMeter );
}
@@ -455,7 +455,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
if ( mbpHYs && maPhysSize.Width() && maPhysSize.Height() )
{
- aRet.SetPrefMapMode( MAP_100TH_MM );
+ aRet.SetPrefMapMode( MapUnit::Map100thMM );
aRet.SetPrefSize( maPhysSize );
}
}
diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx
index a55cf09bd784..eddcaf7c81bb 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -358,7 +358,7 @@ void PNGWriterImpl::ImplWriteTransparent()
void PNGWriterImpl::ImplWritepHYs(const BitmapEx& rBmpEx)
{
- if (rBmpEx.GetPrefMapMode() == MAP_100TH_MM)
+ if (rBmpEx.GetPrefMapMode() == MapUnit::Map100thMM)
{
Size aPrefSize(rBmpEx.GetPrefSize());
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 3574c5100f40..45c771a037fe 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -253,7 +253,7 @@ void Printer::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly,
mpAlphaVDev = pOldAlphaVDev;
Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() );
- const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) );
+ const Size aDPISize( LogicToPixel( Size( 1, 1 ), MapUnit::MapInch ) );
const long nBaseExtent = std::max( FRound( aDPISize.Width() / 300. ), 1L );
long nMove;
const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 :
@@ -1449,7 +1449,7 @@ bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
return false;
const Size aPixSize = LogicToPixel( rSize );
- const Size aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
+ const Size aPageSize = PixelToLogic( aPixSize, MapUnit::Map100thMM );
bool bNeedToChange(maJobSetup.ImplGetConstData().GetPaperWidth() != aPageSize.Width() ||
maJobSetup.ImplGetConstData().GetPaperHeight() != aPageSize.Height());
@@ -1542,7 +1542,7 @@ OUString Printer::GetPaperName( Paper ePaper )
OUString Printer::GetPaperName() const
{
- Size aPageSize = PixelToLogic( GetPaperSizePixel(), MAP_100TH_MM );
+ Size aPageSize = PixelToLogic( GetPaperSizePixel(), MapUnit::Map100thMM );
Paper ePaper = ImplGetPaperFormat( aPageSize.Width(), aPageSize.Height() );
if( ePaper == PAPER_USER )
ePaper = ImplGetPaperFormat( aPageSize.Height(), aPageSize.Width() );
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 22cf699f7b2e..dbd07513906f 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -1111,7 +1111,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
if( mpPDFWriter )
{
aTmpSize = mpPDFWriter->getCurPageSize();
- aTmpSize = LogicToPixel( aTmpSize, MapMode( MAP_POINT ) );
+ aTmpSize = LogicToPixel( aTmpSize, MapMode( MapUnit::MapPoint ) );
// also add error code to PDFWriter
mpPDFWriter->insertError( vcl::PDFWriter::Warning_Transparency_Converted );
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 741038d77b6c..b9de9928cc76 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -434,7 +434,7 @@ bool Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
aMPS.nVerticalSpacing = nValue;
aMPS.bDrawBorder = xController->getBoolProperty( "NUpDrawBorder", aMPS.bDrawBorder );
aMPS.nOrder = static_cast<NupOrderType>(xController->getIntProperty( "NUpSubPageOrder", (sal_Int32)aMPS.nOrder ));
- aMPS.aPaperSize = xController->getPrinter()->PixelToLogic( xController->getPrinter()->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) );
+ aMPS.aPaperSize = xController->getPrinter()->PixelToLogic( xController->getPrinter()->GetPaperSizePixel(), MapMode( MapUnit::Map100thMM ) );
css::beans::PropertyValue* pPgSizeVal = xController->getValue( OUString( "NUpPaperSize" ) );
css::awt::Size aSizeVal;
if( pPgSizeVal && (pPgSizeVal->Value >>= aSizeVal) )
@@ -782,7 +782,7 @@ void PrinterController::setPrinter( const VclPtr<Printer>& i_rPrinter )
css::uno::makeAny( OUString( i_rPrinter->GetName() ) ) );
mpImplData->mnDefaultPaperBin = mpImplData->mxPrinter->GetPaperBin();
mpImplData->mxPrinter->Push();
- mpImplData->mxPrinter->SetMapMode(MapMode(MAP_100TH_MM));
+ mpImplData->mxPrinter->SetMapMode(MapMode(MapUnit::Map100thMM));
mpImplData->maDefaultPageSize = mpImplData->mxPrinter->GetPaperSize();
mpImplData->mxPrinter->Pop();
mpImplData->mnFixedPaperBin = -1;
@@ -801,7 +801,7 @@ bool PrinterController::setupPrinter( vcl::Window* i_pParent )
if( mpImplData->mxPrinter.get() )
{
mpImplData->mxPrinter->Push();
- mpImplData->mxPrinter->SetMapMode(MapMode(MAP_100TH_MM));
+ mpImplData->mxPrinter->SetMapMode(MapMode(MapUnit::Map100thMM));
// get current data
Size aPaperSize(mpImplData->mxPrinter->GetPaperSize());
@@ -928,7 +928,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
void vcl::ImplPrinterControllerData::resetPaperToLastConfigured()
{
mxPrinter->Push();
- mxPrinter->SetMapMode(MapMode(MAP_100TH_MM));
+ mxPrinter->SetMapMode(MapMode(MapUnit::Map100thMM));
Size aCurSize(mxPrinter->GetPaperSize());
if (aCurSize != maDefaultPageSize)
mxPrinter->SetPaperSizeUser(maDefaultPageSize, !isFixedPageSize());
@@ -937,7 +937,7 @@ void vcl::ImplPrinterControllerData::resetPaperToLastConfigured()
int PrinterController::getPageCountProtected() const
{
- const MapMode aMapMode( MAP_100TH_MM );
+ const MapMode aMapMode( MapUnit::Map100thMM );
mpImplData->mxPrinter->Push();
mpImplData->mxPrinter->SetMapMode( aMapMode );
@@ -948,7 +948,7 @@ int PrinterController::getPageCountProtected() const
css::uno::Sequence< css::beans::PropertyValue > PrinterController::getPageParametersProtected( int i_nPage ) const
{
- const MapMode aMapMode( MAP_100TH_MM );
+ const MapMode aMapMode( MapUnit::Map100thMM );
mpImplData->mxPrinter->Push();
mpImplData->mxPrinter->SetMapMode( aMapMode );
@@ -984,7 +984,7 @@ PrinterController::PageSize PrinterController::getPageFile( int i_nUnfilteredPag
// get page parameters
css::uno::Sequence< css::beans::PropertyValue > aPageParm( getPageParametersProtected( i_nUnfilteredPage ) );
- const MapMode aMapMode( MAP_100TH_MM );
+ const MapMode aMapMode( MapUnit::Map100thMM );
mpImplData->mxPrinter->Push();
mpImplData->mxPrinter->SetMapMode( aMapMode );
@@ -1038,7 +1038,7 @@ static void appendSubPage( GDIMetaFile& o_rMtf, const Rectangle& i_rClipRect, GD
{
// save gstate
o_rMtf.AddAction( new MetaPushAction( PushFlags::LINECOLOR | PushFlags::FILLCOLOR | PushFlags::CLIPREGION | PushFlags::MAPMODE ) );
- o_rMtf.AddAction( new MetaMapModeAction( MapMode( MAP_100TH_MM ) ) );
+ o_rMtf.AddAction( new MetaMapModeAction( MapMode( MapUnit::Map100thMM ) ) );
Rectangle aBorderRect( i_rClipRect );
o_rMtf.AddAction( new MetaLineColorAction( Color( COL_BLACK ), true ) );
@@ -1077,7 +1077,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
return PrinterController::PageSize();
}
Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize, true );
- mpImplData->mxPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ mpImplData->mxPrinter->SetMapMode( MapMode( MapUnit::Map100thMM ) );
mpImplData->mxPrinter->SetPaperSizeUser( aPaperSize, ! mpImplData->isFixedPageSize() );
if( aPaperSize != aPageSize.aSize )
{
@@ -1117,8 +1117,8 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
o_rMtf.Clear();
o_rMtf.SetPrefSize( aPaperSize );
- o_rMtf.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
- o_rMtf.AddAction( new MetaMapModeAction( MapMode( MAP_100TH_MM ) ) );
+ o_rMtf.SetPrefMapMode( MapMode( MapUnit::Map100thMM ) );
+ o_rMtf.AddAction( new MetaMapModeAction( MapMode( MapUnit::Map100thMM ) ) );
int nDocPages = getPageCountProtected();
if (mpImplData->meJobState != css::view::PrintableState_JOB_STARTED)
@@ -1187,7 +1187,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte
o_rMtf.WindStart();
// subsequent getPageFile calls have changed the paper, reset it to current value
- mpImplData->mxPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ mpImplData->mxPrinter->SetMapMode( MapMode( MapUnit::Map100thMM ) );
mpImplData->mxPrinter->SetPaperSizeUser( aPaperSize, ! mpImplData->isFixedPageSize() );
return PrinterController::PageSize( aPaperSize, true );
@@ -1287,7 +1287,7 @@ void PrinterController::printFilteredPage( int i_nPage )
}
// in N-Up printing set the correct page size
- mpImplData->mxPrinter->SetMapMode( MAP_100TH_MM );
+ mpImplData->mxPrinter->SetMapMode( MapUnit::Map100thMM );
// aPageSize was filtered through mpImplData->getRealPaperSize already by getFilteredPageFile()
mpImplData->mxPrinter->SetPaperSizeUser( aPageSize.aSize, ! mpImplData->isFixedPageSize() );
if( mpImplData->mnFixedPaperBin != -1 &&
diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx
index 1e08433bf83d..cf85eeb6be8e 100644
--- a/vcl/source/gdi/svgdata.cxx
+++ b/vcl/source/gdi/svgdata.cxx
@@ -58,7 +58,7 @@ BitmapEx convertPrimitive2DSequenceToBitmapEx(
aRealRect.Y2 = rTargetRange.getMaxY();
// get system DPI
- const Size aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), MAP_INCH));
+ const Size aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), MapUnit::MapInch));
const uno::Reference< rendering::XBitmap > xBitmap(
xPrimitive2DRenderer->rasterize(
diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx
index 37bcd08af1c2..0ed8e5f94cef 100644
--- a/vcl/source/gdi/svmconverter.cxx
+++ b/vcl/source/gdi/svmconverter.cxx
@@ -146,7 +146,7 @@ void ImplReadMapMode( SvStream& rIStm, MapMode& rMapMode )
void ImplWriteMapMode( SvStream& rOStm, const MapMode& rMapMode )
{
- rOStm.WriteInt16( rMapMode.GetMapUnit() );
+ rOStm.WriteInt16( (sal_uInt16)rMapMode.GetMapUnit() );
WritePair( rOStm, rMapMode.GetOrigin() );
rOStm.WriteInt32( rMapMode.GetScaleX().GetNumerator() );
rOStm.WriteInt32( rMapMode.GetScaleX().GetDenominator() );
diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
index 6129fa0fa1d5..4d9783e188b9 100644
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -129,26 +129,26 @@ namespace vcl
// also, use a higher-resolution map unit than "pixels", which should save us some rounding errors when
// translating coordinates between the reference device and the target device.
- OSL_ENSURE( aTargetMapMode.GetMapUnit() == MAP_PIXEL,
+ OSL_ENSURE( aTargetMapMode.GetMapUnit() == MapUnit::MapPixel,
"ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: this class is not expected to work with such target devices!" );
// we *could* adjust all the code in this class to handle this case, but at the moment, it's not necessary
const MapUnit eTargetMapUnit = m_rReferenceDevice.GetMapMode().GetMapUnit();
aTargetMapMode.SetMapUnit( eTargetMapUnit );
- OSL_ENSURE( aTargetMapMode.GetMapUnit() != MAP_PIXEL,
+ OSL_ENSURE( aTargetMapMode.GetMapUnit() != MapUnit::MapPixel,
"ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: a reference device which has map mode PIXEL?!" );
m_rTargetDevice.SetMapMode( aTargetMapMode );
// now that the Zoom is part of the map mode, reset the target device's font to the "unzoomed" version
Font aDrawFont( m_aUnzoomedPointFont );
- aDrawFont.SetFontSize( OutputDevice::LogicToLogic( aDrawFont.GetFontSize(), MAP_POINT, eTargetMapUnit ) );
+ aDrawFont.SetFontSize( OutputDevice::LogicToLogic( aDrawFont.GetFontSize(), MapUnit::MapPoint, eTargetMapUnit ) );
_rTargetDevice.SetFont( aDrawFont );
// transfer font to the reference device
m_rReferenceDevice.Push( PushFlags::FONT | PushFlags::TEXTLAYOUTMODE );
Font aRefFont( m_aUnzoomedPointFont );
aRefFont.SetFontSize( OutputDevice::LogicToLogic(
- aRefFont.GetFontSize(), MAP_POINT, m_rReferenceDevice.GetMapMode().GetMapUnit() ) );
+ aRefFont.GetFontSize(), MapUnit::MapPoint, m_rReferenceDevice.GetMapMode().GetMapUnit() ) );
m_rReferenceDevice.SetFont( aRefFont );
}
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 387bf0d97f98..8a5e1d53e0f9 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -196,7 +196,7 @@ Bitmap OutputDevice::GetDownsampledBitmap( const Size& rDstSz,
if( !aBmp.IsEmpty() )
{
// do downsampling if necessary
- Size aDstSizeTwip( PixelToLogic( LogicToPixel( rDstSz ), MAP_TWIP ) );
+ Size aDstSizeTwip( PixelToLogic( LogicToPixel( rDstSz ), MapUnit::MapTwip ) );
// #103209# Normalize size (mirroring has to happen outside of this method)
aDstSizeTwip = Size( labs(aDstSizeTwip.Width()), labs(aDstSizeTwip.Height()) );
@@ -1199,14 +1199,14 @@ void OutputDevice::DrawTransformedBitmapEx(
basegfx::fround(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
basegfx::fround(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
const Point aOrigin = GetMapMode().GetOrigin();
- if (comphelper::LibreOfficeKit::isActive() && GetMapMode().GetMapUnit() != MAP_PIXEL)
+ if (comphelper::LibreOfficeKit::isActive() && GetMapMode().GetMapUnit() != MapUnit::MapPixel)
{
aDestPt.Move(aOrigin.getX(), aOrigin.getY());
EnableMapMode(false);
}
DrawBitmapEx(aDestPt, aDestSize, rBitmapEx);
- if (comphelper::LibreOfficeKit::isActive() && GetMapMode().GetMapUnit() != MAP_PIXEL)
+ if (comphelper::LibreOfficeKit::isActive() && GetMapMode().GetMapUnit() != MapUnit::MapPixel)
{
EnableMapMode();
aDestPt.Move(-aOrigin.getX(), -aOrigin.getY());
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 8f7fea70cd1a..36f1602de603 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -118,7 +118,7 @@ Size OutputDevice::GetDevFontSize( const vcl::Font& rFont, int nSizeIndex ) cons
if ( mbMap )
{
aSize.Height() *= 10;
- MapMode aMap( MAP_10TH_INCH, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) );
+ MapMode aMap( MapUnit::Map10thInch, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) );
aSize = PixelToLogic( aSize, aMap );
aSize.Height() += 5;
aSize.Height() /= 10;
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 24ca3306604e..c66565093596 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -28,12 +28,14 @@
#include <outdev.h>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <o3tl/enumarray.hxx>
-static int const s_ImplArySize = MAP_PIXEL+1;
-static const long aImplNumeratorAry[s_ImplArySize] =
- { 1, 1, 5, 50, 1, 1, 1, 1, 1, 1, 1 };
-static const long aImplDenominatorAry[s_ImplArySize] =
- { 2540, 254, 127, 127, 1000, 100, 10, 1, 72, 1440, 1 };
+// we don't actually handle units beyond, hence the zeros in the arrays
+static const MapUnit s_MaxValidUnit = MapUnit::MapPixel;
+static const o3tl::enumarray<MapUnit,long> aImplNumeratorAry =
+ { 1, 1, 5, 50, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 };
+static const o3tl::enumarray<MapUnit,long> aImplDenominatorAry =
+ { 2540, 254, 127, 127, 1000, 100, 10, 1, 72, 1440, 1, 0, 0, 0 };
/*
Reduces accuracy until it is a fraction (should become
@@ -148,76 +150,76 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
rMapRes.mfScaleY = 1.0;
switch ( rMapMode.GetMapUnit() )
{
- case MAP_RELATIVE:
+ case MapUnit::MapRelative:
break;
- case MAP_100TH_MM:
+ case MapUnit::Map100thMM:
rMapRes.mnMapScNumX = 1;
rMapRes.mnMapScDenomX = 2540;
rMapRes.mnMapScNumY = 1;
rMapRes.mnMapScDenomY = 2540;
break;
- case MAP_10TH_MM:
+ case MapUnit::Map10thMM:
rMapRes.mnMapScNumX = 1;
rMapRes.mnMapScDenomX = 254;
rMapRes.mnMapScNumY = 1;
rMapRes.mnMapScDenomY = 254;
break;
- case MAP_MM:
+ case MapUnit::MapMM:
rMapRes.mnMapScNumX = 5; // 10
rMapRes.mnMapScDenomX = 127; // 254
rMapRes.mnMapScNumY = 5; // 10
rMapRes.mnMapScDenomY = 127; // 254
break;
- case MAP_CM:
+ case MapUnit::MapCM:
rMapRes.mnMapScNumX = 50; // 100
rMapRes.mnMapScDenomX = 127; // 254
rMapRes.mnMapScNumY = 50; // 100
rMapRes.mnMapScDenomY = 127; // 254
break;
- case MAP_1000TH_INCH:
+ case MapUnit::Map1000thInch:
rMapRes.mnMapScNumX = 1;
rMapRes.mnMapScDenomX = 1000;
rMapRes.mnMapScNumY = 1;
rMapRes.mnMapScDenomY = 1000;
break;
- case MAP_100TH_INCH:
+ case MapUnit::Map100thInch:
rMapRes.mnMapScNumX = 1;
rMapRes.mnMapScDenomX = 100;
rMapRes.mnMapScNumY = 1;
rMapRes.mnMapScDenomY = 100;
break;
- case MAP_10TH_INCH:
+ case MapUnit::Map10thInch:
rMapRes.mnMapScNumX = 1;
rMapRes.mnMapScDenomX = 10;
rMapRes.mnMapScNumY = 1;
rMapRes.mnMapScDenomY = 10;
break;
- case MAP_INCH:
+ case MapUnit::MapInch:
rMapRes.mnMapScNumX = 1;
rMapRes.mnMapScDenomX = 1;
rMapRes.mnMapScNumY = 1;
rMapRes.mnMapScDenomY = 1;
break;
- case MAP_POINT:
+ case MapUnit::MapPoint:
rMapRes.mnMapScNumX = 1;
rMapRes.mnMapScDenomX = 72;
rMapRes.mnMapScNumY = 1;
rMapRes.mnMapScDenomY = 72;
break;
- case MAP_TWIP:
+ case MapUnit::MapTwip:
rMapRes.mnMapScNumX = 1;
rMapRes.mnMapScDenomX = 1440;
rMapRes.mnMapScNumY = 1;
rMapRes.mnMapScDenomY = 1440;
break;
- case MAP_PIXEL:
+ case MapUnit::MapPixel:
rMapRes.mnMapScNumX = 1;
rMapRes.mnMapScDenomX = nDPIX;
rMapRes.mnMapScNumY = 1;
rMapRes.mnMapScDenomY = nDPIY;
break;
- case MAP_SYSFONT:
- case MAP_APPFONT:
+ case MapUnit::MapSysFont:
+ case MapUnit::MapAppFont:
{
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maGDIData.mnAppFontX )
@@ -246,7 +248,7 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
// set offset according to MapMode
Point aOrigin = rMapMode.GetOrigin();
- if ( rMapMode.GetMapUnit() != MAP_RELATIVE )
+ if ( rMapMode.GetMapUnit() != MapUnit::MapRelative )
{
rMapRes.mnMapOfsX = aOrigin.X();
rMapRes.mnMapOfsY = aOrigin.Y();
@@ -694,7 +696,7 @@ void OutputDevice::SetMapMode()
void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
{
- bool bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE);
+ bool bRelMap = (rNewMapMode.GetMapUnit() == MapUnit::MapRelative);
if ( mpMetaFile )
{
@@ -817,11 +819,11 @@ void OutputDevice::SetRelativeMapMode( const MapMode& rNewMapMode )
Point aPt( LogicToLogic( Point(), nullptr, &rNewMapMode ) );
if ( eNew != eOld )
{
- if ( eOld > MAP_PIXEL )
+ if ( eOld > MapUnit::MapPixel )
{
SAL_WARN( "vcl.gdi", "Not implemented MapUnit" );
}
- else if ( eNew > MAP_PIXEL )
+ else if ( eNew > MapUnit::MapPixel )
{
SAL_WARN( "vcl.gdi", "Not implemented MapUnit" );
}
@@ -835,12 +837,12 @@ void OutputDevice::SetRelativeMapMode( const MapMode& rNewMapMode )
aXF.GetDenominator(), aF.GetDenominator() );
aYF = ImplMakeFraction( aYF.GetNumerator(), aF.GetNumerator(),
aYF.GetDenominator(), aF.GetDenominator() );
- if ( eOld == MAP_PIXEL )
+ if ( eOld == MapUnit::MapPixel )
{
aXF *= Fraction( mnDPIX, 1 );
aYF *= Fraction( mnDPIY, 1 );
}
- else if ( eNew == MAP_PIXEL )
+ else if ( eNew == MapUnit::MapPixel )
{
aXF *= Fraction( 1, mnDPIX );
aYF *= Fraction( 1, mnDPIY );
@@ -848,7 +850,7 @@ void OutputDevice::SetRelativeMapMode( const MapMode& rNewMapMode )
}
}
- MapMode aNewMapMode( MAP_RELATIVE, Point( -aPt.X(), -aPt.Y() ), aXF, aYF );
+ MapMode aNewMapMode( MapUnit::MapRelative, Point( -aPt.X(), -aPt.Y() ), aXF, aYF );
SetMapMode( aNewMapMode );
if ( eNew != eOld )
@@ -1480,7 +1482,7 @@ basegfx::B2DPolyPolygon OutputDevice::PixelToLogic( const basegfx::B2DPolyPolygo
\
if ( !mbMap || pMapModeSource != &maMapMode ) \
{ \
- if ( pMapModeSource->GetMapUnit() == MAP_RELATIVE ) \
+ if ( pMapModeSource->GetMapUnit() == MapUnit::MapRelative ) \
aMapResSource = maMapRes; \
ImplCalcMapResolution( *pMapModeSource, \
mnDPIX, mnDPIY, aMapResSource ); \
@@ -1489,7 +1491,7 @@ basegfx::B2DPolyPolygon OutputDevice::PixelToLogic( const basegfx::B2DPolyPolygo
aMapResSource = maMapRes; \
if ( !mbMap || pMapModeDest != &maMapMode ) \
{ \
- if ( pMapModeDest->GetMapUnit() == MAP_RELATIVE ) \
+ if ( pMapModeDest->GetMapUnit() == MapUnit::MapRelative ) \
aMapResDest = maMapRes; \
ImplCalcMapResolution( *pMapModeDest, \
mnDPIX, mnDPIY, aMapResDest ); \
@@ -1501,35 +1503,35 @@ static void verifyUnitSourceDest( MapUnit eUnitSource, MapUnit eUnitDest )
{
(void) eUnitSource;
(void) eUnitDest;
- DBG_ASSERT( eUnitSource != MAP_SYSFONT
- && eUnitSource != MAP_APPFONT
- && eUnitSource != MAP_RELATIVE,
+ DBG_ASSERT( eUnitSource != MapUnit::MapSysFont
+ && eUnitSource != MapUnit::MapAppFont
+ && eUnitSource != MapUnit::MapRelative,
"Source MapUnit is not permitted" );
- DBG_ASSERT( eUnitDest != MAP_SYSFONT
- && eUnitDest != MAP_APPFONT
- && eUnitDest != MAP_RELATIVE,
+ DBG_ASSERT( eUnitDest != MapUnit::MapSysFont
+ && eUnitDest != MapUnit::MapAppFont
+ && eUnitDest != MapUnit::MapRelative,
"Destination MapUnit is not permitted" );
- SAL_WARN_IF( eUnitSource == MAP_PIXEL, "vcl",
- "MAP_PIXEL approximated with 72dpi" );
- SAL_WARN_IF( eUnitDest == MAP_PIXEL, "vcl",
- "MAP_PIXEL approximated with 72dpi" );
+ SAL_WARN_IF( eUnitSource == MapUnit::MapPixel, "vcl",
+ "MapUnit::MapPixel approximated with 72dpi" );
+ SAL_WARN_IF( eUnitDest == MapUnit::MapPixel, "vcl",
+ "MapUnit::MapPixel approximated with 72dpi" );
}
#define ENTER3( eUnitSource, eUnitDest ) \
long nNumerator = 1; \
long nDenominator = 1; \
- SAL_WARN_IF( eUnitSource >= s_ImplArySize, "vcl", "Invalid source map unit"); \
- SAL_WARN_IF( eUnitDest >= s_ImplArySize, "vcl", "Invalid destination map unit"); \
- if( (eUnitSource < s_ImplArySize) && (eUnitDest < s_ImplArySize) ) \
+ SAL_WARN_IF( eUnitSource > s_MaxValidUnit, "vcl", "Invalid source map unit"); \
+ SAL_WARN_IF( eUnitDest > s_MaxValidUnit, "vcl", "Invalid destination map unit"); \
+ if( (eUnitSource <= s_MaxValidUnit) && (eUnitDest <= s_MaxValidUnit) ) \
{ \
nNumerator = aImplNumeratorAry[eUnitSource] * \
aImplDenominatorAry[eUnitDest]; \
nDenominator = aImplNumeratorAry[eUnitDest] * \
aImplDenominatorAry[eUnitSource]; \
} \
- if ( eUnitSource == MAP_PIXEL ) \
+ if ( eUnitSource == MapUnit::MapPixel ) \
nDenominator *= 72; \
- else if( eUnitDest == MAP_PIXEL ) \
+ else if( eUnitDest == MapUnit::MapPixel ) \
nNumerator *= 72
#define ENTER4( rMapModeSource, rMapModeDest ) \
@@ -1951,7 +1953,7 @@ namespace vcl {
long Window::ImplLogicUnitToPixelX( long nX, MapUnit eUnit )
{
- if ( eUnit != MAP_PIXEL )
+ if ( eUnit != MapUnit::MapPixel )
{
ImplFrameData* pFrameData = mpWindowImpl->mpFrameData;
@@ -1976,7 +1978,7 @@ long Window::ImplLogicUnitToPixelX( long nX, MapUnit eUnit )
long Window::ImplLogicUnitToPixelY( long nY, MapUnit eUnit )
{
- if ( eUnit != MAP_PIXEL )
+ if ( eUnit != MapUnit::MapPixel )
{
ImplFrameData* pFrameData = mpWindowImpl->mpFrameData;
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 6c8137328bda..8b03032efbd6 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -2713,7 +2713,7 @@ bool OutputDevice::GetTextOutlines( basegfx::B2DPolyPolygonVector& rVector,
if( bOptimize )
{
aFont.SetFontSize( Size( 0, GLYPH_FONT_HEIGHT ) );
- aVDev->SetMapMode( MAP_PIXEL );
+ aVDev->SetMapMode( MapUnit::MapPixel );
}
aVDev->SetFont( aFont );
aVDev->SetTextAlign( ALIGN_TOP );
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 9c9c7e439a16..e40d3b56cbae 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -510,7 +510,7 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect,
Size aBrdSize( 1, 1 );
if ( pDev->GetOutDevType() == OUTDEV_PRINTER )
{
- aBrdSize = pDev->LogicToPixel( Size( 20, 20 ), MapMode(MAP_100TH_MM) );
+ aBrdSize = pDev->LogicToPixel( Size( 20, 20 ), MapMode(MapUnit::Map100thMM) );
if ( !aBrdSize.Width() )
aBrdSize.Width() = 1;
if ( !aBrdSize.Height() )
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index f069b5583241..af27e481071d 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -377,7 +377,7 @@ void DockingWindow::ImplLoadRes( const ResId& rResId )
{
// use Sizes of the Resource
Point aPos;
- MapUnit ePosMap = MAP_PIXEL;
+ MapUnit ePosMap = MapUnit::MapPixel;
if ( RSC_DOCKINGWINDOW_XYMAPMODE & nMask )
ePosMap = (MapUnit)ReadLongRes();
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index a0167833edc4..f412db46a7cd 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -894,7 +894,7 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
{
rRenderContext.Push(PushFlags::LINECOLOR | PushFlags::MAPMODE);
rRenderContext.SetLineColor(Color(COL_WHITE));
- rRenderContext.SetMapMode(MapMode(MAP_PIXEL));
+ rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel));
Size aSize = GetSizePixel();
rRenderContext.DrawLine(Point(0, aSize.Height() - 1),
Point(aSize.Width() - 1, aSize.Height() - 1));
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 96054a2b37ae..af0896c69ece 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -123,7 +123,7 @@ PaintBufferGuard::~PaintBufferGuard()
{
// Make sure that the +1 value GetSize() adds to the size is in pixels.
Size aPaintRectSize;
- if (m_pWindow->GetMapMode().GetMapUnit() == MAP_PIXEL)
+ if (m_pWindow->GetMapMode().GetMapUnit() == MapUnit::MapPixel)
{
aPaintRectSize = m_aPaintRect.GetSize();
}
@@ -1338,8 +1338,8 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
bool bOutput = IsOutputEnabled();
EnableOutput();
- SAL_WARN_IF( GetMapMode().GetMapUnit() != MAP_PIXEL, "vcl", "MapMode must be PIXEL based" );
- if ( GetMapMode().GetMapUnit() != MAP_PIXEL )
+ SAL_WARN_IF( GetMapMode().GetMapUnit() != MapUnit::MapPixel, "vcl", "MapMode must be PIXEL based" );
+ if ( GetMapMode().GetMapUnit() != MapUnit::MapPixel )
return;
// preserve graphicsstate
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 19d292c68c1e..d0abe927796a 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -233,18 +233,18 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi
// use correct measurements
const LocaleDataWrapper& rLocWrap( GetSettings().GetLocaleDataWrapper() );
- MapUnit eUnit = MAP_MM;
+ MapUnit eUnit = MapUnit::MapMM;
int nDigits = 0;
if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US )
{
- eUnit = MAP_100TH_INCH;
+ eUnit = MapUnit::Map100thInch;
nDigits = 2;
}
- Size aLogicPaperSize( LogicToLogic( i_rOrigSize, MapMode( MAP_100TH_MM ), MapMode( eUnit ) ) );
+ Size aLogicPaperSize( LogicToLogic( i_rOrigSize, MapMode( MapUnit::Map100thMM ), MapMode( eUnit ) ) );
OUString aNumText( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) );
aBuf.append( aNumText )
.append( sal_Unicode( ' ' ) );
- aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+ aBuf.appendAscii( eUnit == MapUnit::MapMM ? "mm" : "in" );
if( !i_rPaperName.isEmpty() )
{
aBuf.append( " (" );
@@ -256,7 +256,7 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi
aNumText = rLocWrap.getNum( aLogicPaperSize.Height(), nDigits );
aBuf.append( aNumText )
.append( sal_Unicode( ' ' ) );
- aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+ aBuf.appendAscii( eUnit == MapUnit::MapMM ? "mm" : "in" );
maVertDim->SetText( aBuf.makeStringAndClear() );
Resize();
@@ -269,7 +269,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap()
GDIMetaFile aMtf( maMtf );
Size aVDevSize( maPageVDev->GetOutputSizePixel() );
- const Size aLogicSize( maPageVDev->PixelToLogic( aVDevSize, MapMode( MAP_100TH_MM ) ) );
+ const Size aLogicSize( maPageVDev->PixelToLogic( aVDevSize, MapMode( MapUnit::Map100thMM ) ) );
Size aOrigSize( maOrigSize );
if( aOrigSize.Width() < 1 )
aOrigSize.Width() = aLogicSize.Width();
@@ -279,7 +279,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap()
maPageVDev->Erase();
maPageVDev->Push();
- maPageVDev->SetMapMode( MAP_100TH_MM );
+ maPageVDev->SetMapMode( MapUnit::Map100thMM );
DrawModeFlags nOldDrawMode = maPageVDev->GetDrawMode();
if( mbGreyscale )
maPageVDev->SetDrawMode( maPageVDev->GetDrawMode() |
@@ -296,8 +296,8 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap()
maPageVDev->Pop();
- SetMapMode( MAP_PIXEL );
- maPageVDev->SetMapMode( MAP_PIXEL );
+ SetMapMode( MapUnit::MapPixel );
+ maPageVDev->SetMapMode( MapUnit::MapPixel );
maPreviewBitmap = Bitmap(maPageVDev->GetBitmap(Point(0, 0), aVDevSize));
@@ -327,7 +327,7 @@ void PrintDialog::ShowNupOrderWindow::Paint(vcl::RenderContext& rRenderContext,
{
Window::Paint(rRenderContext, i_rRect);
- rRenderContext.SetMapMode(MAP_PIXEL);
+ rRenderContext.SetMapMode(MapUnit::MapPixel);
rRenderContext.SetTextColor(rRenderContext.GetSettings().GetStyleSettings().GetFieldTextColor());
int nPages = mnRows * mnColumns;
@@ -653,7 +653,7 @@ PrintDialog::PrintDialog( vcl::Window* i_pParent, const std::shared_ptr<PrinterC
// setup sizes for N-Up
Size aNupSize( maPController->getPrinter()->PixelToLogic(
- maPController->getPrinter()->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
+ maPController->getPrinter()->GetPaperSizePixel(), MapMode( MapUnit::Map100thMM ) ) );
if( maPController->getPrinter()->GetOrientation() == Orientation::Landscape )
{
maNupLandscapeSize = aNupSize;
@@ -1328,7 +1328,7 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache )
if( i_bNewPage )
{
- const MapMode aMapMode( MAP_100TH_MM );
+ const MapMode aMapMode( MapUnit::Map100thMM );
GDIMetaFile aMtf;
VclPtr<Printer> aPrt( maPController->getPrinter() );
if( nPages > 0 )
@@ -1342,7 +1342,7 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache )
}
}
- Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) );
+ Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MapUnit::Map100thMM ) );
mpPreviewWindow->setPreview( aMtf, aCurPageSize,
aPrt->GetPaperName(),
nPages > 0 ? OUString() : maNoPageStr,
@@ -1916,7 +1916,7 @@ PrintProgressDialog::PrintProgressDialog(vcl::Window* i_pParent, int i_nMax)
mpText->set_width_request(mpText->get_preferred_size().Width());
//Pick a useful max width
- mpProgress->set_width_request(mpProgress->LogicToPixel(Size(100, 0), MapMode(MAP_APPFONT)).Width());
+ mpProgress->set_width_request(mpProgress->LogicToPixel(Size(100, 0), MapMode(MapUnit::MapAppFont)).Width());
mpButton->SetClickHdl( LINK( this, PrintProgressDialog, ClickHdl ) );
diff --git a/vcl/source/window/resource.cxx b/vcl/source/window/resource.cxx
index 12536be7b543..abc5eed43d08 100644
--- a/vcl/source/window/resource.cxx
+++ b/vcl/source/window/resource.cxx
@@ -85,7 +85,7 @@ void Window::ImplLoadRes( const ResId& rResId )
if ( nObjMask & (RscWindowFlags::XYMapMode | RscWindowFlags::X | RscWindowFlags::Y) )
{
// use size as per resource
- MapUnit ePosMap = MAP_PIXEL;
+ MapUnit ePosMap = MapUnit::MapPixel;
bPos = true;
@@ -100,7 +100,7 @@ void Window::ImplLoadRes( const ResId& rResId )
if ( nObjMask & (RscWindowFlags::WHMapMode | RscWindowFlags::Width | RscWindowFlags::Height) )
{
// use size as per resource
- MapUnit eSizeMap = MAP_PIXEL;
+ MapUnit eSizeMap = MapUnit::MapPixel;
bSize = true;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 2e1b9d527101..7086612e1f7e 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1044,7 +1044,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p
mpWindowImpl->mpFrameData->mnFirstMouseCode = 0;
mpWindowImpl->mpFrameData->mnMouseCode = 0;
mpWindowImpl->mpFrameData->mnMouseMode = MouseEventModifiers::NONE;
- mpWindowImpl->mpFrameData->meMapUnit = MAP_PIXEL;
+ mpWindowImpl->mpFrameData->meMapUnit = MapUnit::MapPixel;
mpWindowImpl->mpFrameData->mbHasFocus = false;
mpWindowImpl->mpFrameData->mbInMouseMove = false;
mpWindowImpl->mpFrameData->mbMouseIn = false;
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 1c71a6497a1d..b668704f6e4e 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -646,7 +646,7 @@ vcl::Font Window::GetDrawPixelFont(OutputDevice* pDev) const
{
vcl::Font aFont = GetPointFont(*const_cast<Window*>(this));
Size aFontSize = aFont.GetFontSize();
- MapMode aPtMapMode(MAP_POINT);
+ MapMode aPtMapMode(MapUnit::MapPoint);
aFontSize = pDev->LogicToPixel( aFontSize, aPtMapMode );
aFont.SetFontSize( aFontSize );
return aFont;
@@ -657,7 +657,7 @@ long Window::GetDrawPixel( OutputDevice* pDev, long nPixels ) const
long nP = nPixels;
if ( pDev->GetOutDevType() != OUTDEV_WINDOW )
{
- MapMode aMap( MAP_100TH_MM );
+ MapMode aMap( MapUnit::Map100thMM );
Size aSz( nP, 0 );
aSz = PixelToLogic( aSz, aMap );
aSz = pDev->LogicToPixel( aSz, aMap );
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index 17ca9cddae49..d0cedec3ed20 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -1103,7 +1103,7 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo
}
else
{
- xPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ xPrinter->SetMapMode( MapMode( MapUnit::Map100thMM ) );
xPrinter->SetPaperSizeUser( aPageSize.aSize, true );
PDFNewJobParameters aNewParm(xPrinter->GetPaperSize(), xPrinter->GetPaperBin());
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index 0d67499f8149..71a7fc84dd8e 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -230,7 +230,7 @@ void MyWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
WorkWindow::Paint(rRenderContext, rRect);
rRenderContext.Push();
- MapMode aMapMode(MAP_100TH_MM);
+ MapMode aMapMode(MapUnit::Map100thMM);
rRenderContext.SetMapMode(aMapMode);
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx
index c096f7011a8d..2c126928bc10 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -33,7 +33,7 @@ awt::Size lcl_getOptimalWidth(const StyleSheetTablePtr& pStyleSheet, OUString& r
if (rItem.getLength() > aLongest.getLength())
aLongest = rItem;
- MapMode aMap(MAP_100TH_MM);
+ MapMode aMap(MapUnit::Map100thMM);
OutputDevice* pOut = Application::GetDefaultDevice();
pOut->Push(PushFlags::FONT | PushFlags::MAPMODE);
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 92b9b96f8c86..01c0c0ce397f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -846,8 +846,8 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS
{
Graphic aGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic();
Size aSize(aGraphic.GetPrefSize());
- MapMode aMap(MAP_100TH_MM);
- if (aGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL)
+ MapMode aMap(MapUnit::Map100thMM);
+ if (aGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel)
aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMap);
else
aSize = OutputDevice::LogicToLogic(aSize, aGraphic.GetPrefMapMode(), aMap);
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index 499ad49f5063..f7ba620b7577 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -57,7 +57,7 @@ CertificateChooser::CertificateChooser(vcl::Window* _pParent, uno::Reference<uno
Size aControlSize(475, 122);
const long nControlWidth = aControlSize.Width();
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
SvSimpleTableContainer *pSignatures = get<SvSimpleTableContainer>("signatures");
pSignatures->set_width_request(aControlSize.Width());
pSignatures->set_height_request(aControlSize.Height());
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 9f42cd127970..df1b985e18e2 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -363,7 +363,7 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP( vcl::Window* _pParent,
maCertImage = get<FixedImage>("imgok")->GetImage();
maCertNotValidatedImage = get<FixedImage>("imgnotok")->GetImage();
- Size aControlSize(LogicToPixel(Size(251, 45), MAP_APPFONT));
+ Size aControlSize(LogicToPixel(Size(251, 45), MapUnit::MapAppFont));
mpCertPathLB->set_width_request(aControlSize.Width());
mpCertPathLB->set_height_request(aControlSize.Height());
mpCertStatusML->set_width_request(aControlSize.Width());
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index ca33f875b38b..0a74f2993c7a 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -131,7 +131,7 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
Size aControlSize(275, 109);
const long nControlWidth = aControlSize.Width();
- aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont);
SvSimpleTableContainer *pSignatures = get<SvSimpleTableContainer>("signatures");
pSignatures->set_width_request(aControlSize.Width());
pSignatures->set_height_request(aControlSize.Height());
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index b5771f4b3b78..62f67cbfd31e 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -357,7 +357,7 @@ public:
{
const long nControlWidth = GetSizePixel().Width();
long aTabLocs[] = { 3, 0, 35*nControlWidth/100, 70*nControlWidth/100 };
- SvSimpleTable::SetTabs(aTabLocs, MAP_PIXEL);
+ SvSimpleTable::SetTabs(aTabLocs, MapUnit::MapPixel);
}
}
};