Commit Graph

187 Commits

Author SHA1 Message Date
582ef22d3e fdo#84854 it seems long is not enough on 32 bit
Fraction used BigInt internally for computations, rational does nothing
like that.

Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
2014-10-16 17:44:44 +02:00
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
f6d61562d4 vcl: Make ImplFontCharMap a pImpl and move functions to FontCharMap
To do this, I've made FontCharMap a friend class for ImplFontCharMap,
and have moved the functions directly into FontCharMap. In this patch,
I am attempting to stop the direct use of ImplFontCharMap by anything
other than FontCharMap. However, FontCharMap itself requires a
refcounter, so we will use FontCharMapPtr to access the font character
map.

Change-Id: I509b990a8cbd911c5cc1572c7d24fc5348ca06d9
Reviewed-on: https://gerrit.libreoffice.org/11823
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-10-13 09:19:04 +00:00
47a2d7642d fdo#81356: convert Fraction to boost::rational<long> - wip
* Added rational util functions used by Fraction class not
  available in the boost::rational class.
* Replaced usage of Fraction by boost::rational<long>
* Removed code that relies on:
  1. fraction.IsValid() -- rational only allow valid values, ie
     denominator() != 0
  2. rational.denominator() == 0 -- always false
  3. rational.denominator() < 0 -- always false but implementation
     detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
* Simplified code that relies on:
  1. rational.denominator() != 0 -- always true
* BUGS EXIST because Fraction allows the creation of invalid values but
  boost::rational throws the exception boost::bad_rational

Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9
Reviewed-on: https://gerrit.libreoffice.org/11551
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-09 11:33:33 +00:00
3144b8deaf Resolves: fdo#84809 crash when button is too short for text
regression from 4c539fac018dfd44cd8db52161a8cb930c627da7

commit 4c539fac018dfd44cd8db52161a8cb930c627da7
Date:   Tue Dec 17 05:18:35 2013 -0600
    vcl get rid of xub_StrLen and STRING_LEN in outdev3

before this there was a dubious cast which hid the problem

Change-Id: I7c01c0f0ac211196a62acaf02297f29ae829403d
2014-10-09 11:15:24 +01:00
31d2f8ab0f coverity#1000506 Unchecked return value
Change-Id: I71e824e7f0e279582f12d5cb9443a4177551a705
2014-10-07 21:05:17 +01:00
9177329a42 vcl: FontCharMap to use intrusive_ptr ImplFontCharMap
ImplFontCharMap was using it's own reference counting mechanism,
however we can use intrusive_ptr more effectively.

Added a unit test around FontCharMap.

Change-Id: Ifab6ce002fd1df8feb7e017dea3012ff9ea7f18a
Reviewed-on: https://gerrit.libreoffice.org/11804
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-10-06 00:13:38 +00:00
c9d4a2887c fdo#82577: Handle PolyPolygon
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows
PolyPolygon typedef.

Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-30 11:47:41 +02:00
8dbde0845a fdo#82577: Handle Region
Put the VCL Region class in the vcl namespace. Avoids clash with the X11
Region typedef.

Change-Id: I6e008111df7cf37121fbc3eaabd44a8306338291
2014-09-30 09:58:23 +02:00
26f2da07b1 loplugin: cstylecast
Change-Id: I58ec00d6f8a4cc6188877db1330c5e32c9db12e5
2014-09-29 12:50:34 +02:00
827c46e7d7 fdo#82577: Handle Window
Put the VCL Window class in the vcl namespace. Avoids clash with the X11
Window typedef.

Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-09-23 14:11:39 +03:00
60e78fbb80 fdo#82577: Handle Font
Put the VCL Font class in the vcl namespace. Avoids clash with the X11
Font typedef.

Change-Id: I1a84f7cad8b31697b9860a3418f7dff794ff6537
2014-09-18 08:54:37 +02:00
4a96ee8eb2 vcl: Rename GetImplFontCapabilities()
The data structure is not ImplFontCapabilities but FontCapabilities,
therefore the function name is very misleading.

Change-Id: I90f074902af4b4bee79cd445036dc24797836ac1
Reviewed-on: https://gerrit.libreoffice.org/11454
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-09-15 11:33:14 +00:00
91eb279ecd Revert "vcl: use DeviceCoordinate for GetCaretPositions in sallayout"
This reverts commit 1b42acdaeae134f94580d6e1eba89da16741d596.
2014-09-12 19:10:10 +02:00
1b42acdaea vcl: use DeviceCoordinate for GetCaretPositions in sallayout
Change-Id: I5a959e1c3806da713e106c1b0fc8690a6578987b
2014-09-12 01:45:27 +02:00
fee95be5b6 Resolves: fdo#82552 we only check pAlphaW on one branch
Change-Id: Ib2c5a0d751050af77f267edbb7a5a0fe57494622
2014-09-11 15:13:45 +01:00
4e31977bcd WaE: unused parameter
Change-Id: Ie3e6e2f0a498f0871e8b757cd7ab73fa4eba0060
2014-08-22 23:43:27 +02:00
46ac7d60dd font lookup - cleanup GetEnglishSearchName function signature.
Change-Id: I6e3ca358d88e0285fe6e07b0617f3078a5edb857
2014-08-22 16:22:13 +01:00
5660bc11b0 vcl: convert a couple of macros to static functions
Change-Id: I037dd97049aecff023f0ffb8dfdbb772dbde7ae0
Reviewed-on: https://gerrit.libreoffice.org/11069
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-08-22 08:17:07 -05:00
a69f8ea61c vcl: convert push flags to type-safe enum-like class
Change-Id: Ib49a0dd5ecee0225f51bea2ff1c0ab5326595a47
2014-08-21 09:17:32 +02:00
794d5ac4ac vcl: use enum for complex text layout constants
Since these constants are bitfield flags, we define some methods to make
working with them reasonably type safe.

