Commit Graph

58 Commits

Author SHA1 Message Date
Tor Lillqvist
dc3d621411 Assertions should tell the line number where the problem is
Let's not hide the assert() in a function whose sole purpose is to
call assert().

Change-Id: I7a8a04aad560b0f22398daabf12d00bbe58e89f1
2015-06-18 11:43:19 +03:00
Takeshi Abe
0980095619 Replace boost::scoped_array<T> with std::unique_ptr<T[]>
This may reduce some degree of dependency on boost.
Done by running a script like:

git grep -l '#include  *.boost/scoped_array.hpp.' \
 | xargs sed -i -e 's@#include  *.boost/scoped_array.hpp.@#include <memory>@'
git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \
 | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/'

... and then killing duplicate or unnecessary includes,
while changing manually
m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx,
extensions/source/ole/unoconversionutilities.hxx, and
extensions/source/ole/oleobjw.cxx.

Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd
Reviewed-on: https://gerrit.libreoffice.org/16289
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-17 15:50:45 +00:00
Stephan Bergmann
f6ec07a396 loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I07bf1403e6b992807541a499b786d47f835b2f81
2015-06-08 16:29:41 +02:00
Caolán McNamara
7e5d98c427 masses of coverity FORWARD_NULL warnings from copied assert
Change-Id: I8f698bbcf4d53a4477cc0ee0c3f2c7f08e521f8a
2015-06-01 17:41:20 +01:00
Jan Holesovsky
15afb15227 rendercontext: Add asserts to easily catch the direct rendering cases.
Change-Id: I5e05b08e30930740be0fdbb18169bf350e2eab9f
2015-05-24 02:14:40 +02:00
Noel Grandin
3cbdf64ad5 convert DRAWMODE constants to scoped enum
Change-Id: I36cbe8057d09226f8b302963bdd94dc5600b686f
2015-05-20 09:52:08 +02:00
Noel Grandin
dcefc97c8b convert IMAGE_DRAW_ constants to scoped enum
Change-Id: I75619eeb902af4953a5ac1525605cf3f0f15e2c0
2015-05-20 09:52:08 +02:00
Caolán McNamara
0da6ba6d3c Resolves: tdf#91392 orig map for orig code paths, and new map for new path
otherwise with SAL_DISABLE_NATIVE_ALPHA=1/SAL_USE_VCLPLUGIN=gtk3 the 8 bit
page icons in the status bar lose their bottom rows

Change-Id: Id9d9ba1a6fb74784a0a4c29bf3d13ebf8476c376
2015-05-19 15:59:53 +01:00
Noel Grandin
ad0c5e6c66 convert META_*_ACTION constants to scoped enum
Change-Id: I8ecfbfecd765a35fafcbcc5452b0d04a89be2459
2015-05-15 10:05:03 +02:00
Noel Grandin
662fc8eaa9 convert BMP_MIRROR constants to scoped enum
and fix bug in svx/source/xoutdev/_xoutbmp.cxx,XOutBitmap::MirrorGraphic
where it was not correctly translating between different flags types.

Change-Id: I78b4965544da2aa54b67ec18307fa54c8ffc3aee
2015-05-06 09:01:31 +02:00
Michael Meeks
e8b97a52c9 Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts.

