tdf#123936 Formatting files in module vcl with clang-format

Change-Id: Ia162ad5b7499c0ddfdbfca59ae76b81335ce2d45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105728
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
This commit is contained in:
Philipp Hofer
2020-11-22 01:55:18 +01:00
committed by Christian Lohmaier
parent a65141b2b4
commit 58d98a08ae
119 changed files with 1363 additions and 1541 deletions
-118
View File
@@ -14853,17 +14853,12 @@ vcl/android/androidinst.cxx
vcl/backendtest/VisualBackendTest.cxx
vcl/backendtest/outputdevice/bitmap.cxx
vcl/backendtest/outputdevice/common.cxx
vcl/backendtest/outputdevice/gradient.cxx
vcl/backendtest/outputdevice/line.cxx
vcl/backendtest/outputdevice/outputdevice.cxx
vcl/backendtest/outputdevice/pixel.cxx
vcl/backendtest/outputdevice/polygon.cxx
vcl/backendtest/outputdevice/polyline.cxx
vcl/backendtest/outputdevice/polypolygon.cxx
vcl/backendtest/outputdevice/rectangle.cxx
vcl/headless/headlessinst.cxx
vcl/headless/svpbmp.cxx
vcl/headless/svpcairotextrender.cxx
vcl/headless/svpdata.cxx
vcl/headless/svpdummies.cxx
vcl/headless/svpframe.cxx
@@ -14872,11 +14867,6 @@ vcl/headless/svpinst.cxx
vcl/headless/svpprn.cxx
vcl/headless/svptext.cxx
vcl/headless/svpvd.cxx
vcl/inc/BitmapScaleConvolutionFilter.hxx
vcl/inc/BitmapScaleSuperFilter.hxx
vcl/inc/BitmapSymmetryCheck.hxx
vcl/inc/ControlCacheKey.hxx
vcl/inc/IconThemeScanner.hxx
vcl/inc/IconThemeSelector.hxx
vcl/inc/PhysicalFontCollection.hxx
vcl/inc/PhysicalFontFace.hxx
@@ -14885,7 +14875,6 @@ vcl/inc/ResampleKernel.hxx
vcl/inc/WidgetThemeLibraryTypes.hxx
vcl/inc/accel.h
vcl/inc/accmgr.hxx
vcl/inc/android/androidinst.hxx
vcl/inc/bmpfast.hxx
vcl/inc/brdwin.hxx
vcl/inc/calendar.hxx
@@ -14910,11 +14899,9 @@ vcl/inc/headless/svpdummies.hxx
vcl/inc/headless/svpframe.hxx
vcl/inc/headless/svpgdi.hxx
vcl/inc/headless/svpinst.hxx
vcl/inc/headless/svpprn.hxx
vcl/inc/headless/svpvd.hxx
vcl/inc/helpwin.hxx
vcl/inc/hyperlabel.hxx
vcl/inc/iconview.hxx
vcl/inc/image.h
vcl/inc/imagerepository.hxx
vcl/inc/impanmvw.hxx
@@ -14925,18 +14912,14 @@ vcl/inc/impfontcharmap.hxx
vcl/inc/impfontmetricdata.hxx
vcl/inc/impgraph.hxx
vcl/inc/implimagetree.hxx
vcl/inc/ios/iosinst.hxx
vcl/inc/jobdata.hxx
vcl/inc/jobset.h
vcl/inc/langboost.hxx
vcl/inc/listbox.hxx
vcl/inc/opengl/BufferObject.hxx
vcl/inc/opengl/FixedTextureAtlas.hxx
vcl/inc/opengl/LineRenderUtils.hxx
vcl/inc/opengl/PackedTextureAtlas.hxx
vcl/inc/opengl/RenderList.hxx
vcl/inc/opengl/RenderState.hxx
vcl/inc/opengl/TextureState.hxx
vcl/inc/opengl/VertexUtils.hxx
vcl/inc/opengl/framebuffer.hxx
vcl/inc/opengl/gdiimpl.hxx
@@ -14946,14 +14929,10 @@ vcl/inc/opengl/texture.hxx
vcl/inc/opengl/win/WinDeviceInfo.hxx
vcl/inc/opengl/win/gdiimpl.hxx
vcl/inc/opengl/x11/X11DeviceInfo.hxx
vcl/inc/opengl/x11/gdiimpl.hxx
vcl/inc/opengl/x11/salvd.hxx
vcl/inc/opengl/zone.hxx
vcl/inc/osx/a11yfactory.h
vcl/inc/osx/a11yfocustracker.hxx
vcl/inc/osx/a11ylistener.hxx
vcl/inc/osx/a11ywrapper.h
vcl/inc/osx/keyboardfocuslistener.hxx
vcl/inc/osx/printview.h
vcl/inc/osx/runinmain.hxx
vcl/inc/osx/saldata.hxx
@@ -14962,8 +14941,6 @@ vcl/inc/osx/salframeview.h
vcl/inc/osx/salinst.h
vcl/inc/osx/salmenu.h
vcl/inc/osx/salnativewidgets.h
vcl/inc/osx/salnsmenu.h
vcl/inc/osx/salnstimer.h
vcl/inc/osx/salobj.h
vcl/inc/osx/salprn.h
vcl/inc/osx/salsys.h
@@ -14976,14 +14953,12 @@ vcl/inc/print.h
vcl/inc/printdlg.hxx
vcl/inc/printerinfomanager.hxx
vcl/inc/quartz/common.h
vcl/inc/quartz/ctfonts.hxx
vcl/inc/quartz/salbmp.h
vcl/inc/quartz/salgdi.h
vcl/inc/quartz/salgdicommon.hxx
vcl/inc/quartz/salvd.h
vcl/inc/quartz/utils.h
vcl/inc/regband.hxx
vcl/inc/regionband.hxx
vcl/inc/salbmp.hxx
vcl/inc/saldatabasic.hxx
vcl/inc/salframe.hxx
@@ -14997,14 +14972,11 @@ vcl/inc/salobj.hxx
vcl/inc/salprn.hxx
vcl/inc/salptype.hxx
vcl/inc/salsession.hxx
vcl/inc/salsys.hxx
vcl/inc/saltimer.hxx
vcl/inc/salusereventlist.hxx
vcl/inc/salvd.hxx
vcl/inc/salwtype.hxx
vcl/inc/scanlinewriter.hxx
vcl/inc/schedulerimpl.hxx
vcl/inc/scrptrun.h
vcl/inc/scrwnd.hxx
vcl/inc/sft.hxx
vcl/inc/slider.hxx
@@ -15021,7 +14993,6 @@ vcl/inc/toolbox.h
vcl/inc/unx/cairotextrender.hxx
vcl/inc/unx/cpdmgr.hxx
vcl/inc/unx/cupsmgr.hxx
vcl/inc/unx/desktops.hxx
vcl/inc/unx/fc_fontoptions.hxx
vcl/inc/unx/fontmanager.hxx
vcl/inc/unx/freetype_glyphcache.hxx
@@ -15048,7 +15019,6 @@ vcl/inc/unx/helper.hxx
vcl/inc/unx/i18n_cb.hxx
vcl/inc/unx/i18n_ic.hxx
vcl/inc/unx/i18n_im.hxx
vcl/inc/unx/i18n_keysym.hxx
vcl/inc/unx/i18n_xkb.hxx
vcl/inc/unx/printergfx.hxx
vcl/inc/unx/printerjob.hxx
@@ -15061,13 +15031,10 @@ vcl/inc/unx/salinst.h
vcl/inc/unx/salobj.h
vcl/inc/unx/saltimer.h
vcl/inc/unx/saltype.h
vcl/inc/unx/salunx.h
vcl/inc/unx/salunxtime.h
vcl/inc/unx/salvd.h
vcl/inc/unx/screensaverinhibitor.hxx
vcl/inc/unx/sm.hxx
vcl/inc/unx/wmadaptor.hxx
vcl/inc/unx/x11/x11gdiimpl.h
vcl/inc/unx/x11/x11sys.hxx
vcl/inc/unx/x11/xlimits.hxx
vcl/inc/unx/x11/xrender_peer.hxx
@@ -15192,11 +15159,6 @@ vcl/inc/unx/x11_cursors/vertcurs_curs.h
vcl/inc/unx/x11_cursors/vertcurs_mask.h
vcl/inc/unx/x11_cursors/vshear_curs.h
vcl/inc/unx/x11_cursors/vshear_mask.h
vcl/inc/unx/x11_cursors/wshide_curs.h
vcl/inc/unx/x11_cursors/wshide_mask.h
vcl/inc/unx/x11_cursors/wsshow_curs.h
vcl/inc/unx/x11_cursors/wsshow_mask.h
vcl/inc/vcleventlisteners.hxx
vcl/inc/vclstatuslistener.hxx
vcl/inc/wall2.hxx
vcl/inc/win/DWriteTextRenderer.hxx
@@ -15218,7 +15180,6 @@ vcl/inc/wizdlg.hxx
vcl/ios/dummies.cxx
vcl/ios/iosinst.cxx
vcl/null/printerinfomanager.cxx
vcl/opengl/DeviceInfo.cxx
vcl/opengl/FixedTextureAtlas.cxx
vcl/opengl/LineRenderUtils.cxx
vcl/opengl/PackedTextureAtlas.cxx
@@ -15237,7 +15198,6 @@ vcl/opengl/x11/gdiimpl.cxx
vcl/opengl/x11/salvd.cxx
vcl/osx/DataFlavorMapping.cxx
vcl/osx/DataFlavorMapping.hxx
vcl/osx/DragActionConversion.cxx
vcl/osx/DragSource.cxx
vcl/osx/DragSource.hxx
vcl/osx/DragSourceContext.cxx
@@ -15248,35 +15208,11 @@ vcl/osx/HtmlFmtFlt.cxx
vcl/osx/OSXTransferable.cxx
vcl/osx/OSXTransferable.hxx
vcl/osx/PictToBmpFlt.cxx
vcl/osx/PictToBmpFlt.hxx
vcl/osx/a11yactionwrapper.h
vcl/osx/a11ycomponentwrapper.h
vcl/osx/a11yfocuslistener.cxx
vcl/osx/a11yfocuslistener.hxx
vcl/osx/a11yfocustracker.cxx
vcl/osx/a11ylistener.cxx
vcl/osx/a11yrolehelper.h
vcl/osx/a11yselectionwrapper.h
vcl/osx/a11ytablewrapper.h
vcl/osx/a11ytextattributeswrapper.h
vcl/osx/a11ytextwrapper.h
vcl/osx/a11yutil.h
vcl/osx/a11yvaluewrapper.h
vcl/osx/a11ywrapperbutton.h
vcl/osx/a11ywrappercheckbox.h
vcl/osx/a11ywrappercombobox.h
vcl/osx/a11ywrappergroup.h
vcl/osx/a11ywrapperlist.h
vcl/osx/a11ywrapperradiobutton.h
vcl/osx/a11ywrapperradiogroup.h
vcl/osx/a11ywrapperrow.h
vcl/osx/a11ywrapperscrollarea.h
vcl/osx/a11ywrapperscrollbar.h
vcl/osx/a11ywrappersplitter.h
vcl/osx/a11ywrapperstatictext.h
vcl/osx/a11ywrappertabgroup.h
vcl/osx/a11ywrappertextarea.h
vcl/osx/a11ywrappertoolbar.h
vcl/osx/clipboard.cxx
vcl/osx/clipboard.hxx
vcl/osx/cuidraw.hxx
@@ -15292,7 +15228,6 @@ vcl/osx/salprn.cxx
vcl/osx/salsys.cxx
vcl/osx/saltimer.cxx
vcl/osx/service_entry.cxx
vcl/qa/cppunit/BitmapProcessorTest.cxx
vcl/qa/cppunit/app/test_IconThemeInfo.cxx
vcl/qa/cppunit/app/test_IconThemeScanner.cxx
vcl/qa/cppunit/app/test_IconThemeSelector.cxx
@@ -15302,17 +15237,11 @@ vcl/qa/cppunit/complextext.cxx
vcl/qa/cppunit/dndtest.cxx
vcl/qa/cppunit/errorhandler.cxx
vcl/qa/cppunit/font.cxx
vcl/qa/cppunit/fontcharmap.cxx
vcl/qa/cppunit/fontmetric.cxx
vcl/qa/cppunit/graphicfilter/filters-test.cxx
vcl/qa/cppunit/jpeg/JpegReaderTest.cxx
vcl/qa/cppunit/lifecycle.cxx
vcl/qa/cppunit/mnemonic.cxx
vcl/qa/cppunit/outdev.cxx
vcl/qa/cppunit/pdfexport/pdfexport.cxx
vcl/qa/cppunit/svm/svmtest.cxx
vcl/qa/cppunit/timer.cxx
vcl/qa/unit/vcl-dialogs-test.cxx
vcl/quartz/ctfonts.cxx
vcl/quartz/salbmp.cxx
vcl/quartz/salgdi.cxx
@@ -15320,7 +15249,6 @@ vcl/quartz/salgdicommon.cxx
vcl/quartz/salgdiutils.cxx
vcl/quartz/salvd.cxx
vcl/quartz/utils.cxx
vcl/source/app/ITiledRenderable.cxx
vcl/source/app/IconThemeInfo.cxx
vcl/source/app/IconThemeScanner.cxx
vcl/source/app/IconThemeSelector.cxx
@@ -15332,11 +15260,9 @@ vcl/source/app/i18nhelp.cxx
vcl/source/app/idle.cxx
vcl/source/app/salplug.cxx
vcl/source/app/salusereventlist.cxx
vcl/source/app/salvtables.cxx
vcl/source/app/scheduler.cxx
vcl/source/app/session.cxx
vcl/source/app/settings.cxx
vcl/source/app/sound.cxx
vcl/source/app/stdtext.cxx
vcl/source/app/svapp.cxx
vcl/source/app/svdata.cxx
@@ -15350,7 +15276,6 @@ vcl/source/bitmap/BitmapScaleSuperFilter.cxx
vcl/source/bitmap/BitmapSymmetryCheck.cxx
vcl/source/bitmap/BitmapTools.cxx
vcl/source/bitmap/bitmap.cxx
vcl/source/bitmap/bitmapfilter.cxx
vcl/source/bitmap/checksum.cxx
vcl/source/bitmap/salbmp.cxx
vcl/source/cnttype/mcnttfactory.cxx
@@ -15391,7 +15316,6 @@ vcl/source/control/spinbtn.cxx
vcl/source/control/spinfld.cxx
vcl/source/control/tabctrl.cxx
vcl/source/control/throbber.cxx
vcl/source/control/thumbpos.hxx
vcl/source/control/wizardmachine.cxx
vcl/source/control/wizimpldata.hxx
vcl/source/edit/textdat2.hxx
@@ -15411,25 +15335,19 @@ vcl/source/filter/FilterConfigCache.hxx
vcl/source/filter/FilterConfigItem.cxx
vcl/source/filter/graphicfilter.cxx
vcl/source/filter/graphicfilter2.cxx
vcl/source/filter/graphicfilter_internal.hxx
vcl/source/filter/igif/decode.cxx
vcl/source/filter/igif/decode.hxx
vcl/source/filter/igif/gifread.cxx
vcl/source/filter/igif/gifread.hxx
vcl/source/filter/ixbm/xbmread.cxx
vcl/source/filter/ixbm/xbmread.hxx
vcl/source/filter/ixpm/rgbtable.hxx
vcl/source/filter/ixpm/xpmread.cxx
vcl/source/filter/ixpm/xpmread.hxx
vcl/source/filter/jpeg/Exif.cxx
vcl/source/filter/jpeg/Exif.hxx
vcl/source/filter/jpeg/JpegReader.cxx
vcl/source/filter/jpeg/JpegReader.hxx
vcl/source/filter/jpeg/JpegTransform.cxx
vcl/source/filter/jpeg/JpegTransform.hxx
vcl/source/filter/jpeg/JpegWriter.cxx
vcl/source/filter/jpeg/JpegWriter.hxx
vcl/source/filter/jpeg/jinclude.h
vcl/source/filter/jpeg/jpeg.cxx
vcl/source/filter/jpeg/jpeg.h
vcl/source/filter/jpeg/jpeg.hxx
@@ -15437,11 +15355,9 @@ vcl/source/filter/jpeg/jpegc.cxx
vcl/source/filter/jpeg/transupp.c
vcl/source/filter/jpeg/transupp.h
vcl/source/filter/png/pngread.cxx
vcl/source/filter/png/pngwrite.cxx
vcl/source/filter/wmf/emfwr.cxx
vcl/source/filter/wmf/emfwr.hxx
vcl/source/filter/wmf/wmf.cxx
vcl/source/filter/wmf/wmfexternal.cxx
vcl/source/filter/wmf/wmfwr.cxx
vcl/source/filter/wmf/wmfwr.hxx
vcl/source/font/PhysicalFontCollection.cxx
@@ -15462,7 +15378,6 @@ vcl/source/fontsubset/sft.cxx
vcl/source/fontsubset/ttcr.cxx
vcl/source/fontsubset/ttcr.hxx
vcl/source/fontsubset/xlat.cxx
vcl/source/fontsubset/xlat.hxx
vcl/source/gdi/CommonSalLayout.cxx
vcl/source/gdi/VerticalOrientationData.cxx
vcl/source/gdi/alpha.cxx
@@ -15470,13 +15385,11 @@ vcl/source/gdi/bitmap3.cxx
vcl/source/gdi/bitmapex.cxx
vcl/source/gdi/bmpacc.cxx
vcl/source/gdi/bmpacc2.cxx
vcl/source/gdi/bmpacc3.cxx
vcl/source/gdi/bmpfast.cxx
vcl/source/gdi/configsettings.cxx
vcl/source/gdi/cvtgrf.cxx
vcl/source/gdi/dibtools.cxx
vcl/source/gdi/embeddedfontshelper.cxx
vcl/source/gdi/extoutdevdata.cxx
vcl/source/gdi/gdimetafiletools.cxx
vcl/source/gdi/gdimtf.cxx
vcl/source/gdi/gfxlink.cxx
@@ -15507,7 +15420,6 @@ vcl/source/gdi/print3.cxx
vcl/source/gdi/regband.cxx
vcl/source/gdi/region.cxx
vcl/source/gdi/regionband.cxx
vcl/source/gdi/salgdiimpl.cxx
vcl/source/gdi/salgdilayout.cxx
vcl/source/gdi/sallayout.cxx
vcl/source/gdi/salmisc.cxx
@@ -15530,10 +15442,8 @@ vcl/source/helper/canvastools.cxx
vcl/source/helper/commandinfoprovider.cxx
vcl/source/helper/displayconnectiondispatch.cxx
vcl/source/helper/evntpost.cxx
vcl/source/helper/lazydelete.cxx
vcl/source/helper/strhelper.cxx
vcl/source/helper/svtaccessiblefactory.cxx
vcl/source/helper/threadex.cxx
vcl/source/image/Image.cxx
vcl/source/image/ImageRepository.cxx
vcl/source/image/ImageTree.cxx
@@ -15562,16 +15472,12 @@ vcl/source/outdev/textline.cxx
vcl/source/outdev/transparent.cxx
vcl/source/outdev/vclreferencebase.cxx
vcl/source/outdev/wallpaper.cxx
vcl/source/salmain/salmain.cxx
vcl/source/toolkit/group.cxx
vcl/source/toolkit/morebtn.cxx
vcl/source/treelist/headbar.cxx
vcl/source/treelist/iconview.cxx
vcl/source/treelist/iconviewimpl.cxx
vcl/source/treelist/iconviewimpl.hxx
vcl/source/treelist/imap.cxx
vcl/source/treelist/imap2.cxx
vcl/source/treelist/imap3.cxx
vcl/source/treelist/inetimg.cxx
vcl/source/treelist/svimpbox.cxx
vcl/source/treelist/svlbitm.cxx
@@ -15584,14 +15490,12 @@ vcl/source/treelist/treelistentry.cxx
vcl/source/treelist/uiobject.cxx
vcl/source/treelist/viewdataentry.cxx
vcl/source/uipreviewer/previewer.cxx
vcl/source/uitest/logger.cxx
vcl/source/uitest/uiobject.cxx
vcl/source/uitest/uitest.cxx
vcl/source/uitest/uno/uiobject_uno.cxx
vcl/source/uitest/uno/uiobject_uno.hxx
vcl/source/uitest/uno/uitest_uno.cxx
vcl/source/window/EnumContext.cxx
vcl/source/window/abstdlg.cxx
vcl/source/window/accel.cxx
vcl/source/window/accessibility.cxx
vcl/source/window/accmgr.cxx
@@ -15600,7 +15504,6 @@ vcl/source/window/builder.cxx
vcl/source/window/clipping.cxx
vcl/source/window/commandevent.cxx
vcl/source/window/cursor.cxx
vcl/source/window/debug.cxx
vcl/source/window/debugevent.cxx
vcl/source/window/decoview.cxx
vcl/source/window/dialog.cxx
@@ -15615,7 +15518,6 @@ vcl/source/window/errinf.cxx
vcl/source/window/event.cxx
vcl/source/window/floatwin.cxx
vcl/source/window/globalization.cxx
vcl/source/window/introwin.cxx
vcl/source/window/keycod.cxx
vcl/source/window/keyevent.cxx
vcl/source/window/layout.cxx
@@ -15649,7 +15551,6 @@ vcl/source/window/toolbox.cxx
vcl/source/window/toolbox2.cxx
vcl/source/window/window.cxx
vcl/source/window/window2.cxx
vcl/source/window/window3.cxx
vcl/source/window/winproc.cxx
vcl/source/window/wrkwin.cxx
vcl/unx/generic/app/gendisp.cxx
@@ -15701,7 +15602,6 @@ vcl/unx/generic/gdi/font.cxx
vcl/unx/generic/gdi/freetypetextrender.cxx
vcl/unx/generic/gdi/gdiimpl.cxx
vcl/unx/generic/gdi/gdiimpl.hxx
vcl/unx/generic/gdi/nativewindowhandleprovider.cxx
vcl/unx/generic/gdi/salbmp.cxx
vcl/unx/generic/gdi/salgdi.cxx
vcl/unx/generic/gdi/salgdi2.cxx
@@ -15718,7 +15618,6 @@ vcl/unx/generic/print/glyphset.cxx
vcl/unx/generic/print/glyphset.hxx
vcl/unx/generic/print/printerjob.cxx
vcl/unx/generic/print/prtsetup.cxx
vcl/unx/generic/print/prtsetup.hxx
vcl/unx/generic/print/psputil.cxx
vcl/unx/generic/print/psputil.hxx
vcl/unx/generic/print/text_gfx.cxx
@@ -15732,11 +15631,8 @@ vcl/unx/generic/window/salobj.cxx
vcl/unx/generic/window/screensaverinhibitor.cxx
vcl/unx/glxtest.cxx
vcl/unx/gtk3/a11y/atklistener.hxx
vcl/unx/gtk3/a11y/atkregistry.hxx
vcl/unx/gtk3/a11y/atktextattributes.hxx
vcl/unx/gtk3/a11y/atkwrapper.hxx
vcl/unx/gtk3/a11y/gtk3atkaction.cxx
vcl/unx/gtk3/a11y/gtk3atkbridge.cxx
vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx
vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx
vcl/unx/gtk3/a11y/gtk3atkfactory.cxx
@@ -15759,7 +15655,6 @@ vcl/unx/gtk3/fpicker/SalGtkFolderPicker.cxx
vcl/unx/gtk3/fpicker/SalGtkFolderPicker.hxx
vcl/unx/gtk3/fpicker/SalGtkPicker.cxx
vcl/unx/gtk3/fpicker/SalGtkPicker.hxx
vcl/unx/gtk3/fpicker/eventnotification.hxx
vcl/unx/gtk3/fpicker/resourceprovider.cxx
vcl/unx/gtk3/gtk3gloactiongroup.cxx
vcl/unx/gtk3/gtk3glomenu.cxx
@@ -15788,7 +15683,6 @@ vcl/win/dtrans/DataFmtTransl.cxx
vcl/win/dtrans/DataFmtTransl.hxx
vcl/win/dtrans/DOTransferable.cxx
vcl/win/dtrans/DOTransferable.hxx
vcl/win/dtrans/DtObjFactory.cxx
vcl/win/dtrans/DtObjFactory.hxx
vcl/win/dtrans/DTransHelper.cxx
vcl/win/dtrans/DTransHelper.hxx
@@ -15797,30 +15691,20 @@ vcl/win/dtrans/Fetc.hxx
vcl/win/dtrans/FetcList.cxx
vcl/win/dtrans/FetcList.hxx
vcl/win/dtrans/FmtFilter.cxx
vcl/win/dtrans/FmtFilter.hxx
vcl/win/dtrans/ftransl.cxx
vcl/win/dtrans/ftransl.hxx
vcl/win/dtrans/generic_clipboard.cxx
vcl/win/dtrans/generic_clipboard.hxx
vcl/win/dtrans/globals.cxx
vcl/win/dtrans/globals.hxx
vcl/win/dtrans/idroptarget.cxx
vcl/win/dtrans/idroptarget.hxx
vcl/win/dtrans/ImplHelper.cxx
vcl/win/dtrans/ImplHelper.hxx
vcl/win/dtrans/MimeAttrib.hxx
vcl/win/dtrans/MtaOleClipb.cxx
vcl/win/dtrans/MtaOleClipb.hxx
vcl/win/dtrans/sourcecontext.cxx
vcl/win/dtrans/sourcecontext.hxx
vcl/win/dtrans/source.cxx
vcl/win/dtrans/source.hxx
vcl/win/dtrans/target.cxx
vcl/win/dtrans/targetdragcontext.cxx
vcl/win/dtrans/targetdragcontext.hxx
vcl/win/dtrans/targetdropcontext.cxx
vcl/win/dtrans/targetdropcontext.hxx
vcl/win/dtrans/target.hxx
vcl/win/dtrans/TxtCnvtHlp.cxx
vcl/win/dtrans/TxtCnvtHlp.hxx
vcl/win/dtrans/XNotifyingDataObject.cxx
@@ -15838,7 +15722,6 @@ vcl/win/gdi/salgdi_gdiplus.cxx
vcl/win/gdi/salnativewidgets-luna.cxx
vcl/win/gdi/salprn.cxx
vcl/win/gdi/salvd.cxx
vcl/win/gdi/winlayout.cxx
vcl/win/window/keynames.cxx
vcl/win/window/salframe.cxx
vcl/win/window/salmenu.cxx
@@ -15879,7 +15762,6 @@ vcl/workben/localestub/localedata_en_TT.cxx
vcl/workben/localestub/localedata_en_US.cxx
vcl/workben/localestub/localedata_en_ZA.cxx
vcl/workben/localestub/localedata_en_ZW.cxx
vcl/workben/localestub/localestub.cxx
vcl/workben/lwpfuzzer.cxx
vcl/workben/metfuzzer.cxx
vcl/workben/mtfdemo.cxx
+18 -18
View File
@@ -11,16 +11,16 @@
#include <test/outputdevice.hxx>
#include <vcl/gradient.hxx>
namespace vcl::test {
namespace vcl::test
{
Bitmap OutputDeviceTestGradient::setupLinearGradient()
{
initialSetup(12, 12, constBackgroundColor);
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetAngle(Degree10(900));
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -32,8 +32,8 @@ Bitmap OutputDeviceTestGradient::setupLinearGradientAngled()
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetAngle(Degree10(450));
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -45,8 +45,8 @@ Bitmap OutputDeviceTestGradient::setupLinearGradientBorder()
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetBorder(50);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -58,8 +58,8 @@ Bitmap OutputDeviceTestGradient::setupLinearGradientIntensity()
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetStartIntensity(50);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -72,8 +72,8 @@ Bitmap OutputDeviceTestGradient::setupLinearGradientSteps()
Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetAngle(Degree10(900));
aGradient.SetSteps(4);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -85,8 +85,8 @@ Bitmap OutputDeviceTestGradient::setupAxialGradient()
Gradient aGradient(GradientStyle::Axial, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetAngle(Degree10(900));
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -97,8 +97,8 @@ Bitmap OutputDeviceTestGradient::setupRadialGradient()
initialSetup(12, 12, constBackgroundColor);
Gradient aGradient(GradientStyle::Radial, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
@@ -111,8 +111,8 @@ Bitmap OutputDeviceTestGradient::setupRadialGradientOfs()
Gradient aGradient(GradientStyle::Radial, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
aGradient.SetOfsX(100); // Move center to the bottom-right corner.
aGradient.SetOfsY(100);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
+3 -4
View File
@@ -10,12 +10,11 @@
#include <test/outputdevice.hxx>
namespace vcl::test {
namespace vcl::test
{
namespace
{
void drawPixelOffset(OutputDevice& rDevice, tools::Rectangle const & rRect, int nOffset)
void drawPixelOffset(OutputDevice& rDevice, tools::Rectangle const& rRect, int nOffset)
{
for (tools::Long x = 0 + nOffset; x < (rRect.GetWidth() - nOffset); ++x)
{
+7 -9
View File
@@ -10,23 +10,21 @@
#include <test/outputdevice.hxx>
namespace vcl::test {
namespace vcl::test
{
namespace
{
tools::Polygon createPolygonOffset(tools::Rectangle const & rRect, int nOffset, int nFix = 0)
tools::Polygon createPolygonOffset(tools::Rectangle const& rRect, int nOffset, int nFix = 0)
{
// Note: According to https://lists.freedesktop.org/archives/libreoffice/2019-November/083709.html
// filling polygons always skips the right-most and bottom-most pixels, in order to avoid
// overlaps when drawing adjacent polygons. Specifying nFix = 1 allows to visually compensate
// for this by making the polygon explicitly larger.
tools::Polygon aPolygon(4);
aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Top() + nOffset), 0);
aPolygon.SetPoint(Point(rRect.Right() - nOffset + nFix, rRect.Top() + nOffset), 1);
aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Top() + nOffset), 0);
aPolygon.SetPoint(Point(rRect.Right() - nOffset + nFix, rRect.Top() + nOffset), 1);
aPolygon.SetPoint(Point(rRect.Right() - nOffset + nFix, rRect.Bottom() - nOffset + nFix), 2);
aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Bottom() - nOffset + nFix), 3);
aPolygon.SetPoint(Point(rRect.Left() + nOffset, rRect.Bottom() - nOffset + nFix), 3);
aPolygon.Optimize(PolyOptimizeFlags::CLOSE);
return aPolygon;
}
@@ -53,7 +51,7 @@ Bitmap OutputDeviceTestPolyPolygon::setupFilledRectangle(bool useLineColor)
{
initialSetup(13, 13, constBackgroundColor);
if(useLineColor)
if (useLineColor)
mpVirtualDevice->SetLineColor(constLineColor);
else
mpVirtualDevice->SetLineColor();
+15 -15
View File
@@ -10,23 +10,23 @@
#include <test/outputdevice.hxx>
namespace vcl::test {
namespace vcl::test
{
namespace
{
void drawRectOffset(OutputDevice& rDevice, tools::Rectangle const & rRect, int nOffset)
{
rDevice.DrawRect(tools::Rectangle(rRect.Left() + nOffset, rRect.Top() + nOffset,
rRect.Right() - nOffset, rRect.Bottom() - nOffset));
void drawRectOffset(OutputDevice& rDevice, tools::Rectangle const& rRect, int nOffset)
{
rDevice.DrawRect(tools::Rectangle(rRect.Left() + nOffset, rRect.Top() + nOffset,
rRect.Right() - nOffset, rRect.Bottom() - nOffset));
}
}
void drawInvertOffset(OutputDevice& rDevice, tools::Rectangle const & rRect, int nOffset, InvertFlags eFlags)
{
tools::Rectangle aRectangle(rRect.Left() + nOffset, rRect.Top() + nOffset,
rRect.Right() - nOffset, rRect.Bottom() - nOffset);
rDevice.Invert(aRectangle, eFlags);
}
void drawInvertOffset(OutputDevice& rDevice, tools::Rectangle const& rRect, int nOffset,
InvertFlags eFlags)
{
tools::Rectangle aRectangle(rRect.Left() + nOffset, rRect.Top() + nOffset,
rRect.Right() - nOffset, rRect.Bottom() - nOffset);
rDevice.Invert(aRectangle, eFlags);
}
} // end anonymous namespace
@@ -34,7 +34,7 @@ Bitmap OutputDeviceTestRect::setupFilledRectangle(bool useLineColor)
{
initialSetup(13, 13, constBackgroundColor);
if(useLineColor)
if (useLineColor)
mpVirtualDevice->SetLineColor(constLineColor);
else
mpVirtualDevice->SetLineColor();
+2 -8
View File
@@ -16,10 +16,7 @@ SvpCairoTextRender::SvpCairoTextRender(SvpSalGraphics& rParent)
{
}
cairo_t* SvpCairoTextRender::getCairoContext()
{
return mrParent.getCairoContext(false);
}
cairo_t* SvpCairoTextRender::getCairoContext() { return mrParent.getCairoContext(false); }
void SvpCairoTextRender::getSurfaceOffset(double& nDX, double& nDY)
{
@@ -27,10 +24,7 @@ void SvpCairoTextRender::getSurfaceOffset(double& nDX, double& nDY)
nDY = 0;
}
void SvpCairoTextRender::clipRegion(cairo_t* cr)
{
mrParent.clipRegion(cr);
}
void SvpCairoTextRender::clipRegion(cairo_t* cr) { mrParent.clipRegion(cr); }
void SvpCairoTextRender::releaseCairoContext(cairo_t* cr)
{
+3 -3
View File
@@ -29,7 +29,8 @@ namespace vcl
class BitmapScaleConvolutionFilter : public BitmapFilter
{
protected:
BitmapScaleConvolutionFilter(const double& rScaleX, const double& rScaleY, std::unique_ptr<Kernel> pKernel)
BitmapScaleConvolutionFilter(const double& rScaleX, const double& rScaleY,
std::unique_ptr<Kernel> pKernel)
: mxKernel(std::move(pKernel))
, mrScaleX(rScaleX)
, mrScaleY(rScaleY)
@@ -57,7 +58,7 @@ class VCL_DLLPUBLIC BitmapScaleBicubicFilter final : public BitmapScaleConvoluti
{
public:
BitmapScaleBicubicFilter(const double& rScaleX, const double& rScaleY)
: BitmapScaleConvolutionFilter(rScaleX, rScaleY, std::make_unique<BicubicKernel>())
: BitmapScaleConvolutionFilter(rScaleX, rScaleY, std::make_unique<BicubicKernel>())
{
}
};
@@ -70,7 +71,6 @@ public:
{
}
};
}
#endif // VCL_INC_BITMAPSCALECONVOLUTIONFILTER_HXX
-1
View File
@@ -33,7 +33,6 @@ public:
private:
double mrScaleX;
double mrScaleY;
};
#endif
+1 -1
View File
@@ -23,7 +23,7 @@ public:
static bool check(Bitmap& rBitmap);
private:
static bool checkImpl(BitmapReadAccess const * pReadAccess);
static bool checkImpl(BitmapReadAccess const* pReadAccess);
};
#endif // INCLUDED_VCL_INC_BITMAPSYMMETRYCHECK_HXX
+6 -7
View File
@@ -37,20 +37,19 @@ public:
, mnPart(nPart)
, mnState(nState)
, maSize(rSize)
{}
{
}
bool operator==(ControlCacheKey const& aOther) const
{
return mnType == aOther.mnType
&& mnPart == aOther.mnPart
&& mnState == aOther.mnState
&& maSize.Width() == aOther.maSize.Width()
&& maSize.Height() == aOther.maSize.Height();
return mnType == aOther.mnType && mnPart == aOther.mnPart && mnState == aOther.mnState
&& maSize.Width() == aOther.maSize.Width()
&& maSize.Height() == aOther.maSize.Height();
}
bool canCacheControl() const
{
switch(mnType)
switch (mnType)
{
case ControlType::Checkbox:
case ControlType::Radiobutton:
+10 -16
View File
@@ -21,8 +21,8 @@
// forward declaration of unit test class. Required for friend relationship.
class IconThemeScannerTest;
namespace vcl {
namespace vcl
{
/** This class scans a folder for icon themes and provides the results.
*/
class VCL_DLLPUBLIC IconThemeScanner
@@ -31,15 +31,13 @@ public:
/** Factory method to create the object.
* Provide a path to search for IconThemes.
*/
static std::shared_ptr<IconThemeScanner> Create(const OUString &path);
static std::shared_ptr<IconThemeScanner> Create(const OUString& path);
/** This method will return the standard path where icon themes are located.
*/
static OUString
GetStandardIconThemePath();
static OUString GetStandardIconThemePath();
const std::vector<IconThemeInfo>&
GetFoundIconThemes() const {return mFoundIconThemes;}
const std::vector<IconThemeInfo>& GetFoundIconThemes() const { return mFoundIconThemes; }
/** Get the IconThemeInfo for a theme.
* If the theme id is not among the found themes, a std::runtime_error will be thrown.
@@ -50,8 +48,7 @@ public:
/** Checks whether the theme with the provided name has been found in the
* scanned directory.
*/
bool
IconThemeIsInstalled(const OUString& themeId) const;
bool IconThemeIsInstalled(const OUString& themeId) const;
private:
IconThemeScanner();
@@ -63,22 +60,19 @@ private:
* - The directory does not exist
* - There are no files which match the pattern images_xxx.zip
*/
void ScanDirectoryForIconThemes(const OUString &path);
void ScanDirectoryForIconThemes(const OUString& path);
/** Adds the provided icon theme by path.
*/
bool
AddIconThemeByPath(const OUString &path);
bool AddIconThemeByPath(const OUString& path);
/** Scans the provided directory for icon themes.
* The returned strings will contain the URLs to the icon themes.
*/
static std::vector<OUString>
ReadIconThemesFromPath(const OUString& dir);
static std::vector<OUString> ReadIconThemesFromPath(const OUString& dir);
/** Check whether a single file is valid */
static bool
FileIsValidIconTheme(const OUString&);
static bool FileIsValidIconTheme(const OUString&);
std::vector<IconThemeInfo> mFoundIconThemes;
+7 -7
View File
@@ -22,22 +22,22 @@ class AndroidSalInstance : public SvpSalInstance
// This JNIEnv is valid only in the thread where this
// AndroidSalInstance object is created, which is the "LO" thread
// in which soffice_main() runs
JNIEnv *m_pJNIEnv;
JNIEnv* m_pJNIEnv;
public:
AndroidSalInstance( std::unique_ptr<SalYieldMutex> pMutex );
AndroidSalInstance(std::unique_ptr<SalYieldMutex> pMutex);
virtual ~AndroidSalInstance();
static AndroidSalInstance *getInstance();
static AndroidSalInstance* getInstance();
virtual SalSystem* CreateSalSystem();
// frame management
void GetWorkArea( tools::Rectangle& rRect );
SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle );
SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle );
void GetWorkArea(tools::Rectangle& rRect);
SalFrame* CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle);
SalFrame* CreateChildFrame(SystemParentData* pParent, SalFrameStyleFlags nStyle);
// mainloop pieces
virtual bool AnyInput( VclInputFlags nType );
virtual bool AnyInput(VclInputFlags nType);
virtual void updateMainThread();
virtual void releaseMainThread();
+2 -2
View File
@@ -25,13 +25,13 @@
class SvpSalInfoPrinter final : public PspSalInfoPrinter
{
public:
virtual bool Setup( weld::Window* pFrame, ImplJobSetup* pSetupData ) override;
virtual bool Setup(weld::Window* pFrame, ImplJobSetup* pSetupData) override;
};
class SvpSalPrinter final : public PspSalPrinter
{
public:
SvpSalPrinter( SalInfoPrinter* pInfoPrinter );
SvpSalPrinter(SalInfoPrinter* pInfoPrinter);
};
#endif // INCLUDED_VCL_INC_HEADLESS_SVPPRN_HXX
+3 -2
View File
@@ -25,13 +25,14 @@
class IconView final : public SvTreeListBox
{
public:
IconView( vcl::Window* pParent, WinBits nBits );
IconView(vcl::Window* pParent, WinBits nBits);
virtual void Resize() override;
virtual tools::Rectangle GetFocusRect(const SvTreeListEntry*, tools::Long nEntryPos) override;
void PaintEntry( SvTreeListEntry&, tools::Long nX, tools::Long nY, vcl::RenderContext& rRenderContext);
void PaintEntry(SvTreeListEntry&, tools::Long nX, tools::Long nY,
vcl::RenderContext& rRenderContext);
};
#endif
+7 -6
View File
@@ -33,17 +33,18 @@ class IosSalFrame;
class IosSalInstance : public SvpSalInstance
{
public:
IosSalInstance( std::unique_ptr<SalYieldMutex> pMutex );
IosSalInstance(std::unique_ptr<SalYieldMutex> pMutex);
virtual ~IosSalInstance();
static IosSalInstance *getInstance();
static IosSalInstance* getInstance();
SalSystem* CreateSalSystem() override;
css::uno::Reference< css::uno::XInterface > CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments ) override;
css::uno::Reference<css::uno::XInterface>
CreateClipboard(const css::uno::Sequence<css::uno::Any>& i_rArguments) override;
void GetWorkArea( tools::Rectangle& rRect );
SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override;
SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override;
void GetWorkArea(tools::Rectangle& rRect);
SalFrame* CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle) override;
SalFrame* CreateChildFrame(SystemParentData* pParent, SalFrameStyleFlags nStyle) override;
};
#endif // INCLUDED_VCL_INC_IOS_IOSINST_HXX
+1 -1
View File
@@ -11,7 +11,7 @@
namespace vcl
{
const char* getLangBoost();
const char* getLangBoost();
}
#endif
+2 -6
View File
@@ -13,9 +13,7 @@
namespace vcl
{
template<typename TYPE, GLenum BUFFER_TYPE>
class BufferObject
template <typename TYPE, GLenum BUFFER_TYPE> class BufferObject
{
private:
GLuint mId;
@@ -65,11 +63,9 @@ public:
CHECK_GL_ERROR();
}
}
};
template<typename TYPE>
class VertexBufferObject final : public BufferObject<TYPE, GL_ARRAY_BUFFER>
template <typename TYPE> class VertexBufferObject final : public BufferObject<TYPE, GL_ARRAY_BUFFER>
{
};
+2 -5
View File
@@ -23,7 +23,8 @@ public:
TextureState()
: mnCurrentTextureUnit(0)
, maBoundTextures(4, 0)
{}
{
}
static void generate(GLuint& nTexture)
{
@@ -39,7 +40,6 @@ public:
CHECK_GL_ERROR();
mnCurrentTextureUnit = nTextureUnit;
}
}
void bind(GLuint nTexture)
@@ -66,11 +66,8 @@ public:
maBoundTextures[i] = 0;
}
}
};
#endif // INCLUDED_VCL_INC_OPENGL_TEXTURE_STATE_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+3 -3
View File
@@ -22,17 +22,17 @@ struct TextureCombo;
class X11OpenGLSalGraphicsImpl : public OpenGLSalGraphicsImpl, public X11GraphicsImpl
{
private:
X11SalGraphics& mrX11Parent;
X11SalGraphics& mrX11Parent;
public:
X11OpenGLSalGraphicsImpl( X11SalGraphics& rParent );
X11OpenGLSalGraphicsImpl(X11SalGraphics& rParent);
virtual ~X11OpenGLSalGraphicsImpl() override;
protected:
virtual rtl::Reference<OpenGLContext> CreateWinContext() override;
public:
virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) override;
virtual void copyBits(const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics) override;
virtual void Init() override;
};
+8 -4
View File
@@ -19,23 +19,27 @@
* We want to be able to detect if a given crash came
* from the OpenGL code, so use this helper to track that.
*/
class VCL_DLLPUBLIC OpenGLZone : public CrashZone< OpenGLZone > {
class VCL_DLLPUBLIC OpenGLZone : public CrashZone<OpenGLZone>
{
public:
static void hardDisable();
static void relaxWatchdogTimings();
static const CrashWatchdogTimingsValues& getCrashWatchdogTimingsValues();
static void checkDebug( int nUnchanged, const CrashWatchdogTimingsValues& aTimingValues );
static void checkDebug(int nUnchanged, const CrashWatchdogTimingsValues& aTimingValues);
static const char* name() { return "OpenGL"; }
};
/// Create this to not only enter the zone, but set VCL context.
class OpenGLVCLContextZone {
class OpenGLVCLContextZone
{
OpenGLZone aZone;
public:
OpenGLVCLContextZone();
};
class VCL_DLLPUBLIC PreDefaultWinNoOpenGLZone {
class VCL_DLLPUBLIC PreDefaultWinNoOpenGLZone
{
public:
PreDefaultWinNoOpenGLZone();
~PreDefaultWinNoOpenGLZone();
+5 -6
View File
@@ -28,20 +28,19 @@
#include <set>
#include <com/sun/star/awt/Rectangle.hpp>
class AquaA11yEventListener :
public ::cppu::WeakImplHelper< css::accessibility::XAccessibleEventListener >
class AquaA11yEventListener
: public ::cppu::WeakImplHelper<css::accessibility::XAccessibleEventListener>
{
public:
AquaA11yEventListener(id wrapperObject, sal_Int16 role);
virtual ~AquaA11yEventListener() override;
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
// XAccessibleEventListener
virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) override;
virtual void SAL_CALL
notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override;
private:
const id m_wrapperObject;
+3 -2
View File
@@ -25,11 +25,12 @@
#include <rtl/ref.hxx>
#include <salhelper/simplereferenceobject.hxx>
class KeyboardFocusListener : public salhelper::SimpleReferenceObject
{
public:
virtual void focusedObjectChanged(const css::uno::Reference< css::accessibility::XAccessible >& xAccessible) = 0;
virtual void
focusedObjectChanged(const css::uno::Reference<css::accessibility::XAccessible>& xAccessible)
= 0;
};
#endif // INCLUDED_VCL_INC_OSX_KEYBOARDFOCUSLISTENER_HXX
+10 -10
View File
@@ -26,26 +26,26 @@ class AquaSalMenuItem;
@interface OOStatusItemView : NSView
{
}
-(void)drawRect: (NSRect)aRect;
-(void)layout;
-(void)mouseUp: (NSEvent *)pEvent;
- (void)drawRect:(NSRect)aRect;
- (void)layout;
- (void)mouseUp:(NSEvent*)pEvent;
@end
@interface SalNSMenu : NSMenu
{
AquaSalMenu* mpMenu;
AquaSalMenu* mpMenu;
}
-(id)initWithMenu: (AquaSalMenu*)pMenu;
-(void)menuNeedsUpdate: (NSMenu*)pMenu;
-(void)setSalMenu: (AquaSalMenu*)pMenu;
- (id)initWithMenu:(AquaSalMenu*)pMenu;
- (void)menuNeedsUpdate:(NSMenu*)pMenu;
- (void)setSalMenu:(AquaSalMenu*)pMenu;
@end
@interface SalNSMenuItem : NSMenuItem
{
AquaSalMenuItem* mpMenuItem;
AquaSalMenuItem* mpMenuItem;
}
-(id)initWithMenuItem: (AquaSalMenuItem*)pMenuItem;
-(void)menuItemTriggered: (id)aSender;
- (id)initWithMenuItem:(AquaSalMenuItem*)pMenuItem;
- (void)menuItemTriggered:(id)aSender;
@end
#endif // INCLUDED_VCL_INC_OSX_SALNSMENU_H
+1 -1
View File
@@ -27,7 +27,7 @@
@interface TimerCallbackCaller : NSObject
{
}
-(void)timerElapsed:(NSTimer*)pTimer;
- (void)timerElapsed:(NSTimer*)pTimer;
@end
#endif // INCLUDED_VCL_INC_OSX_SALNSTIMER_H
+1 -1
View File
@@ -24,7 +24,7 @@
#include <sallayout.hxx>
SystemFontList* GetCoretextFontList();
FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef, bool* );
FontAttributes DevFontFromCTFontDescriptor(CTFontDescriptorRef, bool*);
#endif // INCLUDED_VCL_INC_QUARTZ_CTFONTS_HXX
+6 -5
View File
@@ -32,8 +32,8 @@ class RegionBand
private:
friend const char* ImplDbgTestRegionBand(const void*);
ImplRegionBand* mpFirstBand; // root of the list with y-bands
ImplRegionBand* mpLastCheckedBand;
ImplRegionBand* mpFirstBand; // root of the list with y-bands
ImplRegionBand* mpLastCheckedBand;
void implReset();
[[nodiscard]] bool CheckConsistency() const;
@@ -45,7 +45,7 @@ public:
RegionBand(const tools::Rectangle&);
~RegionBand();
bool operator==( const RegionBand& rRegionBand ) const;
bool operator==(const RegionBand& rRegionBand) const;
[[nodiscard]] bool load(SvStream& rIStrm);
void save(SvStream& rIStrm) const;
@@ -57,7 +57,7 @@ public:
void processPoints();
void CreateBandRange(tools::Long nYTop, tools::Long nYBottom);
void InsertLine(const Point& rStartPt, const Point& rEndPt, tools::Long nLineId);
void InsertPoint(const Point &rPoint, tools::Long nLineID, bool bEndPoint, LineType eLineType);
void InsertPoint(const Point& rPoint, tools::Long nLineID, bool bEndPoint, LineType eLineType);
bool OptimizeBandList();
void Move(tools::Long nHorzMove, tools::Long nVertMove);
void Scale(double fScaleX, double fScaleY);
@@ -73,7 +73,8 @@ public:
void XOr(const RegionBand& rSource);
tools::Rectangle GetBoundRect() const;
bool IsInside(const Point& rPoint) const;
sal_uInt32 getRectangleCount() const; // only users are Region::Intersect, Region::IsRectangle and PSWriter::ImplBmp
sal_uInt32 getRectangleCount()
const; // only users are Region::Intersect, Region::IsRectangle and PSWriter::ImplBmp
void GetRegionRectangles(RectangleVector& rTarget) const;
};
+4 -6
View File
@@ -25,12 +25,12 @@
#include <rtl/ustring.hxx>
// Button identifier for ShowNativeMessageBox
const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK = 1;
const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK = 1;
class VCL_PLUGIN_PUBLIC SalSystem
{
public:
SalSystem() {}
SalSystem() {}
virtual ~SalSystem();
// get info about the display
@@ -63,7 +63,7 @@ public:
else position relative to whole display
size: size of the screen
*/
virtual tools::Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ) = 0;
virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen) = 0;
/* Shows a native message box with the specified title, message and button
combination.
@@ -78,9 +78,7 @@ public:
See button identifier above. If the function fails the
return value is 0.
*/
virtual int ShowNativeMessageBox( const OUString& rTitle,
const OUString& rMessage ) = 0;
virtual int ShowNativeMessageBox(const OUString& rTitle, const OUString& rMessage) = 0;
};
VCL_DLLPUBLIC SalSystem* ImplGetSalSystem();
+8 -7
View File
@@ -25,31 +25,32 @@
namespace vcl
{
// Write color information for 1, 4 and 8 bit palette bitmap scanlines.
class ScanlineWriter
{
BitmapPalette& maPalette;
sal_uInt8 const mnColorsPerByte; // number of colors that are stored in one byte
sal_uInt8 const mnColorBitSize; // number of bits a color takes
sal_uInt8 const mnColorBitMask; // bit mask used to isolate the color
sal_uInt8 const mnColorBitSize; // number of bits a color takes
sal_uInt8 const mnColorBitMask; // bit mask used to isolate the color
sal_uInt8* mpCurrentScanline;
tools::Long mnX;
public:
ScanlineWriter(BitmapPalette& aPalette, sal_Int8 nColorsPerByte)
: maPalette(aPalette)
, mnColorsPerByte(nColorsPerByte)
, mnColorBitSize(8 / mnColorsPerByte) // bit size is number of bit in a byte divided by number of colors per byte (8 / 2 = 4 for 4-bit)
, mnColorBitSize(
8
/ mnColorsPerByte) // bit size is number of bit in a byte divided by number of colors per byte (8 / 2 = 4 for 4-bit)
, mnColorBitMask((1 << mnColorBitSize) - 1) // calculate the bit mask from the bit size
, mpCurrentScanline(nullptr)
, mnX(0)
{}
{
}
static std::unique_ptr<ScanlineWriter> Create(sal_uInt16 nBits, BitmapPalette& aPalette)
{
switch(nBits)
switch (nBits)
{
case 1:
return std::make_unique<ScanlineWriter>(aPalette, 8);
+18 -29
View File
@@ -43,22 +43,22 @@
#include <unicode/uscript.h>
#include <vector>
namespace vcl {
namespace vcl
{
struct ParenStackEntry
{
int32_t pairIndex;
UScriptCode scriptCode;
ParenStackEntry()
: pairIndex(0)
, scriptCode(USCRIPT_INVALID_CODE)
: pairIndex(0)
, scriptCode(USCRIPT_INVALID_CODE)
{
}
};
class ScriptRun final : public icu::UObject {
class ScriptRun final : public icu::UObject
{
public:
ScriptRun(const UChar chars[], int32_t length);
void reset();
@@ -87,13 +87,15 @@ s * ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @stable ICU 2.2
*/
static UClassID getStaticClassID() { return static_cast<UClassID>(const_cast<char *>(&fgClassID)); }
static UClassID getStaticClassID()
{
return static_cast<UClassID>(const_cast<char*>(&fgClassID));
}
private:
int32_t charStart;
int32_t charLimit;
const UChar *charArray;
const UChar* charArray;
int32_t scriptStart;
int32_t scriptEnd;
@@ -109,32 +111,20 @@ private:
static const char fgClassID;
};
inline ScriptRun::ScriptRun(const UChar chars[], int32_t length)
{
reset(chars, 0, length);
}
inline ScriptRun::ScriptRun(const UChar chars[], int32_t length) { reset(chars, 0, length); }
inline int32_t ScriptRun::getScriptStart() const
{
return scriptStart;
}
inline int32_t ScriptRun::getScriptStart() const { return scriptStart; }
inline int32_t ScriptRun::getScriptEnd() const
{
return scriptEnd;
}
inline int32_t ScriptRun::getScriptEnd() const { return scriptEnd; }
inline UScriptCode ScriptRun::getScriptCode() const
{
return scriptCode;
}
inline UScriptCode ScriptRun::getScriptCode() const { return scriptCode; }
inline void ScriptRun::reset()
{
scriptStart = charStart;
scriptEnd = charStart;
scriptCode = USCRIPT_INVALID_CODE;
parenSP = -1;
scriptEnd = charStart;
scriptCode = USCRIPT_INVALID_CODE;
parenSP = -1;
parenStack.resize(128);
}
@@ -152,7 +142,6 @@ inline void ScriptRun::reset(const UChar chars[], int32_t start, int32_t length)
reset(start, length);
}
}
#endif
+2 -1
View File
@@ -24,7 +24,8 @@
#include <sal/types.h>
enum SAL_DLLPUBLIC_RTTI DesktopType {
enum SAL_DLLPUBLIC_RTTI DesktopType
{
DESKTOP_NONE, // headless, i.e. no X connection at all
DESKTOP_UNKNOWN, // unknown desktop, simple WM, etc.
DESKTOP_GNOME,
+1 -1
View File
@@ -60,7 +60,7 @@
of course not all keysyms can be mapped to a unicode code point
*/
sal_Unicode KeysymToUnicode (KeySym nKeySym);
sal_Unicode KeysymToUnicode(KeySym nKeySym);
#endif // INCLUDED_VCL_INC_UNX_I18N_KEYSYM_HXX
+4 -2
View File
@@ -22,8 +22,10 @@
#include <tools/long.hxx>
inline tools::Long Divide( tools::Long nDividend, tools::Long nDivisor )
{ return (nDividend + nDivisor/2) / nDivisor; }
inline tools::Long Divide(tools::Long nDividend, tools::Long nDivisor)
{
return (nDividend + nDivisor / 2) / nDivisor;
}
#endif
+9 -9
View File
@@ -21,8 +21,8 @@
class VCL_PLUGIN_PUBLIC ScreenSaverInhibitor
{
public:
void inhibit( bool bInhibit, const OUString& sReason,
bool bIsX11, const std::optional<unsigned int>& xid, std::optional<Display*> pDisplay );
void inhibit(bool bInhibit, const OUString& sReason, bool bIsX11,
const std::optional<unsigned int>& xid, std::optional<Display*> pDisplay);
private:
// These are all used as guint, however this header may be included
@@ -56,14 +56,14 @@ private:
// (This is replaced by the GSM interface from Mate 1.12 onwards)
//
// Note: the Uninhibit call has different spelling in FDO (UnInhibit) vs GSM (Uninhibit)
void inhibitFDO( bool bInhibit, const char* appname, const char* reason );
void inhibitFDOPM( bool bInhibit, const char* appname, const char* reason );
void inhibitGSM( bool bInhibit, const char* appname, const char* reason, const unsigned int xid );
void inhibitMSM( bool bInhibit, const char* appname, const char* reason, const unsigned int xid );
void inhibitFDO(bool bInhibit, const char* appname, const char* reason);
void inhibitFDOPM(bool bInhibit, const char* appname, const char* reason);
void inhibitGSM(bool bInhibit, const char* appname, const char* reason, const unsigned int xid);
void inhibitMSM(bool bInhibit, const char* appname, const char* reason, const unsigned int xid);
void inhibitXScreenSaver( bool bInhibit, Display* pDisplay );
static void inhibitXAutoLock( bool bInhibit, Display* pDisplay );
void inhibitDPMS( bool bInhibit, Display* pDisplay );
void inhibitXScreenSaver(bool bInhibit, Display* pDisplay);
static void inhibitXAutoLock(bool bInhibit, Display* pDisplay);
void inhibitDPMS(bool bInhibit, Display* pDisplay);
};
#endif // INCLUDED_VCL_INC_UNX_SCREENSAVERINHIBITOR_HXX
+2 -2
View File
@@ -17,8 +17,8 @@ class ControlCacheKey;
class X11GraphicsImpl
{
public:
virtual ~X11GraphicsImpl() {};
virtual void Flush() {};
virtual ~X11GraphicsImpl(){};
virtual void Flush(){};
};
#endif // INCLUDED_VCL_INC_UNX_X11_X11GDIIMPL_HXX
+3 -3
View File
@@ -22,8 +22,8 @@
#define hidewhitespace_curs_x_hot 0
#define hidewhitespace_curs_y_hot 10
static unsigned char hidewhitespace_curs_bits[] = {
0x00, 0x01, 0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01, 0xFF, 0xFF,
0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xFF, 0xFF, 0x00, 0x01,
0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0x00, 0x01, };
0x00, 0x01, 0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x80, 0x01, 0x80,
0x01, 0x80, 0x01, 0x80, 0xFF, 0xFF, 0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0x00, 0x01,
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+3 -3
View File
@@ -22,8 +22,8 @@
#define hidewhitespace_mask_x_hot 0
#define hidewhitespace_mask_y_hot 10
static unsigned char hidewhitespace_mask_bits[] = {
0x00, 0x01, 0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01, 0xFF, 0xFF,
0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xFF, 0xFF, 0x00, 0x01,
0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0x00, 0x01, };
0x00, 0x01, 0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x80, 0x01, 0x80,
0x01, 0x80, 0x01, 0x80, 0xFF, 0xFF, 0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0x00, 0x01,
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+3 -3
View File
@@ -22,8 +22,8 @@
#define showwhitespace_curs_x_hot 0
#define showwhitespace_curs_y_hot 10
static unsigned char showwhitespace_curs_bits[] = {
0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x81,
0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0xFF, 0xFF,
0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01, };
0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81,
0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0xFF, 0xFF, 0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01,
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+3 -3
View File
@@ -22,8 +22,8 @@
#define showwhitespace_mask_x_hot 0
#define showwhitespace_mask_y_hot 10
static unsigned char showwhitespace_mask_bits[] = {
0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x81,
0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0xFF, 0xFF,
0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01, };
0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x81, 0x01, 0x81, 0x01, 0x81,
0x01, 0x81, 0x01, 0x81, 0x01, 0x81, 0xFF, 0xFF, 0x00, 0x01, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x01,
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+5 -4
View File
@@ -25,11 +25,12 @@
class VclEventListeners
{
public:
void Call( VclSimpleEvent& rEvent ) const;
void addListener( const Link<VclSimpleEvent&,void>& rListener );
void removeListener( const Link<VclSimpleEvent&,void>& rListener );
void Call(VclSimpleEvent& rEvent) const;
void addListener(const Link<VclSimpleEvent&, void>& rListener);
void removeListener(const Link<VclSimpleEvent&, void>& rListener);
private:
std::vector<Link<VclSimpleEvent&,void>> m_aListeners;
std::vector<Link<VclSimpleEvent&, void>> m_aListeners;
};
#endif // INCLUDED_VCL_INC_VCLEVENTLISTENERS_HXX
+1 -3
View File
@@ -9,8 +9,6 @@
#include <opengl/DeviceInfo.hxx>
OpenGLDeviceInfo::~OpenGLDeviceInfo()
{
}
OpenGLDeviceInfo::~OpenGLDeviceInfo() {}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+20 -20
View File
@@ -28,24 +28,24 @@ using namespace com::sun::star::datatransfer::dnd;
*/
unsigned int OfficeToSystemDragActions(sal_Int8 dragActions)
{
unsigned int actions = NSDragOperationNone;
unsigned int actions = NSDragOperationNone;
if (dragActions & DNDConstants::ACTION_COPY)
if (dragActions & DNDConstants::ACTION_COPY)
{
actions |= NSDragOperationCopy;
actions |= NSDragOperationCopy;
}
if (dragActions & DNDConstants::ACTION_MOVE)
if (dragActions & DNDConstants::ACTION_MOVE)
{
actions |= NSDragOperationMove;
actions |= NSDragOperationMove;
}
if (dragActions & DNDConstants::ACTION_LINK)
if (dragActions & DNDConstants::ACTION_LINK)
{
actions |= NSDragOperationLink;
actions |= NSDragOperationLink;
}
return actions;
return actions;
}
/* Convert system conform drag actions into office conform
@@ -54,31 +54,31 @@ unsigned int OfficeToSystemDragActions(sal_Int8 dragActions)
*/
sal_Int8 SystemToOfficeDragActions(unsigned int dragActions)
{
sal_Int8 actions = DNDConstants::ACTION_NONE;
sal_Int8 actions = DNDConstants::ACTION_NONE;
if (dragActions & NSDragOperationCopy)
if (dragActions & NSDragOperationCopy)
{
actions |= DNDConstants::ACTION_COPY;
actions |= DNDConstants::ACTION_COPY;
}
if (dragActions & NSDragOperationMove)
if (dragActions & NSDragOperationMove)
{
actions |= DNDConstants::ACTION_MOVE;
actions |= DNDConstants::ACTION_MOVE;
}
if (dragActions & NSDragOperationLink)
if (dragActions & NSDragOperationLink)
{
actions |= DNDConstants::ACTION_LINK;
actions |= DNDConstants::ACTION_LINK;
}
// We map NSDragOperationGeneric to ACTION_DEFAULT to
// signal that we have to decide for a drag action
if (dragActions & NSDragOperationGeneric)
// We map NSDragOperationGeneric to ACTION_DEFAULT to
// signal that we have to decide for a drag action
if (dragActions & NSDragOperationGeneric)
{
actions |= DNDConstants::ACTION_DEFAULT;
actions |= DNDConstants::ACTION_DEFAULT;
}
return actions;
return actions;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+4 -5
View File
@@ -26,12 +26,11 @@
#include <Cocoa/Cocoa.h>
#include <postmac.h>
bool ImageToPNG( css::uno::Sequence<sal_Int8> const & rImgData,
css::uno::Sequence<sal_Int8>& rPngData);
bool ImageToPNG(css::uno::Sequence<sal_Int8> const& rImgData,
css::uno::Sequence<sal_Int8>& rPngData);
bool PNGToImage( css::uno::Sequence<sal_Int8> const & rPngData,
css::uno::Sequence<sal_Int8>& rImgData,
NSBitmapImageFileType eOutFormat);
bool PNGToImage(css::uno::Sequence<sal_Int8> const& rPngData,
css::uno::Sequence<sal_Int8>& rImgData, NSBitmapImageFileType eOutFormat);
#endif // INCLUDED_VCL_OSX_PICTTOBMPFLT_HXX
+2 -2
View File
@@ -26,8 +26,8 @@
@interface AquaA11yActionWrapper : NSObject
{
}
+(NSArray *)actionNamesForElement:(AquaA11yWrapper *)wrapper;
+(void)doAction:(NSString *)action ofElement:(AquaA11yWrapper *)wrapper;
+ (NSArray*)actionNamesForElement:(AquaA11yWrapper*)wrapper;
+ (void)doAction:(NSString*)action ofElement:(AquaA11yWrapper*)wrapper;
@end
#endif // INCLUDED_VCL_OSX_A11YACTIONWRAPPER_H
+6 -6
View File
@@ -26,12 +26,12 @@
@interface AquaA11yComponentWrapper : NSObject
{
}
+(id)sizeAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)positionAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)descriptionAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setFocusedAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+ (id)sizeAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)positionAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)descriptionAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (void)addAttributeNamesTo:(NSMutableArray*)attributeNames;
+ (BOOL)isAttributeSettable:(NSString*)attribute forElement:(AquaA11yWrapper*)wrapper;
+ (void)setFocusedAttributeForElement:(AquaA11yWrapper*)wrapper to:(id)value;
@end
#endif // INCLUDED_VCL_OSX_A11YCOMPONENTWRAPPER_H
+6 -5
View File
@@ -27,18 +27,19 @@ class AquaA11yFocusListener : public KeyboardFocusListener
{
id m_focusedObject;
static rtl::Reference< AquaA11yFocusListener > theListener;
static rtl::Reference<AquaA11yFocusListener> theListener;
AquaA11yFocusListener();
virtual ~AquaA11yFocusListener() override {};
public:
virtual ~AquaA11yFocusListener() override{};
static rtl::Reference< AquaA11yFocusListener > const & get();
public:
static rtl::Reference<AquaA11yFocusListener> const& get();
id getFocusedUIElement();
// KeyboardFocusListener
virtual void focusedObjectChanged(const css::uno::Reference< css::accessibility::XAccessible >& xAccessible) override;
virtual void focusedObjectChanged(
const css::uno::Reference<css::accessibility::XAccessible>& xAccessible) override;
};
#endif // INCLUDED_VCL_OSX_A11YFOCUSLISTENER_HXX
+4 -4
View File
@@ -26,10 +26,10 @@
@interface AquaA11ySelectionWrapper : NSObject
{
}
+(id)selectedChildrenAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setSelectedChildrenAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+ (id)selectedChildrenAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (void)addAttributeNamesTo:(NSMutableArray*)attributeNames;
+ (BOOL)isAttributeSettable:(NSString*)attribute forElement:(AquaA11yWrapper*)wrapper;
+ (void)setSelectedChildrenAttributeForElement:(AquaA11yWrapper*)wrapper to:(id)value;
@end
#endif // INCLUDED_VCL_OSX_A11YSELECTIONWRAPPER_H
+4 -4
View File
@@ -27,11 +27,11 @@
@interface AquaA11yTableWrapper : AquaA11yWrapper
{
}
+(id)childrenAttributeForElement:(AquaA11yTableWrapper *)wrapper;
+(void)addAttributeNamesTo: (NSMutableArray *)attributeNames object: (AquaA11yWrapper*)pObject;
+ (id)childrenAttributeForElement:(AquaA11yTableWrapper*)wrapper;
+ (void)addAttributeNamesTo:(NSMutableArray*)attributeNames object:(AquaA11yWrapper*)pObject;
-(id)rowsAttribute;
-(id)columnsAttribute;
- (id)rowsAttribute;
- (id)columnsAttribute;
@end
#endif // INCLUDED_VCL_OSX_A11YTABLEWRAPPER_H
+25 -25
View File
@@ -26,31 +26,31 @@
@interface AquaA11yTextWrapper : NSObject
{
}
+(id)valueAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)numberOfCharactersAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)selectedTextAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)selectedTextRangeAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)visibleCharacterRangeAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)sharedTextUIElementsAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)sharedCharacterRangeAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)stringForRangeAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)range;
+(id)attributedStringForRangeAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)range;
+(id)rangeForIndexAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)index;
+(id)rangeForPositionAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)point;
+(id)boundsForRangeAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)range;
+(id)styleRangeForIndexAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)index;
+(id)rTFForRangeAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)range;
+(id)lineForIndexAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)index;
+(id)rangeForLineAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)line;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
+(void)addParameterizedAttributeNamesTo:(NSMutableArray *)attributeNames;
+(NSArray *)specialAttributeNames;
+(NSArray *)specialParameterizedAttributeNames;
+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setVisibleCharacterRangeAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+(void)setSelectedTextRangeAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+(void)setSelectedTextAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+(void)setValueAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+ (id)valueAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)numberOfCharactersAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)selectedTextAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)selectedTextRangeAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)visibleCharacterRangeAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)sharedTextUIElementsAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)sharedCharacterRangeAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)stringForRangeAttributeForElement:(AquaA11yWrapper*)wrapper forParameter:(id)range;
+ (id)attributedStringForRangeAttributeForElement:(AquaA11yWrapper*)wrapper forParameter:(id)range;
+ (id)rangeForIndexAttributeForElement:(AquaA11yWrapper*)wrapper forParameter:(id)index;
+ (id)rangeForPositionAttributeForElement:(AquaA11yWrapper*)wrapper forParameter:(id)point;
+ (id)boundsForRangeAttributeForElement:(AquaA11yWrapper*)wrapper forParameter:(id)range;
+ (id)styleRangeForIndexAttributeForElement:(AquaA11yWrapper*)wrapper forParameter:(id)index;
+ (id)rTFForRangeAttributeForElement:(AquaA11yWrapper*)wrapper forParameter:(id)range;
+ (id)lineForIndexAttributeForElement:(AquaA11yWrapper*)wrapper forParameter:(id)index;
+ (id)rangeForLineAttributeForElement:(AquaA11yWrapper*)wrapper forParameter:(id)line;
+ (void)addAttributeNamesTo:(NSMutableArray*)attributeNames;
+ (void)addParameterizedAttributeNamesTo:(NSMutableArray*)attributeNames;
+ (NSArray*)specialAttributeNames;
+ (NSArray*)specialParameterizedAttributeNames;
+ (BOOL)isAttributeSettable:(NSString*)attribute forElement:(AquaA11yWrapper*)wrapper;
+ (void)setVisibleCharacterRangeAttributeForElement:(AquaA11yWrapper*)wrapper to:(id)value;
+ (void)setSelectedTextRangeAttributeForElement:(AquaA11yWrapper*)wrapper to:(id)value;
+ (void)setSelectedTextAttributeForElement:(AquaA11yWrapper*)wrapper to:(id)value;
+ (void)setValueAttributeForElement:(AquaA11yWrapper*)wrapper to:(id)value;
@end
#endif // INCLUDED_VCL_OSX_A11YTEXTWRAPPER_H
+4 -3
View File
@@ -22,10 +22,11 @@
#include <com/sun/star/awt/Point.hpp>
@interface AquaA11yUtil : NSObject {
@interface AquaA11yUtil : NSObject
{
}
+(NSValue *)vclPointToNSPoint:(css::awt::Point)vclPoint;
+(css::awt::Point)nsPointToVclPoint:(NSValue *)nsPoint;
+ (NSValue*)vclPointToNSPoint:(css::awt::Point)vclPoint;
+ (css::awt::Point)nsPointToVclPoint:(NSValue*)nsPoint;
@end
#endif // INCLUDED_VCL_OSX_A11YUTIL_H
+6 -6
View File
@@ -27,12 +27,12 @@
@interface AquaA11yValueWrapper : NSObject
{
}
+(id)valueAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)minValueAttributeForElement:(AquaA11yWrapper *)wrapper;
+(id)maxValueAttributeForElement:(AquaA11yWrapper *)wrapper;
+(void)addAttributeNamesTo:(NSMutableArray *)attributeNames;
+(BOOL)isAttributeSettable:(NSString *)attribute forElement:(AquaA11yWrapper *)wrapper;
+(void)setValueAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value;
+ (id)valueAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)minValueAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (id)maxValueAttributeForElement:(AquaA11yWrapper*)wrapper;
+ (void)addAttributeNamesTo:(NSMutableArray*)attributeNames;
+ (BOOL)isAttributeSettable:(NSString*)attribute forElement:(AquaA11yWrapper*)wrapper;
+ (void)setValueAttributeForElement:(AquaA11yWrapper*)wrapper to:(id)value;
@end
#endif // INCLUDED_VCL_OSX_A11YVALUEWRAPPER_H
+3 -3
View File
@@ -25,9 +25,9 @@
@interface AquaA11yWrapperButton : AquaA11yWrapper
{
}
-(id)valueAttribute;
-(id)descriptionAttribute;
-(NSArray *)accessibilityAttributeNames;
- (id)valueAttribute;
- (id)descriptionAttribute;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERBUTTON_H
+3 -3
View File
@@ -25,9 +25,9 @@
@interface AquaA11yWrapperCheckBox : AquaA11yWrapper
{
}
-(id)valueAttribute;
-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
- (id)valueAttribute;
- (BOOL)accessibilityIsAttributeSettable:(NSString*)attribute;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERCHECKBOX_H
+11 -10
View File
@@ -25,18 +25,19 @@
@interface AquaA11yWrapperComboBox : AquaA11yWrapper
{
AquaA11yWrapper * textArea;
AquaA11yWrapper* textArea;
}
-(id)initWithAccessibleContext: (css::uno::Reference < css::accessibility::XAccessibleContext >) anAccessibleContext;
-(id)valueAttribute;
-(id)numberOfCharactersAttribute;
-(id)selectedTextAttribute;
-(id)selectedTextRangeAttribute;
-(id)visibleCharacterRangeAttribute;
- (id)initWithAccessibleContext:
(css::uno::Reference<css::accessibility::XAccessibleContext>)anAccessibleContext;
- (id)valueAttribute;
- (id)numberOfCharactersAttribute;
- (id)selectedTextAttribute;
- (id)selectedTextRangeAttribute;
- (id)visibleCharacterRangeAttribute;
// Accessibility Protocol
-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
- (BOOL)accessibilityIsAttributeSettable:(NSString*)attribute;
- (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERCOMBOBOX_H
+2 -2
View File
@@ -25,8 +25,8 @@
@interface AquaA11yWrapperGroup : AquaA11yWrapper
{
}
-(id)titleUIElementAttribute;
-(NSArray *)accessibilityAttributeNames;
- (id)titleUIElementAttribute;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERGROUP_H
+1 -1
View File
@@ -25,7 +25,7 @@
@interface AquaA11yWrapperList : AquaA11yWrapper
{
}
-(NSArray *)accessibilityAttributeNames;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERLIST_H
+3 -3
View File
@@ -25,9 +25,9 @@
@interface AquaA11yWrapperRadioButton : AquaA11yWrapper
{
}
-(id)valueAttribute;
-(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
-(NSArray *)accessibilityAttributeNames;
- (id)valueAttribute;
- (BOOL)accessibilityIsAttributeSettable:(NSString*)attribute;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERRADIOBUTTON_H
+1 -1
View File
@@ -25,7 +25,7 @@
@interface AquaA11yWrapperRadioGroup : AquaA11yWrapper
{
}
-(NSArray *)accessibilityAttributeNames;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERRADIOGROUP_H
+2 -2
View File
@@ -25,8 +25,8 @@
@interface AquaA11yWrapperRow : AquaA11yWrapper
{
}
-(id)disclosingAttribute;
-(NSArray *)accessibilityAttributeNames;
- (id)disclosingAttribute;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERROW_H
+3 -3
View File
@@ -25,9 +25,9 @@
@interface AquaA11yWrapperScrollArea : AquaA11yWrapper
{
}
-(id)verticalScrollBarAttribute;
-(id)horizontalScrollBarAttribute;
-(NSArray *)accessibilityAttributeNames;
- (id)verticalScrollBarAttribute;
- (id)horizontalScrollBarAttribute;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERSCROLLAREA_H
+1 -1
View File
@@ -25,7 +25,7 @@
@interface AquaA11yWrapperScrollBar : AquaA11yWrapper
{
}
-(NSArray *)accessibilityAttributeNames;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERSCROLLBAR_H
+1 -1
View File
@@ -25,7 +25,7 @@
@interface AquaA11yWrapperSplitter : AquaA11yWrapper
{
}
-(NSArray *)accessibilityAttributeNames;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERSPLITTER_H
+2 -2
View File
@@ -25,8 +25,8 @@
@interface AquaA11yWrapperStaticText : AquaA11yWrapper
{
}
-(id)titleAttribute;
-(NSArray *)accessibilityAttributeNames;
- (id)titleAttribute;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERSTATICTEXT_H
+1 -1
View File
@@ -25,7 +25,7 @@
@interface AquaA11yWrapperTabGroup : AquaA11yWrapper
{
}
-(NSArray *)accessibilityAttributeNames;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERTABGROUP_H
+1 -1
View File
@@ -25,7 +25,7 @@
@interface AquaA11yWrapperTextArea : AquaA11yWrapper
{
}
-(NSArray *)accessibilityAttributeNames;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERTEXTAREA_H
+1 -1
View File
@@ -25,7 +25,7 @@
@interface AquaA11yWrapperToolbar : AquaA11yWrapper
{
}
-(NSArray *)accessibilityAttributeNames;
- (NSArray*)accessibilityAttributeNames;
@end
#endif // INCLUDED_VCL_OSX_A11YWRAPPERTOOLBAR_H
-1
View File
@@ -21,7 +21,6 @@
namespace
{
class BitmapProcessorTest : public CppUnit::TestFixture
{
void testDisabledImage();
+7 -4
View File
@@ -14,7 +14,10 @@
class VclFontCharMapTest : public test::BootstrapFixture
{
public:
VclFontCharMapTest() : BootstrapFixture(true, false) {}
VclFontCharMapTest()
: BootstrapFixture(true, false)
{
}
void testDefaultFontCharMap();
@@ -25,9 +28,9 @@ public:
void VclFontCharMapTest::testDefaultFontCharMap()
{
FontCharMapRef xfcmap( new FontCharMap() ); // gets default map
FontCharMapRef xfcmap(new FontCharMap()); // gets default map
CPPUNIT_ASSERT( xfcmap->IsDefaultMap() );
CPPUNIT_ASSERT(xfcmap->IsDefaultMap());
sal_uInt32 nStartBMPPlane = xfcmap->GetFirstChar();
sal_uInt32 nStartSupBMPPlane = xfcmap->GetNextChar(0xD800);
@@ -35,7 +38,7 @@ void VclFontCharMapTest::testDefaultFontCharMap()
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0x0020), nStartBMPPlane);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0xE000), nStartSupBMPPlane);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0xFFF0-1), nEndBMPPlane);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0xFFF0 - 1), nEndBMPPlane);
}
CPPUNIT_TEST_SUITE_REGISTRATION(VclFontCharMapTest);
+9 -7
View File
@@ -38,24 +38,25 @@ public:
static int deltaColor(BitmapColor aColor1, BitmapColor aColor2)
{
int deltaR = std::abs(aColor1.GetRed() - aColor2.GetRed());
int deltaR = std::abs(aColor1.GetRed() - aColor2.GetRed());
int deltaG = std::abs(aColor1.GetGreen() - aColor2.GetGreen());
int deltaB = std::abs(aColor1.GetBlue() - aColor2.GetBlue());
int deltaB = std::abs(aColor1.GetBlue() - aColor2.GetBlue());
return std::max(std::max(deltaR, deltaG), deltaB);
}
static bool checkRect(Bitmap& rBitmap, int aLayerNumber, tools::Long nAreaHeight, tools::Long nAreaWidth, Color aExpectedColor, int nMaxDelta)
static bool checkRect(Bitmap& rBitmap, int aLayerNumber, tools::Long nAreaHeight,
tools::Long nAreaWidth, Color aExpectedColor, int nMaxDelta)
{
BitmapScopedWriteAccess pAccess(rBitmap);
tools::Long nWidth = std::min(nAreaWidth, pAccess->Width());
tools::Long nWidth = std::min(nAreaWidth, pAccess->Width());
tools::Long nHeight = std::min(nAreaHeight, pAccess->Height());
tools::Long firstX = 0 + aLayerNumber;
tools::Long firstY = 0 + aLayerNumber;
tools::Long lastX = nWidth - 1 - aLayerNumber;
tools::Long lastX = nWidth - 1 - aLayerNumber;
tools::Long lastY = nHeight - 1 - aLayerNumber;
int delta;
@@ -79,7 +80,7 @@ static bool checkRect(Bitmap& rBitmap, int aLayerNumber, tools::Long nAreaHeight
if (delta > nMaxDelta)
return false;
Color aColorLast = pAccess->GetPixel(lastY, x);
Color aColorLast = pAccess->GetPixel(lastY, x);
delta = deltaColor(aColorLast, aExpectedColor);
if (delta > nMaxDelta)
return false;
@@ -132,7 +133,8 @@ void JpegReaderTest::testReadGray()
CPPUNIT_ASSERT_EQUAL(tools::Long(12), aSize.Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(12), aSize.Height());
aBitmap.Convert(BmpConversion::N24Bit); // convert to 24bit so we don't need to deal with palette
aBitmap.Convert(
BmpConversion::N24Bit); // convert to 24bit so we don't need to deal with palette
int nMaxDelta = 1;
CPPUNIT_ASSERT(checkRect(aBitmap, 0, 8, 8, Color(0xff, 0xff, 0xff), nMaxDelta));
+4 -2
View File
@@ -18,7 +18,10 @@
class VclMnemonicTest : public test::BootstrapFixture
{
public:
VclMnemonicTest() : BootstrapFixture(true, false) {}
VclMnemonicTest()
: BootstrapFixture(true, false)
{
}
void testMnemonic();
@@ -47,7 +50,6 @@ void VclMnemonicTest::testMnemonic()
OUString sResult = aGenerator.CreateMnemonic(OUString(TEST, SAL_N_ELEMENTS(TEST)));
CPPUNIT_ASSERT_EQUAL(OUString("(~C)"), sResult.copy(sResult.getLength() - 4));
}
}
CPPUNIT_TEST_SUITE_REGISTRATION(VclMnemonicTest);
+18 -15
View File
@@ -24,7 +24,10 @@
class VclOutdevTest : public test::BootstrapFixture
{
public:
VclOutdevTest() : BootstrapFixture(true, false) {}
VclOutdevTest()
: BootstrapFixture(true, false)
{
}
void testVirtualDevice();
void testUseAfterDispose();
@@ -80,20 +83,20 @@ void VclOutdevTest::testWindowBackgroundColor()
void VclOutdevTest::testVirtualDevice()
{
ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->SetOutputSizePixel(Size(32,32));
ScopedVclPtrInstance<VirtualDevice> pVDev;
pVDev->SetOutputSizePixel(Size(32, 32));
pVDev->SetBackground(Wallpaper(COL_WHITE));
CPPUNIT_ASSERT_EQUAL(pVDev->GetBackgroundColor(), COL_WHITE);
pVDev->Erase();
pVDev->DrawPixel(Point(1,2),COL_BLUE);
pVDev->DrawPixel(Point(31,30),COL_RED);
pVDev->DrawPixel(Point(1, 2), COL_BLUE);
pVDev->DrawPixel(Point(31, 30), COL_RED);
Size aSize = pVDev->GetOutputSizePixel();
CPPUNIT_ASSERT_EQUAL(Size(32,32), aSize);
CPPUNIT_ASSERT_EQUAL(Size(32, 32), aSize);
Bitmap aBmp = pVDev->GetBitmap(Point(),aSize);
Bitmap aBmp = pVDev->GetBitmap(Point(), aSize);
#if 0
OUString rFileName("/tmp/foo-unx.png");
@@ -107,21 +110,21 @@ void VclOutdevTest::testVirtualDevice()
}
#endif
CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(0,0)));
CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(0, 0)));
#if !defined _WIN32 //TODO: various failures on Windows tinderboxes
CPPUNIT_ASSERT_EQUAL(COL_BLUE, pVDev->GetPixel(Point(1,2)));
CPPUNIT_ASSERT_EQUAL(COL_RED, pVDev->GetPixel(Point(31,30)));
CPPUNIT_ASSERT_EQUAL(COL_BLUE, pVDev->GetPixel(Point(1, 2)));
CPPUNIT_ASSERT_EQUAL(COL_RED, pVDev->GetPixel(Point(31, 30)));
#endif
CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(30,31)));
CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(30, 31)));
// Gotcha: y and x swap for BitmapReadAccess: deep joy.
Bitmap::ScopedReadAccess pAcc(aBmp);
CPPUNIT_ASSERT_EQUAL(COL_WHITE, static_cast<Color>(pAcc->GetPixel(0,0)));
CPPUNIT_ASSERT_EQUAL(COL_WHITE, static_cast<Color>(pAcc->GetPixel(0, 0)));
#if !defined _WIN32 //TODO: various failures on Windows tinderboxes
CPPUNIT_ASSERT_EQUAL(COL_BLUE, static_cast<Color>(pAcc->GetPixel(2,1)));
CPPUNIT_ASSERT_EQUAL(COL_RED, static_cast<Color>(pAcc->GetPixel(30,31)));
CPPUNIT_ASSERT_EQUAL(COL_BLUE, static_cast<Color>(pAcc->GetPixel(2, 1)));
CPPUNIT_ASSERT_EQUAL(COL_RED, static_cast<Color>(pAcc->GetPixel(30, 31)));
#endif
CPPUNIT_ASSERT_EQUAL(COL_WHITE, static_cast<Color>(pAcc->GetPixel(31,30)));
CPPUNIT_ASSERT_EQUAL(COL_WHITE, static_cast<Color>(pAcc->GetPixel(31, 30)));
#if 0
VclPtr<vcl::Window> pWin = VclPtr<WorkWindow>::Create( (vcl::Window *)nullptr );
+238 -147
View File
@@ -59,7 +59,6 @@ static std::ostream& operator<<(std::ostream& rStrm, const Color& rColor)
namespace
{
/// Tests the PDF export filter.
class PdfExportTest : public test::BootstrapFixture, public unotest::MacrosTest
{
@@ -68,7 +67,8 @@ protected:
utl::TempFile maTempFile;
SvMemoryStream maMemory;
// Export the document as PDF, then parse it with PDFium.
std::unique_ptr<vcl::pdf::PDFiumDocument> exportAndParse(const OUString& rURL, const utl::MediaDescriptor& rDescriptor);
std::unique_ptr<vcl::pdf::PDFiumDocument>
exportAndParse(const OUString& rURL, const utl::MediaDescriptor& rDescriptor);
std::shared_ptr<vcl::pdf::PDFium> mpPDFium;
public:
@@ -79,12 +79,10 @@ public:
void load(const OUString& rFile, vcl::filter::PDFDocument& rDocument);
};
PdfExportTest::PdfExportTest()
{
maTempFile.EnableKillingFile();
}
PdfExportTest::PdfExportTest() { maTempFile.EnableKillingFile(); }
std::unique_ptr<vcl::pdf::PDFiumDocument> PdfExportTest::exportAndParse(const OUString& rURL, const utl::MediaDescriptor& rDescriptor)
std::unique_ptr<vcl::pdf::PDFiumDocument>
PdfExportTest::exportAndParse(const OUString& rURL, const utl::MediaDescriptor& rDescriptor)
{
// Import the bugdoc and export as PDF.
mxComponent = loadFromDesktop(rURL);
@@ -156,9 +154,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106059)
utl::MediaDescriptor aMediaDescriptor;
aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
// Explicitly enable the usage of the reference XObject markup.
uno::Sequence<beans::PropertyValue> aFilterData( comphelper::InitPropertySequence({
{"UseReferenceXObject", uno::Any(true) }
}));
uno::Sequence<beans::PropertyValue> aFilterData(
comphelper::InitPropertySequence({ { "UseReferenceXObject", uno::Any(true) } }));
aMediaDescriptor["FilterData"] <<= aFilterData;
xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
@@ -173,11 +170,13 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106059)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
// The page has one image.
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pXObjects->GetItems().size());
vcl::filter::PDFObjectElement* pReferenceXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pReferenceXObject
= pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
CPPUNIT_ASSERT(pReferenceXObject);
// The image is a reference XObject.
// This dictionary key was missing, so the XObject wasn't a reference one.
@@ -196,11 +195,13 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106693)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
// The page has one image.
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pXObjects->GetItems().size());
vcl::filter::PDFObjectElement* pXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pXObject
= pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
CPPUNIT_ASSERT(pXObject);
// The image is a form XObject.
auto pSubtype = dynamic_cast<vcl::filter::PDFNameElement*>(pXObject->Lookup("Subtype"));
@@ -211,14 +212,18 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106693)
// Assert that the form object refers to an inner form object, not a
// bitmap.
auto pInnerResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
auto pInnerResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
CPPUNIT_ASSERT(pInnerResources);
auto pInnerXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pInnerResources->LookupElement("XObject"));
auto pInnerXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pInnerResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pInnerXObjects);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pInnerXObjects->GetItems().size());
vcl::filter::PDFObjectElement* pInnerXObject = pInnerXObjects->LookupObject(pInnerXObjects->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pInnerXObject
= pInnerXObjects->LookupObject(pInnerXObjects->GetItems().begin()->first);
CPPUNIT_ASSERT(pInnerXObject);
auto pInnerSubtype = dynamic_cast<vcl::filter::PDFNameElement*>(pInnerXObject->Lookup("Subtype"));
auto pInnerSubtype
= dynamic_cast<vcl::filter::PDFNameElement*>(pInnerXObject->Lookup("Subtype"));
CPPUNIT_ASSERT(pInnerSubtype);
// This failed: this was Image (bitmap), not Form (vector).
CPPUNIT_ASSERT_EQUAL(OString("Form"), pInnerSubtype->GetValue());
@@ -270,8 +275,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf105461)
CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107868)
{
// No need to run it on Windows, since it would use GDI printing, and not trigger PDF export
// which is the intent of the test.
// No need to run it on Windows, since it would use GDI printing, and not trigger PDF export
// which is the intent of the test.
// FIXME: Why does this fail on macOS?
#if !defined MACOSX && !defined _WIN32
@@ -284,10 +289,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107868)
uno::Reference<view::XPrintable> xPrintable(mxComponent, uno::UNO_QUERY);
CPPUNIT_ASSERT(xPrintable.is());
uno::Sequence<beans::PropertyValue> aOptions(comphelper::InitPropertySequence(
{
{"FileName", uno::makeAny(maTempFile.GetURL())},
{"Wait", uno::makeAny(true)}
}));
{ { "FileName", uno::makeAny(maTempFile.GetURL()) }, { "Wait", uno::makeAny(true) } }));
xPrintable->print(aOptions);
// Parse the export result with pdfium.
@@ -339,20 +341,25 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf105093)
auto pAnnots = dynamic_cast<vcl::filter::PDFArrayElement*>(aPages[0]->Lookup("Annots"));
CPPUNIT_ASSERT(pAnnots);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pAnnots->GetElements().size());
auto pAnnotReference = dynamic_cast<vcl::filter::PDFReferenceElement*>(pAnnots->GetElements()[0]);
auto pAnnotReference
= dynamic_cast<vcl::filter::PDFReferenceElement*>(pAnnots->GetElements()[0]);
CPPUNIT_ASSERT(pAnnotReference);
vcl::filter::PDFObjectElement* pAnnot = pAnnotReference->LookupObject();
CPPUNIT_ASSERT(pAnnot);
CPPUNIT_ASSERT_EQUAL(OString("Annot"), static_cast<vcl::filter::PDFNameElement*>(pAnnot->Lookup("Type"))->GetValue());
CPPUNIT_ASSERT_EQUAL(
OString("Annot"),
static_cast<vcl::filter::PDFNameElement*>(pAnnot->Lookup("Type"))->GetValue());
// Get the Action -> Rendition -> MediaClip -> FileSpec.
auto pAction = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pAnnot->Lookup("A"));
CPPUNIT_ASSERT(pAction);
auto pRendition = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pAction->LookupElement("R"));
CPPUNIT_ASSERT(pRendition);
auto pMediaClip = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pRendition->LookupElement("C"));
auto pMediaClip
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pRendition->LookupElement("C"));
CPPUNIT_ASSERT(pMediaClip);
auto pFileSpec = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pMediaClip->LookupElement("D"));
auto pFileSpec
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pMediaClip->LookupElement("D"));
CPPUNIT_ASSERT(pFileSpec);
// Make sure the filespec refers to an embedded file.
// This key was missing, the embedded video was handled as a linked one.
@@ -404,7 +411,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106206)
// And also that it's not an invalid one.
OString aInvalidImage("/Im0");
it = std::search(pStart, pEnd, aInvalidImage.getStr(), aInvalidImage.getStr() + aInvalidImage.getLength());
it = std::search(pStart, pEnd, aInvalidImage.getStr(),
aInvalidImage.getStr() + aInvalidImage.getLength());
// This failed, object #0 was referenced.
CPPUNIT_ASSERT(bool(it == pEnd));
}
@@ -433,10 +441,12 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf109143)
// Get access to the only image on the only page.
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pXObjects->GetItems().size());
vcl::filter::PDFObjectElement* pXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pXObject
= pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
CPPUNIT_ASSERT(pXObject);
// Make sure it's re-compressed.
@@ -470,23 +480,29 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106972)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pXObjects->GetItems().size());
vcl::filter::PDFObjectElement* pXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pXObject
= pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
CPPUNIT_ASSERT(pXObject);
// Get access to the only image inside the form object.
auto pFormResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
auto pFormResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
CPPUNIT_ASSERT(pFormResources);
auto pImages = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pFormResources->LookupElement("XObject"));
auto pImages = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pFormResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pImages);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pImages->GetItems().size());
vcl::filter::PDFObjectElement* pImage = pImages->LookupObject(pImages->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pImage
= pImages->LookupObject(pImages->GetItems().begin()->first);
CPPUNIT_ASSERT(pImage);
// Assert resources of the image.
auto pImageResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pImage->Lookup("Resources"));
auto pImageResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pImage->Lookup("Resources"));
CPPUNIT_ASSERT(pImageResources);
// This failed: the PDF image had no Font resource.
CPPUNIT_ASSERT(pImageResources->LookupElement("Font"));
@@ -514,10 +530,12 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106972Pdf17)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pXObjects->GetItems().size());
vcl::filter::PDFObjectElement* pXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pXObject
= pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
CPPUNIT_ASSERT(pXObject);
// Assert that we now attempt to preserve the original PDF data, even if
@@ -527,8 +545,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106972Pdf17)
CPPUNIT_TEST_FIXTURE(PdfExportTest, testSofthyphenPos)
{
// No need to run it on Windows, since it would use GDI printing, and not trigger PDF export
// which is the intent of the test.
// No need to run it on Windows, since it would use GDI printing, and not trigger PDF export
// which is the intent of the test.
// FIXME: Why does this fail on macOS?
#if !defined MACOSX && !defined _WIN32
@@ -541,10 +559,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testSofthyphenPos)
uno::Reference<view::XPrintable> xPrintable(mxComponent, uno::UNO_QUERY);
CPPUNIT_ASSERT(xPrintable.is());
uno::Sequence<beans::PropertyValue> aOptions(comphelper::InitPropertySequence(
{
{"FileName", uno::makeAny(maTempFile.GetURL())},
{"Wait", uno::makeAny(true)}
}));
{ { "FileName", uno::makeAny(maTempFile.GetURL()) }, { "Wait", uno::makeAny(true) } }));
xPrintable->print(aOptions);
// Parse the export result with pdfium.
@@ -597,10 +612,12 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107013)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pXObjects->GetItems().size());
vcl::filter::PDFObjectElement* pXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pXObject
= pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
// This failed, the reference to the image was created, but not the image.
CPPUNIT_ASSERT(pXObject);
}
@@ -615,24 +632,31 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107018)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pXObjects->GetItems().size());
vcl::filter::PDFObjectElement* pXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pXObject
= pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
CPPUNIT_ASSERT(pXObject);
// Get access to the form object inside the image.
auto pXObjectResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
auto pXObjectResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
CPPUNIT_ASSERT(pXObjectResources);
auto pXObjectForms = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObjectResources->LookupElement("XObject"));
auto pXObjectForms = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pXObjectResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pXObjectForms);
vcl::filter::PDFObjectElement* pForm = pXObjectForms->LookupObject(pXObjectForms->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pForm
= pXObjectForms->LookupObject(pXObjectForms->GetItems().begin()->first);
CPPUNIT_ASSERT(pForm);
// Get access to Resources -> Font -> F1 of the form.
auto pFormResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pForm->Lookup("Resources"));
auto pFormResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pForm->Lookup("Resources"));
CPPUNIT_ASSERT(pFormResources);
auto pFonts = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pFormResources->LookupElement("Font"));
auto pFonts
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pFormResources->LookupElement("Font"));
CPPUNIT_ASSERT(pFonts);
auto pF1Ref = dynamic_cast<vcl::filter::PDFReferenceElement*>(pFonts->LookupElement("F1"));
CPPUNIT_ASSERT(pF1Ref);
@@ -663,18 +687,23 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107089)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aPages.size());
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pXObjects->GetItems().size());
vcl::filter::PDFObjectElement* pXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pXObject
= pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
CPPUNIT_ASSERT(pXObject);
// Get access to the form object inside the image.
auto pXObjectResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
auto pXObjectResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
CPPUNIT_ASSERT(pXObjectResources);
auto pXObjectForms = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObjectResources->LookupElement("XObject"));
auto pXObjectForms = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pXObjectResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pXObjectForms);
vcl::filter::PDFObjectElement* pForm = pXObjectForms->LookupObject(pXObjectForms->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pForm
= pXObjectForms->LookupObject(pXObjectForms->GetItems().begin()->first);
CPPUNIT_ASSERT(pForm);
// Make sure 'Hello' is part of the form object's stream.
@@ -732,7 +761,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf99680)
const char* pEnd = pStart + aUncompressed.GetSize();
size_t nSaveCount = std::count(pStart, pEnd, 'q');
size_t nRestoreCount = std::count(pStart, pEnd, 'Q');
CPPUNIT_ASSERT_EQUAL_MESSAGE("Save/restore graphic state operators count mismatch!", nSaveCount, nRestoreCount);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Save/restore graphic state operators count mismatch!", nSaveCount,
nRestoreCount);
}
CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf99680_2)
@@ -773,7 +803,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf99680_2)
const char* pEnd = pStart + aUncompressed.GetSize();
size_t nSaveCount = std::count(pStart, pEnd, 'q');
size_t nRestoreCount = std::count(pStart, pEnd, 'Q');
CPPUNIT_ASSERT_EQUAL_MESSAGE("Save/restore graphic state operators count mismatch!", nSaveCount, nRestoreCount);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Save/restore graphic state operators count mismatch!",
nSaveCount, nRestoreCount);
}
}
@@ -828,7 +859,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf108963)
// The path described a yellow rectangle, but it was not rotated.
int nSegments = pPdfPageObject->getPathSegmentCount();
CPPUNIT_ASSERT_EQUAL(5, nSegments);
std::unique_ptr<vcl::pdf::PDFiumPathSegment> pSegment = pPdfPageObject->getPathSegment(0);
std::unique_ptr<vcl::pdf::PDFiumPathSegment> pSegment
= pPdfPageObject->getPathSegment(0);
CPPUNIT_ASSERT_EQUAL(FPDF_SEGMENT_MOVETO, pSegment->getType());
basegfx::B2DPoint aPoint = pSegment->getPoint();
CPPUNIT_ASSERT_EQUAL(245395, static_cast<int>(round(aPoint.getX() * 1000)));
@@ -881,23 +913,24 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf118244_radioButtonGroup)
// There are eight radio buttons.
auto pAnnots = dynamic_cast<vcl::filter::PDFArrayElement*>(aPages[0]->Lookup("Annots"));
CPPUNIT_ASSERT(pAnnots);
CPPUNIT_ASSERT_EQUAL_MESSAGE("# of radio buttons",static_cast<size_t>(8), pAnnots->GetElements().size());
CPPUNIT_ASSERT_EQUAL_MESSAGE("# of radio buttons", static_cast<size_t>(8),
pAnnots->GetElements().size());
sal_uInt32 nRadioGroups = 0;
for ( const auto& aElement : aDocument.GetElements() )
for (const auto& aElement : aDocument.GetElements())
{
auto pObject = dynamic_cast<vcl::filter::PDFObjectElement*>(aElement.get());
if ( !pObject )
if (!pObject)
continue;
auto pType = dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("FT"));
if ( pType && pType->GetValue() == "Btn" )
if (pType && pType->GetValue() == "Btn")
{
auto pKids = dynamic_cast<vcl::filter::PDFArrayElement*>(pObject->Lookup("Kids"));
if ( pKids )
if (pKids)
{
size_t expectedSize = 2;
++nRadioGroups;
if ( nRadioGroups == 3 )
if (nRadioGroups == 3)
expectedSize = 3;
CPPUNIT_ASSERT_EQUAL(expectedSize, pKids->GetElements().size());
}
@@ -926,7 +959,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf115117_1)
auto pType = dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("Type"));
if (pType && pType->GetValue() == "Font")
{
auto pToUnicodeRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(pObject->Lookup("ToUnicode"));
auto pToUnicodeRef
= dynamic_cast<vcl::filter::PDFReferenceElement*>(pObject->Lookup("ToUnicode"));
CPPUNIT_ASSERT(pToUnicodeRef);
pToUnicode = pToUnicodeRef->LookupObject();
break;
@@ -991,7 +1025,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf115117_2)
auto pType = dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("Type"));
if (pType && pType->GetValue() == "Font")
{
auto pToUnicodeRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(pObject->Lookup("ToUnicode"));
auto pToUnicodeRef
= dynamic_cast<vcl::filter::PDFReferenceElement*>(pObject->Lookup("ToUnicode"));
CPPUNIT_ASSERT(pToUnicodeRef);
pToUnicode = pToUnicodeRef->LookupObject();
break;
@@ -1133,11 +1168,14 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_1)
auto pType = dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("Type"));
if (pType && pType->GetValue() == "Font")
{
auto pName = dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("BaseFont"));
auto pName
= dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("BaseFont"));
auto aName = pName->GetValue().copy(7); // skip the subset id
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected font name", OString("Amiri-Regular"), aName);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected font name", OString("Amiri-Regular"),
aName);
auto pToUnicodeRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(pObject->Lookup("ToUnicode"));
auto pToUnicodeRef
= dynamic_cast<vcl::filter::PDFReferenceElement*>(pObject->Lookup("ToUnicode"));
CPPUNIT_ASSERT(pToUnicodeRef);
pToUnicode = pToUnicodeRef->LookupObject();
break;
@@ -1162,7 +1200,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_1)
std::string aCmap("1 beginbfchar\n"
"<01> <0020>\n"
"endbfchar");
std::string aData(static_cast<const char*>(aObjectStream.GetData()), aObjectStream.GetSize());
std::string aData(static_cast<const char*>(aObjectStream.GetData()),
aObjectStream.GetSize());
auto nPos = aData.find(aCmap);
CPPUNIT_ASSERT(nPos != std::string::npos);
}
@@ -1186,7 +1225,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_1)
CPPUNIT_ASSERT(aZCodec.EndCompression());
// Make sure the expected ActualText is present.
std::string aData(static_cast<const char*>(aUncompressed.GetData()), aUncompressed.GetSize());
std::string aData(static_cast<const char*>(aUncompressed.GetData()),
aUncompressed.GetSize());
std::string aActualText("/Span<</ActualText<");
size_t nCount = 0;
@@ -1196,7 +1236,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_1)
nCount++;
nPos += aActualText.length();
}
CPPUNIT_ASSERT_EQUAL_MESSAGE("The should be one ActualText entry!", static_cast<size_t>(1), nCount);
CPPUNIT_ASSERT_EQUAL_MESSAGE("The should be one ActualText entry!", static_cast<size_t>(1),
nCount);
aActualText = "/Span<</ActualText<FEFF00A0>>>";
nPos = aData.find(aActualText);
@@ -1224,11 +1265,14 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_2)
auto pType = dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("Type"));
if (pType && pType->GetValue() == "Font")
{
auto pName = dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("BaseFont"));
auto pName
= dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("BaseFont"));
auto aName = pName->GetValue().copy(7); // skip the subset id
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected font name", OString("ReemKufi-Regular"), aName);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected font name", OString("ReemKufi-Regular"),
aName);
auto pToUnicodeRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(pObject->Lookup("ToUnicode"));
auto pToUnicodeRef
= dynamic_cast<vcl::filter::PDFReferenceElement*>(pObject->Lookup("ToUnicode"));
CPPUNIT_ASSERT(pToUnicodeRef);
pToUnicode = pToUnicodeRef->LookupObject();
break;
@@ -1255,7 +1299,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_2)
"<09> <0628>\n"
"<0B> <0623>\n"
"endbfchar");
std::string aData(static_cast<const char*>(aObjectStream.GetData()), aObjectStream.GetSize());
std::string aData(static_cast<const char*>(aObjectStream.GetData()),
aObjectStream.GetSize());
auto nPos = aData.find(aCmap);
CPPUNIT_ASSERT(nPos != std::string::npos);
}
@@ -1279,7 +1324,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_2)
CPPUNIT_ASSERT(aZCodec.EndCompression());
// Make sure the expected ActualText is present.
std::string aData(static_cast<const char*>(aUncompressed.GetData()), aUncompressed.GetSize());
std::string aData(static_cast<const char*>(aUncompressed.GetData()),
aUncompressed.GetSize());
std::vector<std::string> aCodes({ "0632", "062C", "0628", "0623" });
std::string aActualText("/Span<</ActualText<");
@@ -1290,7 +1336,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_2)
nCount++;
nPos += aActualText.length();
}
CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of ActualText entries does not match!", aCodes.size(), nCount);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of ActualText entries does not match!", aCodes.size(),
nCount);
for (const auto& aCode : aCodes)
{
@@ -1321,11 +1368,14 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_3)
auto pType = dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("Type"));
if (pType && pType->GetValue() == "Font")
{
auto pName = dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("BaseFont"));
auto pName
= dynamic_cast<vcl::filter::PDFNameElement*>(pObject->Lookup("BaseFont"));
auto aName = pName->GetValue().copy(7); // skip the subset id
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected font name", OString("GentiumBasic"), aName);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected font name", OString("GentiumBasic"),
aName);
auto pToUnicodeRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(pObject->Lookup("ToUnicode"));
auto pToUnicodeRef
= dynamic_cast<vcl::filter::PDFReferenceElement*>(pObject->Lookup("ToUnicode"));
CPPUNIT_ASSERT(pToUnicodeRef);
pToUnicode = pToUnicodeRef->LookupObject();
break;
@@ -1346,7 +1396,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_3)
"<01> <1ECB0331030B>\n"
"<05> <0020>\n"
"endbfchar");
std::string aData(static_cast<const char*>(aObjectStream.GetData()), aObjectStream.GetSize());
std::string aData(static_cast<const char*>(aObjectStream.GetData()),
aObjectStream.GetSize());
auto nPos = aData.find(aCmap);
CPPUNIT_ASSERT(nPos != std::string::npos);
}
@@ -1370,7 +1421,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_3)
CPPUNIT_ASSERT(aZCodec.EndCompression());
// Make sure the expected ActualText is present.
std::string aData(static_cast<const char*>(aUncompressed.GetData()), aUncompressed.GetSize());
std::string aData(static_cast<const char*>(aUncompressed.GetData()),
aUncompressed.GetSize());
std::string aActualText("/Span<</ActualText<FEFF1ECB0331030B>>>");
size_t nCount = 0;
@@ -1380,7 +1432,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf66597_3)
nCount++;
nPos += aActualText.length();
}
CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of ActualText entries does not match!", static_cast<size_t>(4), nCount);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Number of ActualText entries does not match!",
static_cast<size_t>(4), nCount);
}
#endif
}
@@ -1684,38 +1737,40 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf121615)
// Get access to the only image on the only page.
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pXObjects->GetItems().size());
vcl::filter::PDFObjectElement* pXObject = pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pXObject
= pXObjects->LookupObject(pXObjects->GetItems().begin()->first);
CPPUNIT_ASSERT(pXObject);
vcl::filter::PDFStreamElement* pStream = pXObject->GetStream();
CPPUNIT_ASSERT(pStream);
SvMemoryStream& rObjectStream = pStream->GetMemory();
// Load the embedded image.
rObjectStream.Seek( 0 );
rObjectStream.Seek(0);
GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
Graphic aGraphic;
sal_uInt16 format;
ErrCode bResult = rFilter.ImportGraphic(aGraphic, OUString( "import" ), rObjectStream,
GRFILTER_FORMAT_DONTKNOW, &format);
ErrCode bResult = rFilter.ImportGraphic(aGraphic, OUString("import"), rObjectStream,
GRFILTER_FORMAT_DONTKNOW, &format);
CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, bResult);
// The image should be grayscale 8bit JPEG.
sal_uInt16 jpegFormat = rFilter.GetImportFormatNumberForShortName( JPG_SHORTNAME );
CPPUNIT_ASSERT( jpegFormat != GRFILTER_FORMAT_NOTFOUND );
CPPUNIT_ASSERT_EQUAL( jpegFormat, format );
sal_uInt16 jpegFormat = rFilter.GetImportFormatNumberForShortName(JPG_SHORTNAME);
CPPUNIT_ASSERT(jpegFormat != GRFILTER_FORMAT_NOTFOUND);
CPPUNIT_ASSERT_EQUAL(jpegFormat, format);
BitmapEx aBitmap = aGraphic.GetBitmapEx();
CPPUNIT_ASSERT_EQUAL( tools::Long(200), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL( tools::Long(300), aBitmap.GetSizePixel().Height());
CPPUNIT_ASSERT_EQUAL( 8, int(aBitmap.GetBitCount()));
CPPUNIT_ASSERT_EQUAL(tools::Long(200), aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(300), aBitmap.GetSizePixel().Height());
CPPUNIT_ASSERT_EQUAL(8, int(aBitmap.GetBitCount()));
// tdf#121615 was caused by broken handling of data width with 8bit color,
// so the test image has some black in the bottomright corner, check it's there
CPPUNIT_ASSERT_EQUAL( COL_WHITE, aBitmap.GetPixelColor( 0, 0 ));
CPPUNIT_ASSERT_EQUAL( COL_WHITE, aBitmap.GetPixelColor( 0, 299 ));
CPPUNIT_ASSERT_EQUAL( COL_WHITE, aBitmap.GetPixelColor( 199, 0 ));
CPPUNIT_ASSERT_EQUAL( COL_BLACK, aBitmap.GetPixelColor( 199, 299 ));
CPPUNIT_ASSERT_EQUAL(COL_WHITE, aBitmap.GetPixelColor(0, 0));
CPPUNIT_ASSERT_EQUAL(COL_WHITE, aBitmap.GetPixelColor(0, 299));
CPPUNIT_ASSERT_EQUAL(COL_WHITE, aBitmap.GetPixelColor(199, 0));
CPPUNIT_ASSERT_EQUAL(COL_BLACK, aBitmap.GetPixelColor(199, 299));
}
CPPUNIT_TEST_FIXTURE(PdfExportTest, testTocLink)
@@ -2071,20 +2126,23 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testMultiPagePDF)
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pXObjects->GetItems().size()); // 3 PDFs as Form XObjects
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3),
pXObjects->GetItems().size()); // 3 PDFs as Form XObjects
std::vector<OString> rIDs;
for (auto const & rPair : pXObjects->GetItems()) {
for (auto const& rPair : pXObjects->GetItems())
{
rIDs.push_back(rPair.first);
}
// Let's check the embedded PDF pages - just make sure the size differs,
// which should indicate we don't have 3 times the same page.
{ // embedded PDF page 1
{ // embedded PDF page 1
vcl::filter::PDFObjectElement* pXObject1 = pXObjects->LookupObject(rIDs[0]);
CPPUNIT_ASSERT(pXObject1);
CPPUNIT_ASSERT_EQUAL(OString("Im19"), rIDs[0]);
@@ -2093,11 +2151,14 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testMultiPagePDF)
CPPUNIT_ASSERT(pSubtype1);
CPPUNIT_ASSERT_EQUAL(OString("Form"), pSubtype1->GetValue());
auto pXObjectResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject1->Lookup("Resources"));
auto pXObjectResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject1->Lookup("Resources"));
CPPUNIT_ASSERT(pXObjectResources);
auto pXObjectForms = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObjectResources->LookupElement("XObject"));
auto pXObjectForms = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pXObjectResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pXObjectForms);
vcl::filter::PDFObjectElement* pForm = pXObjectForms->LookupObject(pXObjectForms->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pForm
= pXObjectForms->LookupObject(pXObjectForms->GetItems().begin()->first);
CPPUNIT_ASSERT(pForm);
vcl::filter::PDFStreamElement* pStream = pForm->GetStream();
@@ -2109,7 +2170,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testMultiPagePDF)
CPPUNIT_ASSERT_EQUAL(sal_uInt64(230), rObjectStream.remainingSize());
}
{ // embedded PDF page 2
{ // embedded PDF page 2
vcl::filter::PDFObjectElement* pXObject2 = pXObjects->LookupObject(rIDs[1]);
CPPUNIT_ASSERT(pXObject2);
CPPUNIT_ASSERT_EQUAL(OString("Im24"), rIDs[1]);
@@ -2118,11 +2179,14 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testMultiPagePDF)
CPPUNIT_ASSERT(pSubtype2);
CPPUNIT_ASSERT_EQUAL(OString("Form"), pSubtype2->GetValue());
auto pXObjectResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject2->Lookup("Resources"));
auto pXObjectResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject2->Lookup("Resources"));
CPPUNIT_ASSERT(pXObjectResources);
auto pXObjectForms = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObjectResources->LookupElement("XObject"));
auto pXObjectForms = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pXObjectResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pXObjectForms);
vcl::filter::PDFObjectElement* pForm = pXObjectForms->LookupObject(pXObjectForms->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pForm
= pXObjectForms->LookupObject(pXObjectForms->GetItems().begin()->first);
CPPUNIT_ASSERT(pForm);
vcl::filter::PDFStreamElement* pStream = pForm->GetStream();
@@ -2134,7 +2198,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testMultiPagePDF)
CPPUNIT_ASSERT_EQUAL(sal_uInt64(309), rObjectStream.remainingSize());
}
{ // embedded PDF page 3
{ // embedded PDF page 3
vcl::filter::PDFObjectElement* pXObject3 = pXObjects->LookupObject(rIDs[2]);
CPPUNIT_ASSERT(pXObject3);
CPPUNIT_ASSERT_EQUAL(OString("Im4"), rIDs[2]);
@@ -2143,11 +2207,14 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testMultiPagePDF)
CPPUNIT_ASSERT(pSubtype3);
CPPUNIT_ASSERT_EQUAL(OString("Form"), pSubtype3->GetValue());
auto pXObjectResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject3->Lookup("Resources"));
auto pXObjectResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject3->Lookup("Resources"));
CPPUNIT_ASSERT(pXObjectResources);
auto pXObjectForms = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObjectResources->LookupElement("XObject"));
auto pXObjectForms = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pXObjectResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pXObjectForms);
vcl::filter::PDFObjectElement* pForm = pXObjectForms->LookupObject(pXObjectForms->GetItems().begin()->first);
vcl::filter::PDFObjectElement* pForm
= pXObjectForms->LookupObject(pXObjectForms->GetItems().begin()->first);
CPPUNIT_ASSERT(pForm);
vcl::filter::PDFStreamElement* pStream = pForm->GetStream();
@@ -2247,11 +2314,12 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testReexportPDF)
vcl::filter::PDFObjectElement* pResources = aPages[0]->LookupObject("Resources");
CPPUNIT_ASSERT(pResources);
auto pXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
auto pXObjects
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pResources->Lookup("XObject"));
CPPUNIT_ASSERT(pXObjects);
std::vector<OString> rIDs;
for (auto const & rPair : pXObjects->GetItems())
for (auto const& rPair : pXObjects->GetItems())
rIDs.push_back(rPair.first);
CPPUNIT_ASSERT_EQUAL(size_t(2), rIDs.size());
@@ -2270,54 +2338,66 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testReexportPDF)
CPPUNIT_ASSERT(pSubtype);
CPPUNIT_ASSERT_EQUAL(OString("Form"), pSubtype->GetValue());
auto pInnerResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
auto pInnerResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
CPPUNIT_ASSERT(pInnerResources);
auto pInnerXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pInnerResources->LookupElement("XObject"));
auto pInnerXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pInnerResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pInnerXObjects);
CPPUNIT_ASSERT_EQUAL(size_t(1), pInnerXObjects->GetItems().size());
OString aInnerObjectID = pInnerXObjects->GetItems().begin()->first;
CPPUNIT_ASSERT_EQUAL(OString("Im13"), aInnerObjectID);
vcl::filter::PDFObjectElement* pInnerXObject = pInnerXObjects->LookupObject(aInnerObjectID);
vcl::filter::PDFObjectElement* pInnerXObject
= pInnerXObjects->LookupObject(aInnerObjectID);
CPPUNIT_ASSERT(pInnerXObject);
auto pInnerSubtype = dynamic_cast<vcl::filter::PDFNameElement*>(pInnerXObject->Lookup("Subtype"));
auto pInnerSubtype
= dynamic_cast<vcl::filter::PDFNameElement*>(pInnerXObject->Lookup("Subtype"));
CPPUNIT_ASSERT(pInnerSubtype);
CPPUNIT_ASSERT_EQUAL(OString("Form"), pInnerSubtype->GetValue());
auto pInnerInnerResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pInnerXObject->Lookup("Resources"));
auto pInnerInnerResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pInnerXObject->Lookup("Resources"));
CPPUNIT_ASSERT(pInnerInnerResources);
auto pInnerInnerXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pInnerInnerResources->LookupElement("XObject"));
auto pInnerInnerXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pInnerInnerResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pInnerInnerXObjects);
CPPUNIT_ASSERT_EQUAL(size_t(2), pInnerInnerXObjects->GetItems().size());
std::vector<OString> aBitmapIDs1;
for (auto const & rPair : pInnerInnerXObjects->GetItems())
for (auto const& rPair : pInnerInnerXObjects->GetItems())
aBitmapIDs1.push_back(rPair.first);
{
CPPUNIT_ASSERT_EQUAL(OString("Im11"), aBitmapIDs1[0]);
auto pRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(pInnerInnerXObjects->LookupElement(aBitmapIDs1[0]));
auto pRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(
pInnerInnerXObjects->LookupElement(aBitmapIDs1[0]));
CPPUNIT_ASSERT(pRef);
aBitmapRefs1.push_back(pRef->GetObjectValue());
CPPUNIT_ASSERT_EQUAL(0, pRef->GetGenerationValue());
vcl::filter::PDFObjectElement* pBitmap = pInnerInnerXObjects->LookupObject(aBitmapIDs1[0]);
vcl::filter::PDFObjectElement* pBitmap
= pInnerInnerXObjects->LookupObject(aBitmapIDs1[0]);
CPPUNIT_ASSERT(pBitmap);
auto pBitmapSubtype = dynamic_cast<vcl::filter::PDFNameElement*>(pBitmap->Lookup("Subtype"));
auto pBitmapSubtype
= dynamic_cast<vcl::filter::PDFNameElement*>(pBitmap->Lookup("Subtype"));
CPPUNIT_ASSERT(pBitmapSubtype);
CPPUNIT_ASSERT_EQUAL(OString("Image"), pBitmapSubtype->GetValue());
}
{
CPPUNIT_ASSERT_EQUAL(OString("Im5"), aBitmapIDs1[1]);
auto pRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(pInnerInnerXObjects->LookupElement(aBitmapIDs1[1]));
auto pRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(
pInnerInnerXObjects->LookupElement(aBitmapIDs1[1]));
CPPUNIT_ASSERT(pRef);
aBitmapRefs1.push_back(pRef->GetObjectValue());
CPPUNIT_ASSERT_EQUAL(0, pRef->GetGenerationValue());
vcl::filter::PDFObjectElement* pBitmap = pInnerInnerXObjects->LookupObject(aBitmapIDs1[1]);
vcl::filter::PDFObjectElement* pBitmap
= pInnerInnerXObjects->LookupObject(aBitmapIDs1[1]);
CPPUNIT_ASSERT(pBitmap);
auto pBitmapSubtype = dynamic_cast<vcl::filter::PDFNameElement*>(pBitmap->Lookup("Subtype"));
auto pBitmapSubtype
= dynamic_cast<vcl::filter::PDFNameElement*>(pBitmap->Lookup("Subtype"));
CPPUNIT_ASSERT(pBitmapSubtype);
CPPUNIT_ASSERT_EQUAL(OString("Image"), pBitmapSubtype->GetValue());
}
@@ -2334,54 +2414,66 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testReexportPDF)
CPPUNIT_ASSERT(pSubtype);
CPPUNIT_ASSERT_EQUAL(OString("Form"), pSubtype->GetValue());
auto pInnerResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
auto pInnerResources
= dynamic_cast<vcl::filter::PDFDictionaryElement*>(pXObject->Lookup("Resources"));
CPPUNIT_ASSERT(pInnerResources);
auto pInnerXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pInnerResources->LookupElement("XObject"));
auto pInnerXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pInnerResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pInnerXObjects);
CPPUNIT_ASSERT_EQUAL(size_t(1), pInnerXObjects->GetItems().size());
OString aInnerObjectID = pInnerXObjects->GetItems().begin()->first;
CPPUNIT_ASSERT_EQUAL(OString("Im5"), aInnerObjectID);
vcl::filter::PDFObjectElement* pInnerXObject = pInnerXObjects->LookupObject(aInnerObjectID);
vcl::filter::PDFObjectElement* pInnerXObject
= pInnerXObjects->LookupObject(aInnerObjectID);
CPPUNIT_ASSERT(pInnerXObject);
auto pInnerSubtype = dynamic_cast<vcl::filter::PDFNameElement*>(pInnerXObject->Lookup("Subtype"));
auto pInnerSubtype
= dynamic_cast<vcl::filter::PDFNameElement*>(pInnerXObject->Lookup("Subtype"));
CPPUNIT_ASSERT(pInnerSubtype);
CPPUNIT_ASSERT_EQUAL(OString("Form"), pInnerSubtype->GetValue());
auto pInnerInnerResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pInnerXObject->Lookup("Resources"));
auto pInnerInnerResources = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pInnerXObject->Lookup("Resources"));
CPPUNIT_ASSERT(pInnerInnerResources);
auto pInnerInnerXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(pInnerInnerResources->LookupElement("XObject"));
auto pInnerInnerXObjects = dynamic_cast<vcl::filter::PDFDictionaryElement*>(
pInnerInnerResources->LookupElement("XObject"));
CPPUNIT_ASSERT(pInnerInnerXObjects);
CPPUNIT_ASSERT_EQUAL(size_t(2), pInnerInnerXObjects->GetItems().size());
std::vector<OString> aBitmapIDs2;
for (auto const & rPair : pInnerInnerXObjects->GetItems())
for (auto const& rPair : pInnerInnerXObjects->GetItems())
aBitmapIDs2.push_back(rPair.first);
{
CPPUNIT_ASSERT_EQUAL(OString("Im11"), aBitmapIDs2[0]);
auto pRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(pInnerInnerXObjects->LookupElement(aBitmapIDs2[0]));
auto pRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(
pInnerInnerXObjects->LookupElement(aBitmapIDs2[0]));
CPPUNIT_ASSERT(pRef);
aBitmapRefs2.push_back(pRef->GetObjectValue());
CPPUNIT_ASSERT_EQUAL(0, pRef->GetGenerationValue());
vcl::filter::PDFObjectElement* pBitmap = pInnerInnerXObjects->LookupObject(aBitmapIDs2[0]);
vcl::filter::PDFObjectElement* pBitmap
= pInnerInnerXObjects->LookupObject(aBitmapIDs2[0]);
CPPUNIT_ASSERT(pBitmap);
auto pBitmapSubtype = dynamic_cast<vcl::filter::PDFNameElement*>(pBitmap->Lookup("Subtype"));
auto pBitmapSubtype
= dynamic_cast<vcl::filter::PDFNameElement*>(pBitmap->Lookup("Subtype"));
CPPUNIT_ASSERT(pBitmapSubtype);
CPPUNIT_ASSERT_EQUAL(OString("Image"), pBitmapSubtype->GetValue());
}
{
CPPUNIT_ASSERT_EQUAL(OString("Im5"), aBitmapIDs2[1]);
auto pRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(pInnerInnerXObjects->LookupElement(aBitmapIDs2[1]));
auto pRef = dynamic_cast<vcl::filter::PDFReferenceElement*>(
pInnerInnerXObjects->LookupElement(aBitmapIDs2[1]));
CPPUNIT_ASSERT(pRef);
aBitmapRefs2.push_back(pRef->GetObjectValue());
CPPUNIT_ASSERT_EQUAL(0, pRef->GetGenerationValue());
vcl::filter::PDFObjectElement* pBitmap = pInnerInnerXObjects->LookupObject(aBitmapIDs2[1]);
vcl::filter::PDFObjectElement* pBitmap
= pInnerInnerXObjects->LookupObject(aBitmapIDs2[1]);
CPPUNIT_ASSERT(pBitmap);
auto pBitmapSubtype = dynamic_cast<vcl::filter::PDFNameElement*>(pBitmap->Lookup("Subtype"));
auto pBitmapSubtype
= dynamic_cast<vcl::filter::PDFNameElement*>(pBitmap->Lookup("Subtype"));
CPPUNIT_ASSERT(pBitmapSubtype);
CPPUNIT_ASSERT_EQUAL(OString("Image"), pBitmapSubtype->GetValue());
}
@@ -2393,7 +2485,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testReexportPDF)
#endif
}
}
CPPUNIT_PLUGIN_IMPLEMENT();
+2 -7
View File
@@ -36,19 +36,14 @@ public:
CPPUNIT_TEST_SUITE_END();
};
VclDialogsTest::VclDialogsTest()
{
}
VclDialogsTest::VclDialogsTest() {}
void VclDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
{
// fill map of known dialogs
}
VclPtr<VclAbstractDialog> VclDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
{
return nullptr;
}
VclPtr<VclAbstractDialog> VclDialogsTest::createDialogByID(sal_uInt32 /*nID*/) { return nullptr; }
void VclDialogsTest::openAnyDialog()
{
+13 -17
View File
@@ -11,21 +11,20 @@
namespace vcl
{
/*
* Map directly to css cursor styles to avoid further mapping in the client.
* Gtk (via gdk_cursor_new_from_name) also supports the same css cursor styles.
*
* This was created partially with help of the mappings in gtkdata.cxx.
* The list is incomplete as some cursor style simply aren't supported
* by css, it might turn out to be worth mapping some of these missing cursors
* to available cursors?
*/
/*
* Map directly to css cursor styles to avoid further mapping in the client.
* Gtk (via gdk_cursor_new_from_name) also supports the same css cursor styles.
*
* This was created partially with help of the mappings in gtkdata.cxx.
* The list is incomplete as some cursor style simply aren't supported
* by css, it might turn out to be worth mapping some of these missing cursors
* to available cursors?
*/
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning( disable : 4592)
#pragma warning(disable : 4592)
#endif
const std::map <PointerStyle, OString> gaLOKPointerMap {
const std::map<PointerStyle, OString> gaLOKPointerMap{
{ PointerStyle::Arrow, "default" },
// PointerStyle::Null ?
{ PointerStyle::Wait, "wait" },
@@ -67,15 +66,12 @@ namespace vcl
{ PointerStyle::TextVertical, "vertical-text" }
// Pivot Delete, TabSelectS through TabSelectSW
// PaintBrush, HideWhiteSpace, ShowWhiteSpace
};
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
ITiledRenderable::~ITiledRenderable()
{
}
ITiledRenderable::~ITiledRenderable() {}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -27,7 +27,7 @@
void Sound::Beep()
{
// #i91990#
if ( Application::IsHeadlessModeEnabled() )
if (Application::IsHeadlessModeEnabled())
return;
vcl::Window* pWindow = ImplGetDefaultWindow();
+2 -2
View File
@@ -17,7 +17,7 @@ BitmapFilter::BitmapFilter() {}
BitmapFilter::~BitmapFilter() {}
bool BitmapFilter::Filter(BitmapEx& rBmpEx, BitmapFilter const & rFilter)
bool BitmapFilter::Filter(BitmapEx& rBmpEx, BitmapFilter const& rFilter)
{
BitmapEx aTmpBmpEx(rFilter.execute(rBmpEx));
@@ -31,7 +31,7 @@ bool BitmapFilter::Filter(BitmapEx& rBmpEx, BitmapFilter const & rFilter)
return true;
}
bool BitmapFilter::Filter(Animation& rAnimation, BitmapFilter const & rFilter)
bool BitmapFilter::Filter(Animation& rAnimation, BitmapFilter const& rFilter)
{
SAL_WARN_IF(rAnimation.IsInAnimation(), "vcl", "Animation modified while it is animated");
+3 -2
View File
@@ -10,11 +10,12 @@
#ifndef INCLUDED_VCL_SOURCE_CONTROL_THUMBPOS_HXX
#define INCLUDED_VCL_SOURCE_CONTROL_THUMBPOS_HXX
inline tools::Long ImplMulDiv( tools::Long nNumber, tools::Long nNumerator, tools::Long nDenominator )
inline tools::Long ImplMulDiv(tools::Long nNumber, tools::Long nNumerator, tools::Long nDenominator)
{
if (!nDenominator)
return 0;
double n = (static_cast<double>(nNumber) * static_cast<double>(nNumerator)) / static_cast<double>(nDenominator);
double n = (static_cast<double>(nNumber) * static_cast<double>(nNumerator))
/ static_cast<double>(nDenominator);
return static_cast<tools::Long>(n);
}
+1 -1
View File
@@ -23,7 +23,7 @@
#include <tools/solar.h>
#include <tools/stream.hxx>
sal_uInt8* ImplSearchEntry( sal_uInt8*, sal_uInt8 const *, sal_uLong, sal_uLong );
sal_uInt8* ImplSearchEntry(sal_uInt8*, sal_uInt8 const*, sal_uLong, sal_uLong);
extern bool isPCT(SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen);
+1 -1
View File
@@ -22,7 +22,7 @@
#include <vcl/graph.hxx>
VCL_DLLPUBLIC bool ImportGIF( SvStream& rStream, Graphic& rGraphic );
VCL_DLLPUBLIC bool ImportGIF(SvStream& rStream, Graphic& rGraphic);
bool IsGIFAnimated(SvStream& rStream);
#endif // INCLUDED_VCL_SOURCE_FILTER_IGIF_GIFREAD_HXX
+1 -1
View File
@@ -22,7 +22,7 @@
#include <vcl/graph.hxx>
VCL_DLLPUBLIC bool ImportXBM( SvStream& rStream, Graphic& rGraphic );
VCL_DLLPUBLIC bool ImportXBM(SvStream& rStream, Graphic& rGraphic);
#endif // INCLUDED_VCL_SOURCE_FILTER_IXBM_XBMREAD_HXX
+1 -1
View File
@@ -24,7 +24,7 @@
class Graphic;
VCL_DLLPUBLIC bool ImportXPM( SvStream& rStream, Graphic& rGraphic );
VCL_DLLPUBLIC bool ImportXPM(SvStream& rStream, Graphic& rGraphic);
#endif // INCLUDED_VCL_SOURCE_FILTER_IXPM_XPMREAD_HXX
+3 -4
View File
@@ -24,12 +24,11 @@
class JpegTransform final
{
Degree10 maRotate;
SvStream& mrInputStream;
SvStream& mrOutputStream;
Degree10 maRotate;
SvStream& mrInputStream;
SvStream& mrOutputStream;
public:
JpegTransform(SvStream& rInputStream, SvStream& rOutputStream);
~JpegTransform();
+7 -9
View File
@@ -16,8 +16,8 @@
/* Include auto-config file to find out which system include files we need. */
#include <jconfig.h> /* auto configuration options */
#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */
#include <jconfig.h> /* auto configuration options */
#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */
/*
* We need the NULL macro and size_t typedef.
@@ -57,14 +57,14 @@
#ifdef NEED_BSD_STRINGS
#include <strings.h>
#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size))
#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size))
#define MEMZERO(target, size) bzero((void*)(target), (size_t)(size))
#define MEMCOPY(dest, src, size) bcopy((const void*)(src), (void*)(dest), (size_t)(size))
#else /* not BSD, assume ANSI/SysV string lib */
#include <string.h>
#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size))
#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size))
#define MEMZERO(target, size) memset((void*)(target), 0, (size_t)(size))
#define MEMCOPY(dest, src, size) memcpy((void*)(dest), (const void*)(src), (size_t)(size))
#endif
@@ -76,6 +76,4 @@
* we always use this SIZEOF() macro in place of using sizeof() directly.
*/
#define SIZEOF(object) ((size_t) sizeof(object))
#define SIZEOF(object) ((size_t)sizeof(object))
+61 -68
View File
@@ -44,23 +44,17 @@
namespace vcl
{
class PNGWriterImpl
{
public:
PNGWriterImpl(const BitmapEx& BmpEx,
const css::uno::Sequence<css::beans::PropertyValue>* pFilterData);
bool Write(SvStream& rOutStream);
std::vector<vcl::PNGWriter::ChunkData>& GetChunks()
{
return maChunkSeq;
}
std::vector<vcl::PNGWriter::ChunkData>& GetChunks() { return maChunkSeq; }
private:
std::vector<vcl::PNGWriter::ChunkData> maChunkSeq;
sal_Int32 mnCompLevel;
@@ -72,16 +66,17 @@ private:
BitmapReadAccess* mpMaskAccess;
ZCodec mpZCodec;
std::unique_ptr<sal_uInt8[]> mpDeflateInBuf; // as big as the size of a scanline + alphachannel + 1
std::unique_ptr<sal_uInt8[]> mpPreviousScan; // as big as mpDeflateInBuf
std::unique_ptr<sal_uInt8[]>
mpDeflateInBuf; // as big as the size of a scanline + alphachannel + 1
std::unique_ptr<sal_uInt8[]> mpPreviousScan; // as big as mpDeflateInBuf
std::unique_ptr<sal_uInt8[]> mpCurrentScan;
sal_uLong mnDeflateInSize;
sal_uLong mnWidth;
sal_uLong mnHeight;
sal_uInt8 mnBitsPerPixel;
sal_uInt8 mnFilterType; // 0 or 4;
sal_uLong mnBBP; // bytes per pixel ( needed for filtering )
sal_uInt8 mnFilterType; // 0 or 4;
sal_uLong mnBBP; // bytes per pixel ( needed for filtering )
bool mbTrueAlpha;
void ImplWritepHYs(const BitmapEx& rBitmapEx);
@@ -94,11 +89,11 @@ private:
void ImplOpenChunk(sal_uLong nChunkType);
void ImplWriteChunk(sal_uInt8 nNumb);
void ImplWriteChunk(sal_uInt32 nNumb);
void ImplWriteChunk(unsigned char const * pSource, sal_uInt32 nDatSize);
void ImplWriteChunk(unsigned char const* pSource, sal_uInt32 nDatSize);
};
PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBitmapEx,
const css::uno::Sequence<css::beans::PropertyValue>* pFilterData )
PNGWriterImpl::PNGWriterImpl(const BitmapEx& rBitmapEx,
const css::uno::Sequence<css::beans::PropertyValue>* pFilterData)
: mnCompLevel(PNG_DEF_COMPRESSION)
, mnInterlaced(0)
, mnMaxChunkSize(0)
@@ -153,7 +148,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBitmapEx,
{
if (mnBitsPerPixel <= 8 && aBitmapEx.IsAlpha())
{
aBmp.Convert( BmpConversion::N24Bit );
aBmp.Convert(BmpConversion::N24Bit);
mnBitsPerPixel = 24;
}
@@ -260,7 +255,7 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBitmapEx,
bool PNGWriterImpl::Write(SvStream& rOStm)
{
/* png signature is always an array of 8 bytes */
/* png signature is always an array of 8 bytes */
SvStreamEndian nOldMode = rOStm.GetEndian();
rOStm.SetEndian(SvStreamEndian::BIG);
rOStm.WriteUInt32(0x89504e47);
@@ -269,9 +264,9 @@ bool PNGWriterImpl::Write(SvStream& rOStm)
for (auto const& chunk : maChunkSeq)
{
sal_uInt32 nType = chunk.nType;
#if defined(__LITTLEENDIAN) || defined(OSL_LITENDIAN)
#if defined(__LITTLEENDIAN) || defined(OSL_LITENDIAN)
nType = OSL_SWAPDWORD(nType);
#endif
#endif
sal_uInt32 nCRC = rtl_crc32(0, &nType, 4);
sal_uInt32 nDataSize = chunk.aData.size();
if (nDataSize)
@@ -286,7 +281,6 @@ bool PNGWriterImpl::Write(SvStream& rOStm)
return mbStatus;
}
bool PNGWriterImpl::ImplWriteHeader()
{
ImplOpenChunk(PNGCHUNK_IHDR);
@@ -305,9 +299,9 @@ bool PNGWriterImpl::ImplWriteHeader()
sal_uInt8 nColorType = 2; // colortype:
// bit 0 -> palette is used
// bit 0 -> palette is used
if (mpAccess->HasPalette()) // bit 1 -> color is used
nColorType |= 1; // bit 2 -> alpha channel is used
nColorType |= 1; // bit 2 -> alpha channel is used
else
nBitDepth /= 3;
@@ -335,7 +329,7 @@ void PNGWriterImpl::ImplWritePalette()
ImplOpenChunk(PNGCHUNK_PLTE);
for ( sal_uLong i = 0; i < nCount; i++ )
for (sal_uLong i = 0; i < nCount; i++)
{
const BitmapColor& rColor = mpAccess->GetPaletteColor(i);
*pTmp++ = rColor.GetRed();
@@ -353,7 +347,8 @@ void PNGWriterImpl::ImplWriteTransparent()
for (sal_uLong n = 0; n <= nTransIndex; n++)
{
ImplWriteChunk((nTransIndex == n) ? static_cast<sal_uInt8>(0x0) : static_cast<sal_uInt8>(0xff));
ImplWriteChunk((nTransIndex == n) ? static_cast<sal_uInt8>(0x0)
: static_cast<sal_uInt8>(0xff));
}
}
@@ -367,8 +362,10 @@ void PNGWriterImpl::ImplWritepHYs(const BitmapEx& rBmpEx)
if (aPrefSize.Width() && aPrefSize.Height() && mnWidth && mnHeight)
{
ImplOpenChunk(PNGCHUNK_pHYs);
sal_uInt32 nPrefSizeX = static_cast<sal_uInt32>(100000.0 / (static_cast<double>(aPrefSize.Width()) / mnWidth) + 0.5);
sal_uInt32 nPrefSizeY = static_cast<sal_uInt32>(100000.0 / (static_cast<double>(aPrefSize.Height()) / mnHeight) + 0.5);
sal_uInt32 nPrefSizeX = static_cast<sal_uInt32>(
100000.0 / (static_cast<double>(aPrefSize.Width()) / mnWidth) + 0.5);
sal_uInt32 nPrefSizeY = static_cast<sal_uInt32>(
100000.0 / (static_cast<double>(aPrefSize.Height()) / mnHeight) + 0.5);
ImplWriteChunk(nPrefSizeX);
ImplWriteChunk(nPrefSizeY);
ImplWriteChunk(sal_uInt8(1)); // nMapUnit
@@ -453,7 +450,7 @@ void PNGWriterImpl::ImplWriteIDAT()
{
for (nY = 1; nY < mnHeight; nY += 2)
{
mpZCodec.Write(aOStm, mpDeflateInBuf.get(), ImplGetFilter (nY));
mpZCodec.Write(aOStm, mpDeflateInBuf.get(), ImplGetFilter(nY));
}
}
}
@@ -468,11 +465,14 @@ void PNGWriterImpl::ImplWriteIDAT()
sal_uInt32 nIDATSize = aOStm.Tell();
sal_uInt32 nBytes, nBytesToWrite = nIDATSize;
while(nBytesToWrite)
while (nBytesToWrite)
{
nBytes = nBytesToWrite <= mnMaxChunkSize ? nBytesToWrite : mnMaxChunkSize;
ImplOpenChunk(PNGCHUNK_IDAT);
ImplWriteChunk(const_cast<unsigned char *>(static_cast<unsigned char const *>(aOStm.GetData())) + (nIDATSize - nBytesToWrite), nBytes);
ImplWriteChunk(
const_cast<unsigned char*>(static_cast<unsigned char const*>(aOStm.GetData()))
+ (nIDATSize - nBytesToWrite),
nBytes);
nBytesToWrite -= nBytes;
}
}
@@ -481,7 +481,7 @@ void PNGWriterImpl::ImplWriteIDAT()
// appends to the currently used pass
// the complete size of scanline will be returned - in interlace mode zero is possible!
sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLong nXAdd)
sal_uLong PNGWriterImpl::ImplGetFilter(sal_uLong nY, sal_uLong nXStart, sal_uLong nXAdd)
{
sal_uInt8* pDest;
@@ -494,36 +494,37 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
{
*pDest++ = mnFilterType; // in this version the filter type is either 0 or 4
if (mpAccess->HasPalette()) // alphachannel is not allowed by pictures including palette entries
if (mpAccess
->HasPalette()) // alphachannel is not allowed by pictures including palette entries
{
switch (mnBitsPerPixel)
{
case 1:
{
Scanline pScanline = mpAccess->GetScanline( nY );
Scanline pScanline = mpAccess->GetScanline(nY);
sal_uLong nX, nXIndex;
for (nX = nXStart, nXIndex = 0; nX < mnWidth; nX += nXAdd, nXIndex++)
{
sal_uLong nShift = (nXIndex & 7) ^ 7;
if (nShift == 7)
*pDest = mpAccess->GetIndexFromData(pScanline, nX) << nShift;
else if (nShift == 0)
else if (nShift == 0)
*pDest++ |= mpAccess->GetIndexFromData(pScanline, nX) << nShift;
else
*pDest |= mpAccess->GetIndexFromData(pScanline, nX) << nShift;
}
if ( (nXIndex & 7) != 0 )
pDest++; // byte is not completely used, so the bufferpointer is to correct
if ((nXIndex & 7) != 0)
pDest++; // byte is not completely used, so the bufferpointer is to correct
}
break;
case 4:
{
Scanline pScanline = mpAccess->GetScanline( nY );
Scanline pScanline = mpAccess->GetScanline(nY);
sal_uLong nX, nXIndex;
for (nX = nXStart, nXIndex = 0; nX < mnWidth; nX += nXAdd, nXIndex++)
{
if(nXIndex & 1)
if (nXIndex & 1)
*pDest++ |= mpAccess->GetIndexFromData(pScanline, nX);
else
*pDest = mpAccess->GetIndexFromData(pScanline, nX) << 4;
@@ -535,17 +536,17 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
case 8:
{
Scanline pScanline = mpAccess->GetScanline( nY );
Scanline pScanline = mpAccess->GetScanline(nY);
for (sal_uLong nX = nXStart; nX < mnWidth; nX += nXAdd)
{
*pDest++ = mpAccess->GetIndexFromData( pScanline, nX );
*pDest++ = mpAccess->GetIndexFromData(pScanline, nX);
}
}
break;
default :
default:
mbStatus = false;
break;
break;
}
}
else
@@ -554,8 +555,8 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
{
if (mbTrueAlpha)
{
Scanline pScanline = mpAccess->GetScanline( nY );
Scanline pScanlineMask = mpMaskAccess->GetScanline( nY );
Scanline pScanline = mpAccess->GetScanline(nY);
Scanline pScanlineMask = mpMaskAccess->GetScanline(nY);
for (sal_uLong nX = nXStart; nX < mnWidth; nX += nXAdd)
{
const BitmapColor& rColor = mpAccess->GetPixelFromData(pScanline, nX);
@@ -568,8 +569,8 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
else
{
const BitmapColor aTrans(mpMaskAccess->GetBestMatchingColor(COL_WHITE));
Scanline pScanline = mpAccess->GetScanline( nY );
Scanline pScanlineMask = mpMaskAccess->GetScanline( nY );
Scanline pScanline = mpAccess->GetScanline(nY);
Scanline pScanlineMask = mpMaskAccess->GetScanline(nY);
for (sal_uLong nX = nXStart; nX < mnWidth; nX += nXAdd)
{
@@ -578,7 +579,7 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
*pDest++ = rColor.GetGreen();
*pDest++ = rColor.GetBlue();
if(mpMaskAccess->GetPixelFromData(pScanlineMask, nX) == aTrans)
if (mpMaskAccess->GetPixelFromData(pScanlineMask, nX) == aTrans)
*pDest++ = 0;
else
*pDest++ = 0xff;
@@ -587,7 +588,7 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
}
else
{
Scanline pScanline = mpAccess->GetScanline( nY );
Scanline pScanline = mpAccess->GetScanline(nY);
for (sal_uLong nX = nXStart; nX < mnWidth; nX += nXAdd)
{
const BitmapColor& rColor = mpAccess->GetPixelFromData(pScanline, nX);
@@ -606,9 +607,9 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
*pDest++ = 4; // filter type
sal_uInt8* p1 = mpCurrentScan.get() + 1; // Current Pixel
sal_uInt8* p2 = p1 - mnBBP; // left pixel
sal_uInt8* p3 = mpPreviousScan.get(); // upper pixel
sal_uInt8* p4 = p3 - mnBBP; // upperleft Pixel;
sal_uInt8* p2 = p1 - mnBBP; // left pixel
sal_uInt8* p3 = mpPreviousScan.get(); // upper pixel
sal_uInt8* p4 = p3 - mnBBP; // upperleft Pixel;
while (pDest < mpDeflateInBuf.get() + mnDeflateInSize)
{
@@ -630,15 +631,15 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
tools::Long npc = np - nc;
if (npa < 0)
npa =-npa;
npa = -npa;
if (npb < 0)
npb =-npb;
npb = -npb;
if (npc < 0)
npc =-npc;
npc = -npc;
if (npa <= npb && npa <= npc)
*pDest++ = *p1++ - static_cast<sal_uInt8>(na);
else if ( npb <= npc )
else if (npb <= npc)
*pDest++ = *p1++ - static_cast<sal_uInt8>(nb);
else
*pDest++ = *p1++ - static_cast<sal_uInt8>(nc);
@@ -664,18 +665,18 @@ void PNGWriterImpl::ImplClearFirstScanline()
memset(mpPreviousScan.get(), 0, mnDeflateInSize);
}
void PNGWriterImpl::ImplOpenChunk (sal_uLong nChunkType)
void PNGWriterImpl::ImplOpenChunk(sal_uLong nChunkType)
{
maChunkSeq.emplace_back();
maChunkSeq.back().nType = nChunkType;
}
void PNGWriterImpl::ImplWriteChunk (sal_uInt8 nSource)
void PNGWriterImpl::ImplWriteChunk(sal_uInt8 nSource)
{
maChunkSeq.back().aData.push_back(nSource);
}
void PNGWriterImpl::ImplWriteChunk (sal_uInt32 nSource)
void PNGWriterImpl::ImplWriteChunk(sal_uInt32 nSource)
{
vcl::PNGWriter::ChunkData& rChunkData = maChunkSeq.back();
rChunkData.aData.push_back(static_cast<sal_uInt8>(nSource >> 24));
@@ -684,7 +685,7 @@ void PNGWriterImpl::ImplWriteChunk (sal_uInt32 nSource)
rChunkData.aData.push_back(static_cast<sal_uInt8>(nSource));
}
void PNGWriterImpl::ImplWriteChunk (unsigned char const * pSource, sal_uInt32 nDatSize)
void PNGWriterImpl::ImplWriteChunk(unsigned char const* pSource, sal_uInt32 nDatSize)
{
if (nDatSize)
{
@@ -701,19 +702,11 @@ PNGWriter::PNGWriter(const BitmapEx& rBmpEx,
{
}
PNGWriter::~PNGWriter()
{
}
PNGWriter::~PNGWriter() {}
bool PNGWriter::Write(SvStream& rStream)
{
return mpImpl->Write(rStream);
}
bool PNGWriter::Write(SvStream& rStream) { return mpImpl->Write(rStream); }
std::vector<vcl::PNGWriter::ChunkData>& PNGWriter::GetChunks()
{
return mpImpl->GetChunks();
}
std::vector<vcl::PNGWriter::ChunkData>& PNGWriter::GetChunks() { return mpImpl->GetChunks(); }
} // namespace vcl
+7 -7
View File
@@ -21,16 +21,16 @@
#include <com/sun/star/beans/PropertyValue.hpp>
// formally known as WMF_EXTERNALHEADER
WmfExternal::WmfExternal() :
xExt(0),
yExt(0),
mapMode(0)
WmfExternal::WmfExternal()
: xExt(0)
, yExt(0)
, mapMode(0)
{
}
css::uno::Sequence< css::beans::PropertyValue > WmfExternal::getSequence() const
css::uno::Sequence<css::beans::PropertyValue> WmfExternal::getSequence() const
{
css::uno::Sequence< css::beans::PropertyValue > aSequence;
css::uno::Sequence<css::beans::PropertyValue> aSequence;
if (0 != xExt || 0 != yExt || 0 != mapMode)
{
@@ -46,7 +46,7 @@ css::uno::Sequence< css::beans::PropertyValue > WmfExternal::getSequence() const
return aSequence;
}
bool WmfExternal::setSequence(const css::uno::Sequence< css::beans::PropertyValue >& rSequence)
bool WmfExternal::setSequence(const css::uno::Sequence<css::beans::PropertyValue>& rSequence)
{
bool bRetval(false);
+5 -5
View File
@@ -28,11 +28,11 @@ namespace vcl
{
// TODO: sal_UCS4
sal_uInt16 TranslateChar12(sal_uInt16);
sal_uInt16 TranslateChar13(sal_uInt16);
sal_uInt16 TranslateChar14(sal_uInt16);
sal_uInt16 TranslateChar15(sal_uInt16);
sal_uInt16 TranslateChar16(sal_uInt16);
sal_uInt16 TranslateChar12(sal_uInt16);
sal_uInt16 TranslateChar13(sal_uInt16);
sal_uInt16 TranslateChar14(sal_uInt16);
sal_uInt16 TranslateChar15(sal_uInt16);
sal_uInt16 TranslateChar16(sal_uInt16);
}
#endif // INCLUDED_VCL_SOURCE_FONTSUBSET_XLAT_HXX
+17 -20
View File
@@ -26,7 +26,7 @@
#include <bmpfast.hxx>
#include <bitmapwriteaccess.hxx>
void BitmapWriteAccess::SetLineColor( const Color& rColor )
void BitmapWriteAccess::SetLineColor(const Color& rColor)
{
if (rColor.GetTransparency() == 255)
{
@@ -45,12 +45,9 @@ void BitmapWriteAccess::SetLineColor( const Color& rColor )
}
}
void BitmapWriteAccess::SetFillColor()
{
mpFillColor.reset();
}
void BitmapWriteAccess::SetFillColor() { mpFillColor.reset(); }
void BitmapWriteAccess::SetFillColor( const Color& rColor )
void BitmapWriteAccess::SetFillColor(const Color& rColor)
{
if (rColor.GetTransparency() == 255)
{
@@ -69,7 +66,7 @@ void BitmapWriteAccess::SetFillColor( const Color& rColor )
}
}
void BitmapWriteAccess::Erase( const Color& rColor )
void BitmapWriteAccess::Erase(const Color& rColor)
{
// convert the color format from RGB to palette index if needed
// TODO: provide and use Erase( BitmapColor& method)
@@ -101,7 +98,7 @@ void BitmapWriteAccess::Erase( const Color& rColor )
}
}
void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
void BitmapWriteAccess::DrawLine(const Point& rStart, const Point& rEnd)
{
if (!mpLineColor)
return;
@@ -119,13 +116,13 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
if (nEndY > nY)
{
for (; nY <= nEndY; nY++ )
SetPixel( nY, nX, rLineColor );
for (; nY <= nEndY; nY++)
SetPixel(nY, nX, rLineColor);
}
else
{
for (; nY >= nEndY; nY-- )
SetPixel( nY, nX, rLineColor );
for (; nY >= nEndY; nY--)
SetPixel(nY, nX, rLineColor);
}
}
else if (rStart.Y() == rEnd.Y())
@@ -149,8 +146,8 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
}
else
{
const tools::Long nDX = std::abs( rEnd.X() - rStart.X() );
const tools::Long nDY = std::abs( rEnd.Y() - rStart.Y() );
const tools::Long nDX = std::abs(rEnd.X() - rStart.X());
const tools::Long nDY = std::abs(rEnd.Y() - rStart.Y());
tools::Long nX1;
tools::Long nY1;
tools::Long nX2;
@@ -212,8 +209,8 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
nY2 = rStart.Y();
}
const tools::Long nDYX = (nDX - nDY) << 1;
const tools::Long nDY2 = nDX << 1;
const tools::Long nDYX = (nDX - nDY) << 1;
const tools::Long nDY2 = nDX << 1;
tools::Long nD = nDY2 - nDY;
bool bPos = nX1 < nX2;
@@ -237,7 +234,7 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
}
}
void BitmapWriteAccess::FillRect( const tools::Rectangle& rRect )
void BitmapWriteAccess::FillRect(const tools::Rectangle& rRect)
{
if (!mpFillColor)
return;
@@ -257,7 +254,7 @@ void BitmapWriteAccess::FillRect( const tools::Rectangle& rRect )
for (tools::Long nY = nStartY; nY <= nEndY; nY++)
{
Scanline pScanline = GetScanline( nY );
Scanline pScanline = GetScanline(nY);
for (tools::Long nX = nStartX; nX <= nEndX; nX++)
{
SetPixelOnData(pScanline, nX, rFillColor);
@@ -265,12 +262,12 @@ void BitmapWriteAccess::FillRect( const tools::Rectangle& rRect )
}
}
void BitmapWriteAccess::DrawRect( const tools::Rectangle& rRect )
void BitmapWriteAccess::DrawRect(const tools::Rectangle& rRect)
{
if (mpFillColor)
FillRect(rRect);
if (mpLineColor && (!mpFillColor || ( *mpFillColor != *mpLineColor)))
if (mpLineColor && (!mpFillColor || (*mpFillColor != *mpLineColor)))
{
DrawLine(rRect.TopLeft(), rRect.TopRight());
DrawLine(rRect.TopRight(), rRect.BottomRight());
+1 -5
View File
@@ -21,11 +21,7 @@
namespace vcl
{
ExtOutDevData::~ExtOutDevData()
{
}
ExtOutDevData::~ExtOutDevData() {}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+1 -3
View File
@@ -19,8 +19,6 @@
#include <salgdiimpl.hxx>
SalGraphicsImpl::~SalGraphicsImpl()
{
}
SalGraphicsImpl::~SalGraphicsImpl() {}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+8 -8
View File
@@ -21,26 +21,26 @@
#include <svdata.hxx>
#include <sal/log.hxx>
namespace vcl {
namespace vcl
{
DeleteOnDeinitBase::~DeleteOnDeinitBase()
{
ImplSVData* pSVData = ImplGetSVData();
if( !pSVData )
if (!pSVData)
return;
auto & rList = pSVData->maDeinitDeleteList;
auto& rList = pSVData->maDeinitDeleteList;
rList.erase(std::remove(rList.begin(), rList.end(), this), rList.end());
}
void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer )
void DeleteOnDeinitBase::addDeinitContainer(DeleteOnDeinitBase* i_pContainer)
{
ImplSVData* pSVData = ImplGetSVData();
SAL_WARN_IF( pSVData->mbDeInit, "vcl", "DeleteOnDeinit added after DeiInitVCL !" );
if( pSVData->mbDeInit )
SAL_WARN_IF(pSVData->mbDeInit, "vcl", "DeleteOnDeinit added after DeiInitVCL !");
if (pSVData->mbDeInit)
return;
pSVData->maDeinitDeleteList.push_back( i_pContainer );
pSVData->maDeinitDeleteList.push_back(i_pContainer);
}
void DeleteOnDeinitBase::ImplDeleteOnDeInit()
+8 -10
View File
@@ -23,19 +23,17 @@
using namespace vcl;
SolarThreadExecutor::SolarThreadExecutor()
:m_aStart()
,m_aFinish()
,m_bTimeout( false )
: m_aStart()
, m_aFinish()
, m_bTimeout(false)
{
}
SolarThreadExecutor::~SolarThreadExecutor()
{
}
SolarThreadExecutor::~SolarThreadExecutor() {}
IMPL_LINK_NOARG(SolarThreadExecutor, worker, void*, void)
{
if ( !m_bTimeout )
if (!m_bTimeout)
{
m_aStart.set();
doIt();
@@ -45,7 +43,7 @@ IMPL_LINK_NOARG(SolarThreadExecutor, worker, void*, void)
void SolarThreadExecutor::execute()
{
if( Application::IsMainThread() )
if (Application::IsMainThread())
{
m_aStart.set();
doIt();
@@ -56,11 +54,11 @@ void SolarThreadExecutor::execute()
m_aStart.reset();
m_aFinish.reset();
SolarMutexReleaser aReleaser;
ImplSVEvent * nEvent = Application::PostUserEvent( LINK( this, SolarThreadExecutor, worker ) );
ImplSVEvent* nEvent = Application::PostUserEvent(LINK(this, SolarThreadExecutor, worker));
if (m_aStart.wait() == osl::Condition::result_timeout)
{
m_bTimeout = true;
Application::RemoveUserEvent( nEvent );
Application::RemoveUserEvent(nEvent);
}
else
{
+2 -1
View File
@@ -26,7 +26,8 @@
#include <vcl/vclmain.hxx>
#include <vcl/svmain.hxx>
SAL_IMPLEMENT_MAIN() {
SAL_IMPLEMENT_MAIN()
{
fire_glxtest_process();
tools::extendApplicationEnvironment();
vclmain::createApplication();
+31 -32
View File
@@ -22,25 +22,25 @@
#include <iconview.hxx>
#include "iconviewimpl.hxx"
IconView::IconView( vcl::Window* pParent, WinBits nBits )
: SvTreeListBox( pParent, nBits )
IconView::IconView(vcl::Window* pParent, WinBits nBits)
: SvTreeListBox(pParent, nBits)
{
nColumns = 1;
mbCenterAndClipText = true;
SetEntryHeight( 100 );
SetEntryWidth( 100 );
SetEntryHeight(100);
SetEntryWidth(100);
pImpl.reset( new IconViewImpl( this, GetModel(), GetStyle() ) );
pImpl.reset(new IconViewImpl(this, GetModel(), GetStyle()));
}
void IconView::Resize()
{
Size aBoxSize = Control::GetParent()->GetOutputSizePixel();
if ( !aBoxSize.Width() )
if (!aBoxSize.Width())
return;
SetSizePixel( aBoxSize );
SetSizePixel(aBoxSize);
nColumns = aBoxSize.Width() / nEntryWidth;
@@ -50,33 +50,32 @@ void IconView::Resize()
tools::Rectangle IconView::GetFocusRect(const SvTreeListEntry*, tools::Long nEntryPos)
{
Size aSize;
aSize.setHeight( nEntryHeight );
aSize.setWidth( nEntryWidth );
aSize.setHeight(nEntryHeight);
aSize.setWidth(nEntryWidth);
Point aPos;
aPos.setX( 0 );
aPos.setY( 0 );
aPos.setX(0);
aPos.setY(0);
tools::Rectangle aRect;
short nCols = GetColumnsCount();
if(nCols)
if (nCols)
{
aPos.setY( ( nEntryPos / nCols ) * nEntryHeight );
aPos.setX( ( nEntryPos % nCols ) * nEntryWidth );
aPos.setY((nEntryPos / nCols) * nEntryHeight);
aPos.setX((nEntryPos % nCols) * nEntryWidth);
}
aRect.SetPos( aPos );
aRect.SetSize( aSize );
aRect.SetPos(aPos);
aRect.SetSize(aSize);
return aRect;
}
void IconView::PaintEntry(SvTreeListEntry& rEntry, tools::Long nX, tools::Long nY,
vcl::RenderContext& rRenderContext)
vcl::RenderContext& rRenderContext)
{
tools::Rectangle aRect; // multi purpose
pImpl->UpdateContextBmpWidthMax(&rEntry);
@@ -92,7 +91,7 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, tools::Long nX, tools::Long n
bool bCurFontIsSel = false;
const WinBits nWindowStyle = GetStyle();
const bool bHideSelection = (nWindowStyle & WB_HIDESELECTION) !=0 && !HasFocus();
const bool bHideSelection = (nWindowStyle & WB_HIDESELECTION) != 0 && !HasFocus();
const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings();
vcl::Font aHighlightFont(rRenderContext.GetFont());
@@ -101,7 +100,7 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, tools::Long nX, tools::Long n
Size aRectSize(nTempEntryWidth, nTempEntryHeight);
SvViewDataEntry* pViewDataEntry = GetViewDataEntry( &rEntry );
SvViewDataEntry* pViewDataEntry = GetViewDataEntry(&rEntry);
sal_uInt16 nItemCount = rEntry.ItemCount();
sal_uInt16 nCurItem = 0;
@@ -121,8 +120,8 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, tools::Long nX, tools::Long n
auto nItemHeight = SvLBoxItem::GetHeight(pViewDataEntry, nCurItem);
aEntryPos.setX( nX );
aEntryPos.setY( nY );
aEntryPos.setX(nX);
aEntryPos.setY(nY);
// set background pattern/color
@@ -134,7 +133,7 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, tools::Long nX, tools::Long n
// if the face color is bright then the deactivate color is also bright
// -> so you can't see any deactivate selection
if (bHideSelection && !rSettings.GetFaceColor().IsBright()
&& aWallpaper.GetColor().IsBright() != rSettings.GetDeactiveColor().IsBright())
&& aWallpaper.GetColor().IsBright() != rSettings.GetDeactiveColor().IsBright())
{
aNewWallColor = rSettings.GetDeactiveColor();
}
@@ -147,7 +146,7 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, tools::Long nX, tools::Long n
}
aWallpaper.SetColor(aNewWallColor);
}
else // no selection
else // no selection
{
if (bCurFontIsSel)
{
@@ -178,9 +177,9 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, tools::Long nX, tools::Long n
}
// center vertically
aEntryPos.AdjustY((nTempEntryHeight - nItemHeight) / 2 );
aEntryPos.AdjustY((nTempEntryHeight - nItemHeight) / 2);
aEntryPos.AdjustY(15 );
aEntryPos.AdjustY(15);
pItem->Paint(aEntryPos, *this, rRenderContext, pViewDataEntry, rEntry);
@@ -190,21 +189,21 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, tools::Long nX, tools::Long n
}
// draw icon
if(nIconItem != nItemCount && nIconItem < nItemCount)
if (nIconItem != nItemCount && nIconItem < nItemCount)
{
SvLBoxItem* pItem = &rEntry.GetItem(nIconItem);
auto nItemWidth = pItem->GetWidth(this, pViewDataEntry, nIconItem);
auto nItemHeight = SvLBoxItem::GetHeight(pViewDataEntry, nIconItem);
aEntryPos.setX( nX );
aEntryPos.setY( nY );
aEntryPos.setX(nX);
aEntryPos.setY(nY);
// center horizontally
aEntryPos.AdjustX((nTempEntryWidth - nItemWidth) / 2 );
aEntryPos.AdjustX((nTempEntryWidth - nItemWidth) / 2);
// center vertically
aEntryPos.AdjustY((nTempEntryHeight - nItemHeight) / 2 );
aEntryPos.AdjustY((nTempEntryHeight - nItemHeight) / 2);
aEntryPos.AdjustY( -10 );
aEntryPos.AdjustY(-10);
pItem->Paint(aEntryPos, *this, rRenderContext, pViewDataEntry, rEntry);
}
+13 -13
View File
@@ -28,39 +28,39 @@ class Point;
class IconViewImpl : public SvImpLBox
{
public:
IconViewImpl( SvTreeListBox* pTreeListBox, SvTreeList* pTreeList, WinBits nWinStyle );
IconViewImpl(SvTreeListBox* pTreeListBox, SvTreeList* pTreeList, WinBits nWinStyle);
void KeyDown( bool bPageDown ) override;
void KeyDown(bool bPageDown) override;
void KeyUp( bool bPageUp ) override;
void KeyUp(bool bPageUp) override;
Point GetEntryPosition(const SvTreeListEntry* pEntry) const override;
SvTreeListEntry* GetClickedEntry( const Point& rPoint ) const override;
SvTreeListEntry* GetClickedEntry(const Point& rPoint) const override;
bool IsEntryInView( SvTreeListEntry* pEntry ) const override;
bool IsEntryInView(SvTreeListEntry* pEntry) const override;
void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
// returns 0 if position is just past the last entry
SvTreeListEntry* GetEntry( const Point& rPoint ) const override;
SvTreeListEntry* GetEntry(const Point& rPoint) const override;
void UpdateAll( bool bInvalidateCompleteView ) override;
void UpdateAll(bool bInvalidateCompleteView) override;
bool KeyInput( const KeyEvent& ) override;
bool KeyInput(const KeyEvent&) override;
void InvalidateEntry( tools::Long nId ) const override;
void InvalidateEntry(tools::Long nId) const override;
protected:
tools::Long GetEntryLine(const SvTreeListEntry* pEntry) const override;
void CursorUp() override;
void CursorDown() override;
void PageDown( sal_uInt16 nDelta ) override;
void PageUp( sal_uInt16 nDelta ) override;
void PageDown(sal_uInt16 nDelta) override;
void PageUp(sal_uInt16 nDelta) override;
void SyncVerThumb() override;
void AdjustScrollBars( Size& rSize ) override;
void AdjustScrollBars(Size& rSize) override;
};
#endif // INCLUDED_VCL_SOURCE_INC_ICONVIEWIMPL_HXX
+13 -16
View File
@@ -21,40 +21,38 @@
#include <tools/debug.hxx>
/******************************************************************************
|*
|* Ctor
|*
\******************************************************************************/
IMapCompat::IMapCompat( SvStream& rStm, const StreamMode nStreamMode )
IMapCompat::IMapCompat(SvStream& rStm, const StreamMode nStreamMode)
: pRWStm(&rStm)
, nCompatPos(0)
, nTotalSize(0)
, nStmMode(nStreamMode)
{
DBG_ASSERT( nStreamMode == StreamMode::READ || nStreamMode == StreamMode::WRITE, "Wrong Mode!" );
DBG_ASSERT(nStreamMode == StreamMode::READ || nStreamMode == StreamMode::WRITE, "Wrong Mode!");
if ( pRWStm->GetError() )
if (pRWStm->GetError())
return;
if ( nStmMode == StreamMode::WRITE )
if (nStmMode == StreamMode::WRITE)
{
nCompatPos = pRWStm->Tell();
pRWStm->SeekRel( 4 );
pRWStm->SeekRel(4);
nTotalSize = nCompatPos + 4;
}
else
{
sal_uInt32 nTotalSizeTmp;
pRWStm->ReadUInt32( nTotalSizeTmp );
pRWStm->ReadUInt32(nTotalSizeTmp);
nTotalSize = nTotalSizeTmp;
nCompatPos = pRWStm->Tell();
}
}
/******************************************************************************
|*
|* Dtor
@@ -63,25 +61,24 @@ IMapCompat::IMapCompat( SvStream& rStm, const StreamMode nStreamMode )
IMapCompat::~IMapCompat()
{
if ( pRWStm->GetError() )
if (pRWStm->GetError())
return;
if ( nStmMode == StreamMode::WRITE )
if (nStmMode == StreamMode::WRITE)
{
const sal_uInt64 nEndPos = pRWStm->Tell();
pRWStm->Seek( nCompatPos );
pRWStm->WriteUInt32( nEndPos - nTotalSize );
pRWStm->Seek( nEndPos );
pRWStm->Seek(nCompatPos);
pRWStm->WriteUInt32(nEndPos - nTotalSize);
pRWStm->Seek(nEndPos);
}
else
{
const sal_uInt64 nReadSize = pRWStm->Tell() - nCompatPos;
if ( nTotalSize > nReadSize )
pRWStm->SeekRel( nTotalSize - nReadSize );
if (nTotalSize > nReadSize)
pRWStm->SeekRel(nTotalSize - nReadSize);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+32 -24
View File
@@ -325,7 +325,7 @@ OUString StringMapToOUString(const std::map<OUString, OUString>& rParameters)
if (rParameters.empty())
return "";
OUStringBuffer aParameterString(static_cast<int>(rParameters.size()*32));
OUStringBuffer aParameterString(static_cast<int>(rParameters.size() * 32));
aParameterString.append(" {");
for (std::map<OUString, OUString>::const_iterator itr = rParameters.begin();
@@ -391,8 +391,9 @@ void UITestLogger::logEvent(const EventDescription& rDescription)
}
else if (rDescription.aKeyWord == "ValueSet")
{
aLogLine = "Choose element with position " + GetValueInMapWithIndex(rDescription.aParameters, 0) +
" in '" + rDescription.aID +"' from '" + rDescription.aParent + "'";
aLogLine = "Choose element with position "
+ GetValueInMapWithIndex(rDescription.aParameters, 0) + " in '"
+ rDescription.aID + "' from '" + rDescription.aParent + "'";
}
else if (rDescription.aAction == "SELECT" && rDescription.aID.isEmpty())
{
@@ -450,11 +451,8 @@ void UITestLogger::logEvent(const EventDescription& rDescription)
}
else if (rDescription.aAction == "LAUNCH")
{
aLogLine = "Launch"
+ GetKeyInMapWithIndex(rDescription.aParameters, 2)
+ " from Col "
+ GetValueInMapWithIndex(rDescription.aParameters, 2)
+ " and Row "
aLogLine = "Launch" + GetKeyInMapWithIndex(rDescription.aParameters, 2) + " from Col "
+ GetValueInMapWithIndex(rDescription.aParameters, 2) + " and Row "
+ GetValueInMapWithIndex(rDescription.aParameters, 1);
}
else if (rDescription.aAction == "DELETE_CONTENT")
@@ -501,11 +499,11 @@ void UITestLogger::logEvent(const EventDescription& rDescription)
else if (rDescription.aAction == "COMMENT")
{
OUString type = GetKeyInMapWithIndex(rDescription.aParameters, 0);
if(type == "OPEN")
if (type == "OPEN")
{
aLogLine = "Open Comment";
}
else if(type == "CLOSE")
else if (type == "CLOSE")
{
aLogLine = "Close Comment";
}
@@ -561,19 +559,24 @@ void UITestLogger::logEvent(const EventDescription& rDescription)
}
else if (rDescription.aKeyWord == "SwEditWinUIObject")
{
if(rDescription.aAction=="LEAVE"){
if (rDescription.aAction == "LEAVE")
{
aLogLine = "Leave '" + rDescription.aID + "'";
}
else if(rDescription.aAction=="SHOW"){
else if (rDescription.aAction == "SHOW")
{
aLogLine = "Show '" + rDescription.aID + "'";
}
else if(rDescription.aAction=="HIDE"){
else if (rDescription.aAction == "HIDE")
{
aLogLine = "Hide '" + rDescription.aID + "'";
}
else if(rDescription.aAction=="DELETE"){
else if (rDescription.aAction == "DELETE")
{
aLogLine = "Delete '" + rDescription.aID + "'";
}
else if(rDescription.aAction=="SETRESOLVED"){
else if (rDescription.aAction == "SETRESOLVED")
{
aLogLine = "Resolve '" + rDescription.aID + "'";
}
}
@@ -581,21 +584,26 @@ void UITestLogger::logEvent(const EventDescription& rDescription)
{
aLogLine = "Select element no " + rDescription.aID + " From " + rDescription.aParent;
}
else if(rDescription.aKeyWord == "MenuButton"){
if(rDescription.aAction == "OPENLIST"){
else if (rDescription.aKeyWord == "MenuButton")
{
if (rDescription.aAction == "OPENLIST")
{
aLogLine = "Open List From " + rDescription.aID;
}
else if(rDescription.aAction == "CLOSELIST"){
else if (rDescription.aAction == "CLOSELIST")
{
aLogLine = "Close List From " + rDescription.aID;
}
else if(rDescription.aAction == "OPENFROMLIST"){
aLogLine = "Select item no "+ GetValueInMapWithIndex(rDescription.aParameters, 0) +" From List of "+ rDescription.aID;
else if (rDescription.aAction == "OPENFROMLIST")
{
aLogLine = "Select item no " + GetValueInMapWithIndex(rDescription.aParameters, 0)
+ " From List of " + rDescription.aID;
}
}
else if(rDescription.aKeyWord == "VerticalTab"){
aLogLine = "Choose Tab number " + GetValueInMapWithIndex(rDescription.aParameters, 0) +
" in '" + rDescription.aID +
"' from " + rDescription.aParent ;
else if (rDescription.aKeyWord == "VerticalTab")
{
aLogLine = "Choose Tab number " + GetValueInMapWithIndex(rDescription.aParameters, 0)
+ " in '" + rDescription.aID + "' from " + rDescription.aParent;
}
else
{
+9 -11
View File
@@ -21,10 +21,12 @@
#include <vcl/abstdlg.hxx>
#include <vcl/bitmapex.hxx>
typedef VclAbstractDialogFactory* (SAL_CALL* FuncPtrCreateDialogFactory)();
typedef VclAbstractDialogFactory*(SAL_CALL* FuncPtrCreateDialogFactory)();
#ifndef DISABLE_DYNLOADING
extern "C" { static void thisModule() {} }
extern "C" {
static void thisModule() {}
}
#else
extern "C" VclAbstractDialogFactory* CreateDialogFactory();
#endif
@@ -38,7 +40,7 @@ VclAbstractDialogFactory* VclAbstractDialogFactory::Create()
SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY))
{
auto const p = reinterpret_cast<FuncPtrCreateDialogFactory>(
aDialogLibrary.getFunctionSymbol( "CreateDialogFactory" ) );
aDialogLibrary.getFunctionSymbol("CreateDialogFactory"));
aDialogLibrary.release();
return p;
}
@@ -47,16 +49,14 @@ VclAbstractDialogFactory* VclAbstractDialogFactory::Create()
return CreateDialogFactory;
#endif
}();
if ( fp )
if (fp)
return fp();
return nullptr;
}
VclAbstractDialog::~VclAbstractDialog()
{
}
VclAbstractDialog::~VclAbstractDialog() {}
bool VclAbstractDialog::StartExecuteAsync(AsyncContext &)
bool VclAbstractDialog::StartExecuteAsync(AsyncContext&)
{
assert(false);
return false;
@@ -80,8 +80,6 @@ BitmapEx VclAbstractDialog::createScreenshot() const
return BitmapEx();
}
VclAbstractDialogFactory::~VclAbstractDialogFactory()
{
}
VclAbstractDialogFactory::~VclAbstractDialogFactory() {}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+5 -5
View File
@@ -23,20 +23,20 @@
#include <window.h>
#ifdef DBG_UTIL
const char* ImplDbgCheckWindow( const void* pObj )
const char* ImplDbgCheckWindow(const void* pObj)
{
DBG_TESTSOLARMUTEX();
const vcl::Window* pWindow = static_cast<vcl::Window const *>(pObj);
const vcl::Window* pWindow = static_cast<vcl::Window const*>(pObj);
if ( (pWindow->GetType() < WindowType::FIRST) || (pWindow->GetType() > WindowType::LAST) )
if ((pWindow->GetType() < WindowType::FIRST) || (pWindow->GetType() > WindowType::LAST))
return "Window data overwrite";
// check window-chain
vcl::Window* pChild = pWindow->mpWindowImpl->mpFirstChild;
while ( pChild )
while (pChild)
{
if ( pChild->mpWindowImpl->mpParent != pWindow )
if (pChild->mpWindowImpl->mpParent != pWindow)
return "Child-Window-Parent wrong";
pChild = pChild->mpWindowImpl->mpNext;
}
+5 -8
View File
@@ -28,22 +28,19 @@ void IntroWindow::ImplInitIntroWindowData()
pSVData->mpIntroWindow = this;
}
IntroWindow::IntroWindow( ) :
WorkWindow( WindowType::INTROWINDOW )
IntroWindow::IntroWindow()
: WorkWindow(WindowType::INTROWINDOW)
{
ImplInitIntroWindowData();
WorkWindow::ImplInit( nullptr, WB_INTROWIN );
WorkWindow::ImplInit(nullptr, WB_INTROWIN);
}
IntroWindow::~IntroWindow()
{
disposeOnce();
}
IntroWindow::~IntroWindow() { disposeOnce(); }
void IntroWindow::dispose()
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->mpIntroWindow.get() == this )
if (pSVData->mpIntroWindow.get() == this)
pSVData->mpIntroWindow = nullptr;
WorkWindow::dispose();
+3 -6
View File
@@ -24,16 +24,13 @@
WaitObject::~WaitObject()
{
if ( mpWindow )
if (mpWindow)
mpWindow->LeaveWait();
}
namespace vcl {
Size Window::GetOptimalSize() const
namespace vcl
{
return Size();
}
Size Window::GetOptimalSize() const { return Size(); }
void Window::ImplAdjustNWFSizes()
{

Some files were not shown because too many files have changed in this diff Show More