Commit Graph

197 Commits

Author SHA1 Message Date
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
Andrea Gelmini
ca9de688c2 Fix typos
Change-Id: I549635318f46718042e50c8f89ce3c620cade990
Reviewed-on: https://gerrit.libreoffice.org/16281
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-16 11:10:51 +00:00
Noel Grandin
7a0af37989 convert SAL_LAYOUT flags to scoped enum
Change-Id: I0aeea1f32136e43e90a1afb0ea84dbaff2b77587
2015-05-20 09:52:08 +02:00
Stephan Bergmann
23b34e148b More loplugin:simplifybool
Change-Id: I34cb4961f6db405cc3b72d488d163487489b0251
2015-04-27 15:31:03 +02:00
Caolán McNamara
b1030f75d3 Resolves: tdf#86399 don't clobber cluster start caret pos
with other cluster element bounds

Change-Id: I2cc976eb6a0ef42a2678be80637c7220e2247921
2015-04-02 16:30:41 +01:00
Noel Grandin
3e672693e3 loplugin:staticfunction
Change-Id: I909cf7e77f9d7194575636248196fda311fffdb6
2015-04-01 10:37:02 +02:00
Michael Stahl
b9782a2b59 tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo
When a SwTxtFormatInfo is created to format a paragraph, pre-compute the
result of vcl::ScriptRun::next() and cache it for future calls to
OutputDevice::GetTextBreak() and GetTextWidth().

This requires adapting a bunch of methods to pass the additional
parameter, and some classes to backup and restore the cache when they
replace the text of the SwTxtFormatInfo.

There is some code in vcl OutputDevice::ImplPrepareLayoutArgs()
to modify the passed string and replace digits depending on
"meTextLanguage" member; try to set it to the correct value when
creating the layout cache (unfortunately it's not possible if the user
sets the CTL Numerals config to the non-default "Context" value).

Another issue is the check in OutputDevice::ImplLayout() if there is
a mpConversion member on the font; apparently this is used to translate
between different Symbol fonts, so not very important; just ignore the
cache in this case.

This reduces vcl::ScriptRun::next() from 11 to 0.36 billion callgrind
cycles when built with GCC 4.9.2 -m32 -Os (which is still 16% of the
formatting).

Change-Id: I61fb8530333f2e7a9199f767c00cf2181ba49951
Reviewed-on: https://gerrit.libreoffice.org/14732
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-31 20:08:35 +02:00
Norbert Thiebaud
3c6fd5a59b Revert "tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo"
This reverts commit 1efe5fe380.
which broke windows.
2015-03-28 20:38:22 -05:00
Stephan Bergmann
18804c92e1 Clean up C-style casts from pointers to void
Change-Id: Iad602cece6e328c7f5d5f36adb294c97b152ade3
2015-03-28 19:09:28 +01:00
Michael Stahl
1efe5fe380 tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo
When a SwTxtFormatInfo is created to format a paragraph, pre-compute the
result of vcl::ScriptRun::next() and cache it for future calls to
OutputDevice::GetTextBreak() and GetTextWidth().

This requires adapting a bunch of methods to pass the additional
parameter, and some classes to backup and restore the cache when they
replace the text of the SwTxtFormatInfo.

There is some code in vcl OutputDevice::ImplPrepareLayoutArgs()
to modify the passed string and replace digits depending on
"meTextLanguage" member; try to set it to the correct value when
creating the layout cache (unfortunately it's not possible if the user
sets the CTL Numerals config to the non-default "Context" value).

Another issue is the check in OutputDevice::ImplLayout() if there is
a mpConversion member on the font; apparently this is used to translate
between different Symbol fonts, so not very important; just ignore the
cache in this case.

This reduces vcl::ScriptRun::next() from 11 to 0.36 billion callgrind
cycles when built with GCC 4.9.2 -m32 -Os (which is still 16% of the
formatting).