Conflicts:
	accessibility/source/extended/accessiblelistbox.cxx
	accessibility/source/standard/vclxaccessiblecombobox.cxx
	accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
	accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
	accessibility/source/standard/vclxaccessiblelistbox.cxx
	accessibility/source/standard/vclxaccessibletextfield.cxx
	basctl/source/basicide/basidesh.cxx
	cui/source/inc/chardlg.hxx
	cui/source/tabpages/tpbitmap.cxx
	dbaccess/source/ui/dlg/UserAdmin.cxx
	dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
	extensions/source/propctrlr/propertyeditor.hxx
	extensions/source/scanner/sanedlg.cxx
	filter/source/pdf/impdialog.cxx
	include/sfx2/mgetempl.hxx
	include/sfx2/sidebar/SidebarToolBox.hxx
	include/sfx2/viewsh.hxx
	include/svtools/brwbox.hxx
	include/svtools/filectrl.hxx
	include/svtools/scrwin.hxx
	include/svx/dlgctrl.hxx
	include/svx/sidebar/Popup.hxx
	include/svx/sidebar/PopupContainer.hxx
	include/svx/sidebar/PopupControl.hxx
	include/svx/sidebar/SidebarDialControl.hxx
	include/svx/sidebar/ValueSetWithTextControl.hxx
	sc/source/ui/condformat/condformatdlgentry.cxx
	sc/source/ui/navipi/navipi.cxx
	sc/source/ui/sidebar/CellBorderStyleControl.hxx
	sd/source/ui/animations/CustomAnimationDialog.cxx
	sd/source/ui/inc/DrawViewShell.hxx
	sd/source/ui/inc/Ruler.hxx
	sd/source/ui/inc/SlideSorter.hxx
	sd/source/ui/inc/ViewTabBar.hxx
	sd/source/ui/inc/Window.hxx
	sd/source/ui/inc/morphdlg.hxx
	sd/source/ui/inc/sdpreslt.hxx
	sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
	sd/source/ui/sidebar/LayoutMenu.hxx
	sd/source/ui/sidebar/MasterPagesSelector.hxx
	sd/source/ui/sidebar/NavigatorWrapper.hxx
	sd/source/ui/sidebar/PanelBase.hxx
	sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
	sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
	sd/source/ui/slideshow/showwindow.hxx
	sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
	sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
	sd/source/ui/view/ViewShellBase.cxx
	sd/source/ui/view/drviewsa.cxx
	sfx2/source/appl/fileobj.hxx
	sfx2/source/appl/opengrf.cxx
	sfx2/source/control/thumbnailviewacc.hxx
	sfx2/source/dialog/securitypage.cxx
	sfx2/source/dialog/templdlg.cxx
	sfx2/source/doc/docinsert.cxx
	sfx2/source/doc/guisaveas.cxx
	sfx2/source/inc/alienwarn.hxx
	sfx2/source/sidebar/Deck.cxx
	sfx2/source/sidebar/Deck.hxx
	sfx2/source/sidebar/DeckTitleBar.cxx
	sfx2/source/sidebar/DeckTitleBar.hxx
	sfx2/source/sidebar/MenuButton.cxx
	sfx2/source/sidebar/MenuButton.hxx
	sfx2/source/sidebar/Panel.cxx
	sfx2/source/sidebar/Panel.hxx
	sfx2/source/sidebar/PanelTitleBar.hxx
	sfx2/source/sidebar/SidebarDockingWindow.hxx
	sfx2/source/sidebar/SidebarToolBox.cxx
	sfx2/source/sidebar/TabBar.hxx
	sfx2/source/sidebar/TabItem.cxx
	sfx2/source/sidebar/TabItem.hxx
	sfx2/source/sidebar/TitleBar.hxx
	sfx2/source/toolbox/imgmgr.cxx
	starmath/inc/edit.hxx
	starmath/inc/smmod.hxx
	starmath/qa/cppunit/test_starmath.cxx
	starmath/source/edit.cxx
	starmath/source/smmod.cxx
	svtools/source/brwbox/brwbox1.cxx
	svtools/source/brwbox/datwin.hxx
	svtools/source/contnr/fileview.cxx
	svtools/source/contnr/simptabl.cxx
	svtools/source/control/filectrl.cxx
	svtools/source/control/valueimp.hxx
	svx/inc/GalleryControl.hxx
	svx/source/dialog/dlgctrl.cxx
	svx/source/dialog/swframeexample.cxx
	svx/source/fmcomp/fmgridif.cxx
	svx/source/gallery2/GalleryControl.cxx
	svx/source/sidebar/EmptyPanel.hxx
	svx/source/sidebar/area/AreaPropertyPanel.hxx
	svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
	svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
	svx/source/sidebar/insert/InsertPropertyPanel.cxx
	svx/source/sidebar/insert/InsertPropertyPanel.hxx
	svx/source/sidebar/line/LinePropertyPanel.hxx
	svx/source/sidebar/line/LineWidthControl.cxx
	svx/source/sidebar/line/LineWidthControl.hxx
	svx/source/sidebar/line/LineWidthValueSet.hxx
	svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
	svx/source/sidebar/possize/SidebarDialControl.cxx
	svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
	svx/source/sidebar/text/TextPropertyPanel.hxx
	svx/source/sidebar/tools/PopupContainer.cxx
	svx/source/sidebar/tools/PopupControl.cxx
	svx/source/sidebar/tools/ValueSetWithTextControl.cxx
	svx/source/svdraw/svdfmtf.hxx
	svx/source/svdraw/svdibrow.cxx
	svx/source/tbxctrls/colrctrl.cxx
	svx/source/tbxctrls/tbcontrl.cxx
	sw/source/ui/dbui/mmaddressblockpage.cxx
	sw/source/ui/dialog/uiregionsw.cxx
	sw/source/ui/index/cnttab.cxx
	sw/source/uibase/inc/drpcps.hxx
	sw/source/uibase/sidebar/PageColumnControl.hxx
	sw/source/uibase/sidebar/PageMarginControl.hxx
	sw/source/uibase/sidebar/PageOrientationControl.hxx
	sw/source/uibase/sidebar/PagePropertyPanel.hxx
	sw/source/uibase/sidebar/PageSizeControl.hxx
	sw/source/uibase/uiview/view2.cxx
	sw/source/uibase/utlui/navipi.cxx
	vcl/inc/svdata.hxx
	vcl/source/control/combobox.cxx
	vcl/source/control/lstbox.cxx
	vcl/source/window/dockwin.cxx
	vcl/source/window/winproc.cxx

Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
2015-04-28 15:08:48 +01:00
Stephan Bergmann
a9a4d46ce7 loplugin:simplifybool
Change-Id: I8276e8b356ff26241613de64bcd90b5dbcd92f29
2015-04-24 12:36:31 +02:00
Michael Meeks
3072f80c53 automated VclPtrInstance conversion.
Change-Id: I9a1d47202e2794461f6ec44f3e72ee1dd2fde09d
2015-04-10 13:26:44 +01:00
Michael Meeks
ad8a2074c6 cure a lot of unfortunate ScopedVclPtrs.
Change-Id: I2149511f958ba75e81dc41b10b01eb9d19610037
2015-04-10 13:01:49 +01:00
Noel Grandin
820576af4f start wrapping OutputDevice in VclPtr
Change-Id: If3ecbb0599b50d50ce6b3997ca7892200c332ffe
2015-04-10 12:10:43 +01:00
Noel Grandin
e9cb5577f4 loplugin:staticmethods
Change-Id: Ibf0c73ac17ec19ed672f66907db47057920babca
2015-04-02 09:38:29 +02:00
Luboš Luňák
4bf97acefc do not silently fail if the optimized blend path doesn't do anything
Otherwise e.g. rotated images in Draw may show as empty. Broken in d53103dd83.