Move the definitions to outdevstate.hxx, since we need the values there,
and that appears to be the "root most" header file.

Also dump TEXT_LAYOUT_BIDI_LTR constant, since it means the same thing
as TEXT_LAYOUT_DEFAULT (ie. 0), and leaving it in causes people to write
weird code thinking that it's a real flag.

Change-Id: Iddab86cd6c78181ceb8caa48e77e1f5a8e526343
Reviewed-on: https://gerrit.libreoffice.org/10676
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-08-20 09:01:26 -05:00
47f3485579 Revert "Resolves: fdo#82550 MacOSX GetTextBreak always return -1"
This reverts commit 4c1e2c446865b355f50720b8b96ec704822006dc.
it was just hiding the underlying bug.
2014-08-14 22:43:26 +02:00
d8584f62e2 fdo#82550 LogicWidthToDeviceCoordinate missed handling of mbMap == false
Change-Id: I98902ed266ae7b2737fa9720d69a4b87cc958d51
2014-08-14 22:42:16 +02:00
4c1e2c4468 Resolves: fdo#82550 MacOSX GetTextBreak always return -1
so multiline text ends up splitting over a huge number of
lines leading to massively tall dialogs when they contain
text which is supposed to line break

regression from 6ca2d0d6645a697d323593a401ea8b1da02445bf

Change-Id: I51cecd9164112af3208bffced63aed7e261ea9e2
2014-08-14 14:46:35 +01:00
ff209b1446 Avoid needless truncation to int
Change-Id: Ibb9088e73e3e48952ce7f2f4ec42392f7633e8a7
2014-07-30 16:21:55 +02:00
c61d0c6071 function abs given an argument of type long but has parameter of type int
Change-Id: Ibc64a17dc4a779e05946dfe5d1d12109e643a7fd
2014-07-29 10:25:18 +02:00
4cc1ed9ae9 coverity#707564 Uninitialized scalar variable
and

coverity#707566 Uninitialized scalar variable
coverity#707568 Uninitialized scalar variable
coverity#707576 Uninitialized scalar variable
coverity#1028320 Uninitialized scalar variable

Change-Id: I7191d019c1d7c4382253272fe7d58d82a4b41e13
2014-07-26 21:25:16 +01:00
6ca2d0d664 vcl use DeviceCoordinate got GetNextGlyphs
Change-Id: I0b03973b2d09a0ce51a6ee7dcca5a310a544c3a9
2014-07-20 22:11:00 +02:00
cd3d26b7ed vcl consitent use of long for corrdinate
most of length in vcl are calculated in 'long'
but array of X position tend to be in sal_Int32.
As a prep work to be able to support 'double'
as the base type of Device Coordinate, harmonize
the use of 'long' for non-float coordinate.

Change-Id: I7cb33301ff6a5e2c62247b36a4e07e168a58a323
2014-07-20 22:10:59 +02:00
8e21a02520 vcl: add floating equivalent for MapRes
Change-Id: I165e403d2834d341f7da7a280859afccb995a3bb
2014-07-20 22:10:59 +02:00
2b8528a274 Use DeviceCorrdinate for DXArray in FillDXArray and ImplLayoutArgs
Change-Id: Ifba7104a13cf737200c81d1a1bd5ece9a29da60e
2014-07-20 22:10:58 +02:00
7a8fcfca98 fdo#79673 quartz: draw 'bullet' for 'space' directly in one pass
the current implementation of CoreText simply dropped the proper
implementation of DrawTextArray, by ignoring DXArray
this very visibly borked the show-non-displayable character
feature of writer.. the bullet representing the 'spaces'
was quite misplaced.
This solve specifically this problem.
More work is needed to bring proper support of DXArray back to CoreText


Conflicts:
	vcl/inc/sallayout.hxx
	vcl/source/outdev/text.cxx