Change-Id: I61fb8530333f2e7a9199f767c00cf2181ba49951
Reviewed-on: https://gerrit.libreoffice.org/14732
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-28 15:34:34 +00:00
Stephan Bergmann
513fc29160 const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I17c57a85bcda98ef36ddefd6562d4681d0c7d5fc
2015-03-26 15:33:40 +01:00
Noel Grandin
062e40c76b loplugin:constantfunction: vcl
Change-Id: I985b781a8d53190505fcb1182749cdaf5cd0f8d0
2015-03-19 10:45:00 +02:00
Chris Sherlock
8e33c9be87 vcl: add GenericSalLayout::GetTextRect()
I have extended GlyphItem to also record the original and new height,
along with the y offset.

Change-Id: I1e9646a8f0d844951d5533d035d9a16dbc8e257c
Reviewed-on: https://gerrit.libreoffice.org/14216
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2015-01-30 03:05:32 +00:00
Chris Sherlock
ac2008d3c4 vcl: make glyph iterator variable names more clear in GenericSalLayout
Change-Id: I4af8963ab7a9a53b457ea6054a603257b35a0e6e
2015-01-15 13:59:18 +11:00
Chris Sherlock
b0786565db vcl: possible regression introduced in fa1f37753d as part of i99295
I believe the intent was to "retarget unresolved pLogCluster[n] to a glyph inside the cluster".
Unfortunately in the loop that detects clusters there was a typo and we are only indexing
element 0 of the array:

    // retarget unresolved pLogCluster[n] to a glyph inside the cluster
    // TODO: better do it while the deleted-glyph markers are still there
    for( n = 0; n < nCharCount; ++n )
        if( (p = pLogCluster[0]) >= 0 )
            break;

That just doesn't make any sense, I believe we should be accessing pLogCluster[n].
If not, then why not just do:

    p = pLogCluster[0];
    n = nCharCount - 1;

Change-Id: I9d8873541b5c794071d69c0f63df88f17a352904
Reviewed-on: https://gerrit.libreoffice.org/13876
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-01-12 18:28:16 +00:00
Chris Sherlock
7201fa0ddd vcl: update comments about GenericSalLayout::ApplyDXArray
Basically, the issue noted here (justification adjustment issues in CTL) is
a legacy problem caused by emulating the EmrText structure, which is an
Enhanced Metafile (EMF) structure (or "object"). The EmrText structure holds
an array of inter-character spacing widths for text. It is used in the EMF
records EMR_EXTTEXTOUTA and EMR_EXTTEXTOUTW, which is flawed in that it
doesn't consider issues around CTL scripts and only cares about character
interspacing - i.e. it maps to each printable character, and doesn't take into
consideration other sorts of glyphs.

Change-Id: Ib7ae994758a835e9d8cb5f479a0b91d3d5809b8c
2015-01-12 10:05:40 +11:00
Stephan Bergmann
9720e8e5ef Some loplugin:revisibility clean-up
Stumbled across such redundant visibility re-specifications when looking at the
odd case of cppu_unsatisfied_iquery_msg declared CPPU_DLLPUBLIC in
cppu/source/cppu/cppu_opt.cxx and used in inline code in
include/com/sun/star/uno/Reference.hxx with only a declaration lacking
CPPU_DLLPUBLIC visible, and wondering how that actually works on Windows.

However, this plugin is probably not worth it being run all the time, so
committing it to compilerplugins/clang/store/.

Change-Id: Ibc3c4e7499213de1b419ce7eb85455cb832e1510
2015-01-05 13:10:48 +01:00
Kohei Yoshida
96422e999f Remove ptr_deque.hpp header include from vcl/outdev.hxx.
This header is also a very high impact header.