Change-Id: I0b99b6c39b96f87a78ccb09c9db0a1bfac0f3296
2015-02-12 13:56:39 +01:00
Tomaž Vajngerl
bfde809919 Don't allow a negative sample range. Fixes test breakage.
Change-Id: I3cf79b590b7d4c5aab92ccaebf6fd9c7eda529f7
2015-01-19 19:50:16 +09:00
Tomaž Vajngerl
d53103dd83 fdo#74124 bilinear scaling with blending for some formats
The DrawDeviceAlphaBitmapSlowPath used fast/ugly scaling with
blending. With this a bilinear scaling is used which should
improve quality for downscaling (less than 50% should start to
degrade in quality as only 2 samples are always used) and
upscaling.

Change-Id: I56cdf2b5761687be891387343a773b6fefac03e2
2015-01-19 00:07:25 +09:00
Tomaž Vajngerl
009c1752b1 Extract slow path of DrawDeviceAlphaBitmap into its own method
Additioanlly cleanup and use ScopedReadAccess

Change-Id: Ia3365f4dc968368bdd90d4398188bffe2d56e89b
2015-01-19 00:07:24 +09:00
Caolán McNamara
8ccf559473 coverity#1255909 Uninitialized scalar field
Change-Id: I162199233c9d3feb03e7ab33b777174b2a03035a
Reviewed-on: https://gerrit.libreoffice.org/13104
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-24 20:40:42 +00:00
Louis-Francis Ratté-Boulianne
4b6feefa51 vcl: Add support for backend-dependent blending of bitmaps (mask and alpha)
Change-Id: Iba64eb42965c86ca5655b9a105ef3f397e033ecf
2014-11-22 20:14:16 +01:00
Jan Holesovsky
3f94c9e9dd windows opengl: Introduce OpenGLCompatibleDC.
This is to abstract the compatible DC creation and usage, to be reused in the
native theme rendering.