Change-Id: Idb2cc90d5ffaa8b83f79241cee2d512112d1c3be
2014-07-15 21:45:11 +02:00
bdab2dc21c avoid memory leak
Change-Id: I89e458dbd01a45761948b64cb457424383ca5f51
2014-07-14 18:51:00 +02:00
ee36fc7add fdo#80498: vcl: Revert "fdo#74124: Scale the pictures before calling ...
... ImplDrawAlpha()."

This reverts commit 3cf3700b7a903e88f5296076c40ae854bce91cdc.

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
cfca22cf7f vcl/source/outdev/outdev.cxx: drop unused svsys.h header
Change-Id: I21308351e86372ce938480a8514415756f9bf549
Reviewed-on: https://gerrit.libreoffice.org/10165
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-07-10 15:04:32 +00:00
07dcd679ff coverity#1225002 Uninitialized scalar field
Change-Id: Iec71c9b509b785a6fe043c62e103cb4a930fd416
2014-07-10 13:39:14 +01:00
d51f53fedb fdo#80014: vcl: fix drawing of linear gradients
There is an off-by-one error in OutputDevice::ImplDrawLinearGradient()
that causes the bottom line to remain black.

(regression from 04d937c1ec36c2d9fa8c90604c81a37d30e97da6)

Change-Id: I33948ec8065e446a9ec7efeab5e506c93fa2e9e8
2014-07-01 18:01:06 +02:00
59a2e1b9fa Cleanup: removed comments and debugging output
Change-Id: I41f13d33da641153784725344f5bd526ca69542b
2014-06-30 22:54:44 +02:00
ae915ba34f More debugging; fixed Font::IsTransparent
Change-Id: Idcb54408dd3cf6561b78eb28fdb409d2e31df541
(cherry picked from commit d84dba8b01c1f240f22b774c951ebf206d5a3ac9)
2014-06-30 22:54:42 +02:00
2f54ab7089 Minor changes.
Change-Id: I3b8c51690eb14601435653e9a2255a5c6ed4fd7e
(cherry picked from commit 0b8fe9834b398db7550f30718b3cb63860c6165d)
2014-06-30 22:54:40 +02:00
f7f4059805 Debugging output in OutputDevice::SetTextFillColor
Change-Id: I78a75a94e4012eded1a4a5b4c36d8b399a4dda6c
(cherry picked from commit 1441ae75b005b4ff1ae2683755a12c5813a3a6b3)
2014-06-30 22:54:40 +02:00
a74e588518 Setting SetTextFillColor from Attrs. Experiment with line color
Change-Id: If34f000d6c5ef6ec38f7f735ada194b8fff4f56d
(cherry picked from commit 7fb0e8c9a659417607c85f9b0e8245e4af4552dc)
2014-06-30 22:54:39 +02:00
7b59e44925 Cleaned up code from tranparency in vcl. Trying setfillcolor from edit attrs
Change-Id: I263012332e43573f260ac8c54612576eb21a11a1
(cherry picked from commit 02385eb4d8de3c5a57511d8bae3c42a523470838)
2014-06-30 22:54:39 +02:00
be34ea6f62 Cleaned up code from operations in vcl
Change-Id: Ica5194f0cf6e30ec099974ae8b794fb2bc5e654a
(cherry picked from commit 4445f361aa2730b61fdd339dcdd7014b266e5c42)
2014-06-30 22:54:38 +02:00
dbff42a078 SetTextFillColor immediately before DrawTransparent. DrawTextRect commented
Change-Id: Id283624484dfcda91546fd4965bc0b6b92614f55
(cherry picked from commit ebc7be61df384120f1d0420d3e4dc5e3ac5599f4)
2014-06-30 22:54:38 +02:00
44f6d7a2c5 Transparency with DrawTransparent in addition to DrawRect
Change-Id: I9e8221652b74a3004857ef4b12c6b45563a373b5
(cherry picked from commit 2f8660008ddd32c8f24825d5ba3e751bc65d6d3e)
2014-06-30 22:54:38 +02:00
6b490f6be9 Transparency by replacing DrawRect
Change-Id: I5ba220df841cbe650c910c1c7bc1815900f13c53
(cherry picked from commit 6ec2a1a6922d22fa5efb25982b0b51cef7a97499)
2014-06-30 22:54:38 +02:00
f850bbb4cb Changed SetFillColor to SetTextFillColor
Change-Id: I3c19ac80318733ccae1e8829e3269ec8c716869e
(cherry picked from commit 33384f3d23958b62e1ec9f72f2a0e6424313a177)
2014-06-30 22:54:38 +02:00
23cd36d876 Fixed color problem
Change-Id: I7e9340ebab26d3c979571155a3e9d051c41c58f4
(cherry picked from commit aa7d40399758c7f2270dfb0b71f4bcc39d0e24ea)
2014-06-30 22:54:37 +02:00
be085bf523 Moved Text Filling Color in OutDev. Text Filling occurs in ImplDrawText
Change-Id: I9c75066a8dea32721757d0511a2af58c68408438
(cherry picked from commit b09cf493611f2521e66159287b88acc3c05d6d33)
2014-06-30 22:54:37 +02:00