Change-Id: Iab63f2ec2edebc14b47820c6377a7f83131cfd06
2014-11-25 21:14:46 -05:00
Norbert Thiebaud
91eb279ecd Revert "vcl: use DeviceCoordinate for GetCaretPositions in sallayout"
This reverts commit 1b42acdaea.
2014-09-12 19:10:10 +02:00
Norbert Thiebaud
1b42acdaea vcl: use DeviceCoordinate for GetCaretPositions in sallayout
Change-Id: I5a959e1c3806da713e106c1b0fc8690a6578987b
2014-09-12 01:45:27 +02:00
Norbert Thiebaud
1a9264c472 extra witdh for GetTextBreak is of DeviceCoordinate
Change-Id: Ic25eae1e9b8ae14022ee8d0373be0978ebc21267
2014-09-03 10:58:34 +02:00
Norbert Thiebaud
1632f2a42e SalLayout GetTextWidth return DeviceCoordinate
Change-Id: I5b995e54992213e95845e60169238270863e9a7e
2014-09-03 10:58:34 +02:00
Norbert Thiebaud
32a92502fd GetTextBreak takes a DeviceCoordinate as width
Change-Id: Ie03732a0966eedf6c0226beed83356ae4886a016
2014-08-14 22:42:16 +02:00
Michael Stahl
6defffea57 vcl: evidently a little more type safety is required here
MultiSalLayout::AdjustLayout() crashes with mangled stack.

(regression from 2b8528a274)

Change-Id: I20b7980dd89dd1b72063c2187ac3a4735babc4c4
2014-08-02 19:09:43 +02:00
Norbert Thiebaud
6ca2d0d664 vcl use DeviceCoordinate got GetNextGlyphs
Change-Id: I0b03973b2d09a0ce51a6ee7dcca5a310a544c3a9
2014-07-20 22:11:00 +02:00
Norbert Thiebaud
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
Norbert Thiebaud
2b8528a274 Use DeviceCorrdinate for DXArray in FillDXArray and ImplLayoutArgs
Change-Id: Ifba7104a13cf737200c81d1a1bd5ece9a29da60e
2014-07-20 22:10:58 +02:00
Stephan Bergmann
213bc71f84 Clean up function declarations and some unused functions
Change-Id: I382289c7188dfdc9839ff9e6362b6e039ffc5f9e
2014-04-08 08:39:36 +02:00
Tor Lillqvist
50bf123ddb Kill superfluous vertical whitespace
Change-Id: I81ce8fd7022bf283db668705efdfb0666f87bde9
2014-04-02 16:54:18 +03:00
Alexander Wilms
d9f0af83b7 Remove visual noise from vcl
Conflicts:
	vcl/source/app/settings.cxx
	vcl/source/window/dockmgr.cxx
	vcl/source/window/dockwin.cxx
	vcl/source/window/floatwin.cxx
	vcl/source/window/toolbox2.cxx

Change-Id: Ie67681549a76e77064b09d4b5bf80fe4c6010341
Reviewed-on: https://gerrit.libreoffice.org/8339
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-26 04:56:16 -06:00
Alexander Wilms
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
Khaled Hosny
97ed0bdcb2 Use a more descriptive and distinct field name
It is not immediately clear what maRerun is, besides it can be
confused with regular maRuns.

Change-Id: Idc754a185149a9a4d5e7495b76d8e61f783b42d2
2014-01-18 01:11:09 +02:00
Stephan Bergmann
5169abbac9 bool improvements
Change-Id: I7ec4f5b2e691ec03e9e2c5ca3a004f1e04efbc27
2014-01-17 18:45:14 +01:00
Herbert Dürr
a16aacd647 Resolves: #i123840# add and use the sal_GlyphId type
Using the central definition adds consistency and cleans up many ad hoc
declarations. The type sal_GlyphId will become a class in the future so
that its bitfield operations etc. can then be isolated into nice methods.

(cherry picked from commit c0a84ad10964fb7a65b6239cbe1cef8698b5d17b)