Change-Id: Id34bba4aeea7f46fc2aa42f292f0a525d753b8d7
2014-11-20 18:51:55 +01:00
Jan Holesovsky
3a6f1c6c65 vcl: If there it a MapMode, it is applied.
Based on that, I believe this condition can go too.

Change-Id: I88d8211678ca148bdf85729f57893e1476a52fc9
2014-11-20 18:08:58 +01:00
Jan Holesovsky
f622648b23 vcl: Kill IsMapMode(), it means the same as IsMapModeEnabled().
Change-Id: I65fd40b8268cb0a27ba40da60fcf8e84cc8f7661
2014-11-20 18:08:57 +01:00
Jan Holesovsky
bad9b2d464 vcl: The backend should decide whether fast alpha drawing is available.
The unx drawAlphaBitmap() already already checks that the source and
destination have the same size.

Windows and OpenGL should be able to handle that without trouble.

OS X would need some additional code, so added an early return for the case
the source and result sizes do not match.

Change-Id: Ib09654aaa9c9064c232cff5094fcaa1190e931c6
2014-11-15 14:43:54 +01:00
Jan Holesovsky
93b34d0917 vcl: Use the fast path for rendering.
There was a discrepancy between the comment and the code; and I believe the
comment was right, and the code wrong - so adapted the code accordingly.

[I guess we will want to kill this condition for good when rendering via
OpenGL at some stage; the assert() will tell us ;-)]

Change-Id: I651261373068e975004c898b2a930c602c158b64
2014-11-11 21:47:03 +01:00
Jan Holesovsky
d87b163f8d windows opengl: Make sure we don't reach the slow parts of the code.
Change-Id: I2a4d1bd294d1d88651c8556091f5453ef0aa5293
2014-11-11 21:46:54 +01:00
Markus Mohrhard
b7e3087860 prevent insane memory allocation
We release the memory in the next call again.

Change-Id: I9cd974f2c1b2381d0a895bea52a8654143862971
2014-11-10 07:59:45 +01:00
Noel Grandin
af5ebbf783 create a macro library for implementing bit-flags types
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>,
changed from a macro- to a template-based solution.  (Unfortunately MSVC 2012
does not support explicit conversion operators.  Worked around that with
explicit #ifs rather than some HAVE_EXPLICIT_CONVERSION_OPERATORS and
SAL_EXPLICIT_CONVERSION_OPERATOR ainticipating we hopefully soon move to a
baseline that requires unconditional support for them.)

Change-Id: I4a89643b218d247e8e4a861faba458ec6dfe1396
2014-10-13 17:45:57 +02:00
Caolán McNamara
fee95be5b6 Resolves: fdo#82552 we only check pAlphaW on one branch
Change-Id: Ib2c5a0d751050af77f267edbb7a5a0fe57494622
2014-09-11 15:13:45 +01:00
Michael Stahl
ee36fc7add fdo#80498: vcl: Revert "fdo#74124: Scale the pictures before calling ...
... ImplDrawAlpha()."

This reverts commit 3cf3700b7a.

It may look nicer but is unusably slow when scrolling in Writer.

Conflicts:
	vcl/source/gdi/outdev2.cxx

Change-Id: I582f3f02a2f8915c244b04b2fe95b6af926396b9
2014-07-10 18:06:59 +02:00
Noel Grandin
8d54796bf1 enhance pass-by-ref plugin to detect large arguments
Detect arguments larger than 64 chars passed by value.

Change-Id: I9b0ea9ccb99d115984a26eab67c9cf6afd5f6cae
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-05-20 11:17:22 +02:00
Tomaž Vajngerl
ebe854c9d9 vcl: clean-up DrawDeviceBitmap method
Change-Id: I392993ca1d6a62778105026b724c26578b4e1fec
2014-04-30 16:57:10 +02:00
Tomaž Vajngerl
818a0ed6c6 fdo#77126 BitmapEx.Scale already takes care of mirroring
Change-Id: I320a5ec1da62cc1a8b3cb227298ecaf99f305a6f
2014-04-30 16:57:09 +02:00
Thomas Arnhold
789d3b363f fdo#78030 - Bitmaps are missing allover the UI
Original behavior was to call DrawBitmap without the size argument.

        case IMAGETYPE_BITMAP:
        {
            const Bitmap &rBitmap = *static_cast< Bitmap* >( rImage.mpImplData->mpData );
            if( nStyle & IMAGE_DRAW_DISABLE )
                DrawBitmapEx( rPos, makeDisabledBitmap(rBitmap) );
            else
                DrawBitmap( rPos, rBitmap );
        }
        break;

A check of bIsValidSize is needed here, too.

This brings the missing bitmaps back.

Change-Id: I60582090a7543b3916b15675af1a5ec9ee216270
2014-04-28 11:36:11 +02:00
Chris Sherlock
e474c95cde VCL: Renamed two functions
Renamed functions:

+ supportsOperation -> SupportsOperation
    For consistency

+ DrawAlphaBitmap -> DrawDeviceAlphaBitmap
    I want to make it more clear that these are the functions that call
    on mpGraphics to actually draw on the graphics device

Change-Id: Ic4951bfcc0ac0c09fe5b6908dfdf1f699a634265
2014-04-28 00:14:56 +10:00
Chris Sherlock
f41b145711 VCL: remove comment, rename ImplInitClipRegion to InitClipRegion
Change-Id: If8d18b59285f75d61d9972ca019390fce700be3c
2014-04-25 03:18:08 +10:00
Chris Sherlock
a80f7551c9 VCL: Remove unnecessary headers from outdev/bitmap.cxx
Change-Id: Ib4d5da9bb36e6ad7a02536f169ae7b634bb939db
2014-04-24 21:36:08 +10:00
Chris Sherlock
6658367b2e outdev/bitmap.cxx: remove unnecessary headers, fix SAL_WARN_IF statement
Change-Id: I01e380cf87c6c18ebfc15b1f2a1055d100074991
2014-04-24 03:22:07 +10:00
Chris Sherlock
3dbed9ac7a Rearrange VCL OutputDevice bitmap functions
Change-Id: I9bb6a5d123c35d3de2d2fa7b8a427c92f599afd7
2014-04-24 03:22:07 +10:00
Chris Sherlock
2a591848d4 Remove unnecessary OUTDEV_INIT() macro in VCL's outdev.hxx
Change-Id: I0eba1f88f607ba1faf40d8507bb184bdc88085be
2014-04-24 03:22:06 +10:00
Chris Sherlock
8708d30369 Rename OutputDevice::ImplGetGraphics to GetGraphics
Change-Id: I4086978f2292538c458802a7fb56c0d3826f2def
2014-04-23 07:23:43 +10:00
Chris Sherlock
704e5abbe9 Move bitmap functions in header, warn if calling GetBitmap() in Printer
Change-Id: Id2325822730d3d9167706c8c4118eaa3ca727195
2014-04-23 07:23:41 +10:00
Chris Sherlock
55f736a2bf Merge tworect.cxx with rect.cxx and rename functions
Change-Id: Iad6109a353181759fa64e48a82a003f785d0e58c
2014-04-22 03:37:35 +10:00
Chris Sherlock
d44067e9d7 Fix wrong function names in bitmap.cxx
Change-Id: I542282cd4757c3d841f8e2b48847ab5d5ba1574e
2014-04-22 03:07:47 +10:00
Chris Sherlock
89f5a775e8 DrawTransformedBitmapEx - fix accidental rename
Change-Id: Ic13a4ac4ca3b4ed23c0db9bc6894024f7b2d959a
2014-04-22 02:57:48 +10:00
Chris Sherlock
f9fa335da0 Move DownsizeBitmap from gdi/print2.cxx to outdev/bitmap.cxx
Change-Id: Ib10024fe92ae364d31082177724be718d426fe26
2014-04-22 02:30:39 +10:00
Chris Sherlock
f749ffbdf4 Move DrawImage function location in outdev.hxx
... also slightly changed the overload documentation for DrawBitmapEx
and DrawBitmap functions.

Furthermore, DrawImage() should never be called from a Printer
instance, so warn and abort.

Change-Id: I0de65a5d7bd8249fcd14d844faf74477d490cef5
2014-04-22 02:30:36 +10:00
Chris Sherlock
655443b42d Reorganize OutputDevice bitmap functions
I have moved the blending functions from blend.cxx to bitmap.cxx, I
also renamed the function ImplBlendWithAlpha to BlendBitmapWithAlpha
and ImplBlend to BlendBitmap.

I also grouped the functions in outdev.hxx - BlendBitmap and
BlendBitmapWithAlpha are both private functions, not public.

Change-Id: Idfaf8826341172bb0288473c643afa51a03b0580
2014-04-22 02:30:36 +10:00