Conflicts:
	vcl/aqua/source/gdi/salatslayout.cxx
	vcl/aqua/source/gdi/salgdi.cxx
	vcl/generic/glyphs/gcach_ftyp.cxx
	vcl/generic/print/genpspgraphics.cxx
	vcl/generic/print/glyphset.cxx
	vcl/generic/print/glyphset.hxx
	vcl/headless/svptext.cxx
	vcl/inc/generic/genpspgraphics.h
	vcl/inc/generic/glyphcache.hxx
	vcl/inc/os2/salgdi.h
	vcl/inc/quartz/salgdi.h
	vcl/inc/salgdi.hxx
	vcl/inc/sallayout.hxx
	vcl/inc/unx/salgdi.h
	vcl/inc/vcl/fontmanager.hxx
	vcl/inc/win/salgdi.h
	vcl/os2/source/gdi/os2layout.cxx
	vcl/os2/source/gdi/salgdi3.cxx
	vcl/source/gdi/pdfwriter_impl.cxx
	vcl/source/gdi/sallayout.cxx
	vcl/source/glyphs/gcach_ftyp.hxx
	vcl/source/glyphs/gcach_layout.cxx
	vcl/source/glyphs/glyphcache.cxx
	vcl/source/glyphs/graphite_layout.cxx
	vcl/unx/generic/fontmanager/fontmanager.cxx
	vcl/unx/generic/gdi/gcach_xpeer.cxx
	vcl/unx/generic/gdi/gcach_xpeer.hxx
	vcl/unx/generic/gdi/salgdi3.cxx
	vcl/unx/generic/gdi/xrender_peer.hxx
	vcl/unx/headless/svpgdi.hxx
	vcl/unx/headless/svppspgraphics.cxx
	vcl/unx/headless/svppspgraphics.hxx
	vcl/win/source/gdi/salgdi3.cxx
	vcl/win/source/gdi/winlayout.cxx

Change-Id: Ic629131950360e2df4c15db30d6a5362193c6330
2014-01-06 14:32:30 +00:00
Caolán McNamara
001bd53a18 CID#1038302 (unlikely) invalid iterator use
Change-Id: Iff61209eb840d5b6722b651580a77ae50d610460
2013-12-19 11:31:14 +00:00
Caolán McNamara
108eee306e Related: rhbz#1040291 Change language name from 'Oriya' to 'Odia'
Except for our external api where the Oriya is stuck (and similar for
the vba implementation)

Change-Id: I8288c930567385eea49a4c303727b13ef8b8a89f
2013-12-11 15:11:18 +00:00
Caolán McNamara
d83328b233 longparas: convert GetTextBreak to sal_Int32
Change-Id: I693e4c9916e1968c33ebd922829662f6efc27bfb
2013-12-03 16:09:36 +00:00
Khaled Hosny
71077148d4 fdo#70968: Incorrect rendering of Devanagari short 'i' vowel
It seems that some Indic fonts assign 'mark' glyph class to combining
spacing marks (spacing not non spacing) so my reliance on the glyph
class to set the IS_DIACRITIC flags broke those fonts. This is a bandaid
to get around the issue, plus some long rant! (at this rate, I'll be
writing "The VCL haters handbook" pretty soon).

Change-Id: I3ff892acf746d50182573f94e7e8c3c6f9464ae0
2013-10-30 09:39:42 +02:00
Eike Rathke
6b678c135d added/checked/aligned MS-LangIDs and mappings from new MS-LCID.pdf
... found at http://msdn.microsoft.com/library/cc233965.aspx (the 5th or
6th place I'm aware of where MS defines LCIDs, all different ...)
* a bunch of new definitions up to Windows 8.1
* lots of cross-checks done with SIL, Ethnologue, ...

Change-Id: Ifae8e676558c6712fe752856acca600d05d0a63f
2013-10-24 01:54:59 +02:00
Eike Rathke
f51e79aaa8 Font and ImplLayoutArgs with LanguageTag
Avoid the gazillion temporary conversions / Impl searches.

Change-Id: I5232589f1e31d1cbb6becc198b12daabf1038f31
2013-09-20 20:17:25 +02:00
Eike Rathke
6419c03230 removed primary-only LANGUAGE_URDU
Change-Id: Ieaba4362fafeecd2d20bff63531783f5e33662f7
2013-08-29 23:19:10 +02:00
Herbert Dürr
022da4ea29 Resolves: #i122948# fill gaps in glyphs->chars mapping for usp10-layouts
using a heuristic that assumes a glyph with unknown char mapping
is the continuation of the preceding glyph. If there is no known
preceding mapping use the run bounds.

(cherry picked from commit 576e4ea626e1c1ffcf9d025e692db62fed8c3cab)

Change-Id: I70e58a02d814e14e9592ff8efc0ae630346ae5df
2013-08-06 16:15:18 +02:00
Takeshi Abe
8624906bc4 Mark as const
Change-Id: Ia5f9724002da11da69f70bb0f71d44c3b5a19bcb
2013-07-05 10:38:08 +09:00
Khaled Hosny
4e6b13fb23 Fix indentation
Change-Id: I8e1621a160ea78b18a5b366f61938fa4dadd72e4
2013-06-22 11:23:53 +02:00
Khaled Hosny
3d12036000 Get rid of SalLayout::GetFallbackFontData()
This is only used in conjunction with SalLayout::GetNextGlyphs() in
vcl/source/gdi/pdfwriter_impl.cxx to retrieve the fallback font, if any,
used to layout the given glyph, but it is a very convoluted way to do a
straight forward thing, and hard to adapt for new SalLayout
implementations.

So now I just pass a fallback fonts array, when requested, in
GetNextGlyphs() itself.

Change-Id: I24e7931f64867a4fb4e7b728c65faa6198e24aba
Reviewed-on: https://gerrit.libreoffice.org/4285
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2013-06-16 15:30:01 +00:00
Oliver-Rainer Wittmann
30a98a5851 limit next codepoint index to the minindex..endindex bounds
Patch by: hdu

(cherry picked from commit 6115cd0bf8ef8d7e063615636175e148c8d57da1)

Change-Id: I62265b3021f86bee1f78a79a2c668c1ce09c5521
2013-06-11 11:33:08 +01:00
Khaled Hosny
0e53377012 Revert "Fix improper glyph positioning with old fonts"
This reverts commit cef3f3aac2f7a372e796deac4ee3e8155c5eb697.

The previous commit addressed the real issue.

Change-Id: I802e5f19e4a4991c316135f3984a1b9a6533a104
2013-05-25 12:10:25 +02:00
Khaled Hosny
989225a89b Fix improper glyph positioning with old fonts
Apparently this second mnXOffset is not needed, further more it breaks
some old Microsoft fonts.

Change-Id: Ice033cb6bcb3f1bdfeef31a8406a7a2e5487da97
2013-05-23 23:00:17 +02:00
Khaled Hosny
736adbb468 Fix left to right full justification
I was overloading ApplyDXArray() with a HarfBuzz specific implementation
because the GenericSalLayout one was screwing right to left kerning, but
it seems to have broken left to right full justifications. Since
mnXOffset was introduced a bit earlier to fix a similar issue, it can
now be used here as well to minimize the possible side effects.

Seems to work fine for both left to right and right to left text now,
but at least one of my Arabic tests is regressing, so might need some
tweaking.

Change-Id: I1239b0ec77a4978f981a480400a6d01cda18af79
2013-05-23 09:50:46 +02:00
Tor Lillqvist
d664f27960 Revert "fdo#62846 incorrect glyph to Unicode mappings in PDFs"
Breaks the build for Windows: vcl/win/source/gdi/winlayout.cxx(1897) :
error C2065: 'nCharPos' : undeclared identifier

This reverts commit 0b70e4ea4f.
2013-05-22 15:30:36 +03:00