summaryrefslogtreecommitdiff
path: root/vcl/win
AgeCommit message (Collapse)Author
2017-02-12VCL: Simplify WinSalInstance::CreateVirtualDeviceArnaud Versini
Change-Id: I26e9823faa53fdbb0ae468f03e40b0a4e5313b49 Reviewed-on: https://gerrit.libreoffice.org/34170 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-10Remove MinGW supportStephan Bergmann
In OOo times, there'd originally been efforts to allow building on Windows with MinGW. Later, in LO times, this has been shifted to an attempt of cross- compiling for Windows on Linux. That attempt can be considered abandoned, and the relevant code rotting. Due to this heritage, there are now three kinds of MinGW-specific code in LO: * Code from the original OOo native Windows effort that is no longer relevant for the LO cross-compilation effort, but has never been removed properly. * Code from the original OOo native Windows effort that is re-purposed for the LO cross-compilation effort. * Code that has been added specifially for the LO cross-compilation effort. All three kinds of code are removed. (An unrelated, remaining use of MinGW is for --enable-build-unowinreg, utilizing --with-mingw-cross-compiler, MINGWCXX, and MINGWSTRIP.) Change-Id: I49daad8669b4cbe49fa923050c4a4a6ff7dda568 Reviewed-on: https://gerrit.libreoffice.org/34127 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-09remove ConnectionIdentifierType enumNoel Grandin
since we only use the AsciiCString enumerator. Consequently simplify the GetConnectionIdentifier method Change-Id: I9e1a1318d2f12bfd18edeb8479e0e7171b22d0f1 Reviewed-on: https://gerrit.libreoffice.org/34026 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-09convert FontType to scoped enumNoel Grandin
Change-Id: Ieb8f90be8effde5f25bc872784c3ea2177b14bf9 Reviewed-on: https://gerrit.libreoffice.org/34056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-09Don’t look for bundled fonts relative to executable path on WindowsKhaled Hosny
Just do like other platforms, so that the fonts are avialble to unit tests since cppunittester is not run from instdir. Change-Id: Ib209473f5b6b07a154fecb430dca45b32e8fa556 Reviewed-on: https://gerrit.libreoffice.org/34048 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-02-08loplugin:unusedenumconstants read-only constants in vclNoel Grandin
Change-Id: I8c81444cbecdc103cc47d9a4133b0b4d9010e0c2 Reviewed-on: https://gerrit.libreoffice.org/34018 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08drop unused enum TTCreationFlagsNoel Grandin
there is only one method using it, and all of the call sites pass 0 Change-Id: I5d71b36cf890fbcf0be9d795756da0cfd61ae309 Reviewed-on: https://gerrit.libreoffice.org/34024 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07tdf#105286 use alternative font when glyph is not vertical.Mark Hung
In vertical layout, a vertical font is selected. For windows, that means prepending a '@' to the font name. Switch back to the one without '@' in order to display characters that needs to be rotated 90 degrees in vertical layout correctly. Change-Id: I4e0361929f898eddc671b739b36a12dd26d68018 Reviewed-on: https://gerrit.libreoffice.org/33064 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-02-05sal_uIntPtr to sal_uInt16Matteo Casalin
Change-Id: If463ae457f53a0a8b12cc0748afbc654f54ae3c3
2017-02-02loplugin:useuniqueptrStephan Bergmann
Change-Id: I3a246a22baaac8195dc1b94c42994de7d80e8336
2017-02-02convert method names in tools::SvRef to be more like our other..Noel Grandin
reference classes, uno::Reference and rtl::Reference. Specifically rename Is()->is() and Clear()->clear(). Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae Reviewed-on: https://gerrit.libreoffice.org/33576 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-24loplugin:useuniqueptrStephan Bergmann
Change-Id: I502ebf4024cd9b0ee61d58d6b6a8e342c7ceac08
2017-01-15tdf#105015: Don’t ignore all printer fontsKhaled Hosny
For whatever reason we query printer output device for fonts and for whatever reason GDI will only report fonts from the printer which often in formats we want to ignore. This results in aborting the application when we reject all fonts on the printer! Just special case printer output devices and hope for the best. I think this commit is partially blamed as it is evidenced now that there was a good reason to only abort for window output devices, but I’m leaving this as it is for now: commit ea7102c93c33884a68d4dba0de7d52f8ed4f4579 Author: Chris Sherlock <chris.sherlock79@gmail.com> Date: Tue Mar 25 21:54:20 2014 +1100 fdo#74702 OutputDevice::ImplInitFontList() fails if no fonts on device It makes no sense that ImplInitFontList() only fails for Window instances. I have carefully checked all the functions that use this function, and there are no good cases when no fonts won't cause problems. In fact, we have a number of functions that specifically rely on the fact that ImplInitFontList will populate OutputDevice::mpFontCollection with at least one font. Therefore, I'm making this abort if it can't populate the collection, regardless of whether it is a Window, Printer or VirtualDevice. I have also refactored GetDefaultDevice - I now check the default pOutDev parameter to see if it is NULL (the default), in which case it is referring to the default window, so I call on Application::GetDefaultDevice() instead of going straight to the pimpl data structure used by the Application class. Reviewed-on: https://gerrit.libreoffice.org/33014 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 88d6675a40034fa786efd75cf14175f3c0c83e2e) Change-Id: I3f34ba0cea9f88966ace3a5ef7fac868972ea5ac Reviewed-on: https://gerrit.libreoffice.org/33087 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-01-12Drop unused struct membersKhaled Hosny
Change-Id: I37aea9a2a40ab0e9642709de3b9e935bee9a6a53 Reviewed-on: https://gerrit.libreoffice.org/32986 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2017-01-08Simplify setting Kashida width on WindowsKhaled Hosny
This should also make sure we are getting it from the current font, which the old, convoluted way does not seem to guarantee. Change-Id: If0a4cf18e472b1489115eeb7b1b2bdbb5f13abb0 Reviewed-on: https://gerrit.libreoffice.org/32595 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-01-04tdf#97228 Moved class ControlCacheKey in a seperate include file.Huzaifa Iftikhar
class ControlCacheKey defined in include/vcl/salnativewidgets.hxx is used only by vcl therefore it is moved to a seperate include file named ControlCacheKey.hxx which is inside vcl/inc/ControlCacheKey.hxx. This header file contains the definition of the the class ControlCacheKey. Since this class uses an object of another class named Size which is defined in gen.hxx therefore this is included in ControlCacheKey.hxx. All the files that references the class ControlCacheKey includes ControlCacheKey.hxx with the syntax: #include "ControlCacheKey.hxx" Change-Id: I7d7b3e1cf6950a953e6bbed670c1914826b2bacd Reviewed-on: https://gerrit.libreoffice.org/32422 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-01-02The mfFontScale[n] is always 1.0Khaled Hosny
Change-Id: Ica2e67632f5bfe1f70ba7b2d7502257b47d053ce Reviewed-on: https://gerrit.libreoffice.org/32592 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-21tdf#104733: Don't ignore OpenType-CFF fons on WindowsKhaled Hosny
This is a folloup for ef4b9032de55e6b1b182e4ead1bbe6e590df296e, turns out TRUTYPE_FONTTYPE does not cover CFF fonts like I thought (the fonts that I was checking were actually TTF fonts). Change-Id: I2d7b34b625aa03134421dc44a24e3c66be25df98 Reviewed-on: https://gerrit.libreoffice.org/32258 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-20Update duplicated / outdated NWS documentationJan-Marek Glogowski
Removes the old, copied NWS documentation blocks from all native implementations and update the parent SalGraphics documentation. Change-Id: I0eff8ea0987c5c841e1b023340b1c3787c09e2ca
2016-12-20try to avoid the annoying focus stealing on windowsMarkus Mohrhard
Change-Id: Ic6d3492a4707f24b616a7dee34a111ba0af4f281 Reviewed-on: https://gerrit.libreoffice.org/32207 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-12-16tdf#104159: Fix caching glyphs of non-UI fontsKhaled Hosny
Partially reverts "tdf#103725: Fix horizontal scaling on Windows", which didn't work on newer Windows versions anyway. This reverts commit a5750d92b2136d60d698b41ef5760f2efac0ffce. Change-Id: Ia4bb426a21804517d3ec313ab7494ba121c5751b Reviewed-on: https://gerrit.libreoffice.org/32068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-16-Werror,-Wunused-function (clang-cl)Stephan Bergmann
Change-Id: I19292f03c1a28eed8712dc83dc9cc0334c8f45e3
2016-12-16Fix typo from 6c436ba09cb35235ce6f4065cf74c9a6ff14a4bdKhaled Hosny
This broke OpenGL glyph caching since we were using a different DC than the one we selected the font on. Change-Id: I43218891aa1bc75599700ce6e0b582a5e73ff210
2016-12-16tdf#104159: Re-enable OpenGL glyph caching on WindowsKhaled Hosny
Change-Id: Icafec05a8cf4428d806efcb286addf3042fcf021 Reviewed-on: https://gerrit.libreoffice.org/32026 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-15tdf#103514: Try harder to ignore non-SFNT fontsKhaled Hosny
It seems that Script (and probably other bitmap fonts) have zero nFontType, so instead if checking for RASTER_FONTTYPE, check for not TRUTYPE_FONTTYPE (which seems to cover both TrueType and CFF-based SFNT fonts). Change-Id: Ie39ed99b219b756885b13b3ecbf3616556a277db Reviewed-on: https://gerrit.libreoffice.org/32031 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-15Revert "tdf#54169 Don't show acclerators by default on Windows"Samuel Mehrbrodt
Reverted because of issues mentioned in the bug report. This reverts commit 64889c9fb6c3e8e7b7a7349833f7a10236104168. Change-Id: I10fa0d0e55fd4c7c3624d9eb8a97e8c068b9db17 Reviewed-on: https://gerrit.libreoffice.org/32032 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2016-12-11GF_VERT is only used once, move itKhaled Hosny
Change-Id: I15289eecfbfb29ee549470a7f752e0c7fd9f811e Reviewed-on: https://gerrit.libreoffice.org/31820 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-11sal_GlyphId is a simple glyph id nowKhaled Hosny
No more cleverness. Change-Id: I760c602802961b37728c6987c4ade14fb02ca034 Reviewed-on: https://gerrit.libreoffice.org/31819 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-11Don’t encode the vertical flag in the glyph idKhaled Hosny
Change-Id: I00485dd4d42004e4eaa163a9e6ad0a43cf98a30a Reviewed-on: https://gerrit.libreoffice.org/31816 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-10Remove noop SalLayout::UseCommonLayout()Khaled Hosny
Change-Id: Ifc143f33bc4e087726ada1e3b1b5182bf830b0cb Reviewed-on: https://gerrit.libreoffice.org/31821 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-10Use GlyphItem in more placesKhaled Hosny
Change-Id: Ic0dd8c0311161271817eb9a3f454d00a319e43a8 Reviewed-on: https://gerrit.libreoffice.org/31814 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-10Pass GlyphItem aroundKhaled Hosny
We have this nice structure that contains (almost) all the information we need, so pass it around instead of passing separate fragments of said information. The ultimate is to kill the horrible sal_GlyphId hack if encoding various bits of information in the higher bits of a 32-bit integer. Change-Id: Ie496bb4c2932157527a388e2a94e46bf0a325a70 Reviewed-on: https://gerrit.libreoffice.org/31781 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-08tdf#54169 Don't show acclerators by default on WindowsAbhilash Singh
Change-Id: I2bdecae83ed23e4f6fff0be99b46005a6db43837 Reviewed-on: https://gerrit.libreoffice.org/31711 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-07convert PolyFlags to scoped enumNoel Grandin
and remove the XPolyFlags enum, which has the same values and was being converted to PolyFlags anyhow Change-Id: Iaead84933c79a7603698a4e50257dd944df89c41 Reviewed-on: https://gerrit.libreoffice.org/31627 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-03add the SalAbort message to the crash reporterMarkus Mohrhard
Change-Id: Ibe08034bcf2a73fb12562c87c2898db1e974376c Reviewed-on: https://gerrit.libreoffice.org/31577 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-12-01Unused codeKhaled Hosny
Change-Id: Idfc964930c242d752a78cd109d75d809bce4de11 Reviewed-on: https://gerrit.libreoffice.org/31470 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-01Kill old Windows layout enginesKhaled Hosny
Change-Id: I33f8322a6371150698bf926165fb6dddb9d4092c Reviewed-on: https://gerrit.libreoffice.org/31452 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-30tdf#104013: Band aid for overzealous clippingKhaled Hosny
Change-Id: If66b7a61f4165ea2e504625cde36161adf945a53 Reviewed-on: https://gerrit.libreoffice.org/31418 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-29Strip down GetEmbedFontData to what is really usedKhaled Hosny
The only remaining user is EmbeddedFontsHelper, and it just needs the raw font data. Change-Id: Ia15c59158b5c9e44d0936463553303a3c8b6e0f5 Reviewed-on: https://gerrit.libreoffice.org/31374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-29SalGraphics::GetFontEncodingVector() is a noop nowKhaled Hosny
Change-Id: Id706fa242277a0ea7ba44f52eab4a56e404bd2fa Reviewed-on: https://gerrit.libreoffice.org/31372 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-29Drop a bunch of font metrics flagsKhaled Hosny
These flags mean nothing these days, there are either always true or always false, since we no longer support bitmap or Type 1 fonts. Change-Id: Ie14ca480225a6346d868a44e58e7666c3a06931d Reviewed-on: https://gerrit.libreoffice.org/31346 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-26ServerFontLayout is already goneKhaled Hosny
Kill DrawServerFontLayout, and rename DrawSalLayout to DrawTextLayout, in parity with GetTextLayout. Change-Id: I3f61efd8c6ecde64f28301dca6a7c91eb0873702 Reviewed-on: https://gerrit.libreoffice.org/31224 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-26Kill old Graphite layout enginesKhaled Hosny
Change-Id: Ia19d4d0a3a33694b6edfff62e6b40028dac19677 Reviewed-on: https://gerrit.libreoffice.org/31212 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-25convert MODKEY constants to o3tl::typed_flagsNoel Grandin
Change-Id: I53a6f6f6b12e0fb299e7d76e8e8f354ef3afbbb3 Reviewed-on: https://gerrit.libreoffice.org/31152 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-22tdf#55469 Consistent line spacing across platformsKhaled Hosny
We current use platform APIs to calculate line spacing, however different platforms behave differently: * FreeType and Core Text will prefer hhea table over OS/2, and OS/2 Typo metrics over Win ones. * GDI’s TEXTMETRIC only uses OS/2 Win metrics, while NEWTEXTMETRIC seems to use Typo one, but we use only the old TEXTMETRIC. So we get inconsistent line spacing and we have no control which of three competing sets of line spacing metrics we end up using. The current conventional wisdom is that: * hhea metrics should be used, since hhea is a mandatory font table and should always be present. * But if OS/2 is present, it should be used since it is mandatory in Windows. OS/2 has Typo and Win metrics, but the later was meant to control text clipping not line spacing and can be ridiculously large. Unfortunately many Windows application incorrectly use the Win metrics (thanks to GDI’s TEXTMETRIC) and old fonts might be designed with this in mind, so OpenType introduced a flag for fonts to indicate that they really want to use Typo metrics. So for best backward compatibility: * Use Win metrics if available. * Unless USE_TYPO_METRICS flag is set, in which case use Typo metrics. This patch does this by reading the hhea and OS/2 tables directly and implementing the algorithm above. Quick comparison with Microsoft Office 2016 shows similar line spacing as the new line spacing here, so I guess we are improving compatibility as well. Change-Id: I4541e67e3e14508e3529e73083056a09de02e637 Reviewed-on: https://gerrit.libreoffice.org/31053 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-17Silence -Werror,-Wlogical-op-parenthesesStephan Bergmann
Change-Id: I4d592ef4bd683ffe8d9d44b3d3b188f9d4ed63ba
2016-11-17Resolves: tdf#87960 add and use a ToolFontColor for toolbar item entriesCaolán McNamara
instead of using the MenuBar text color, cause for Ambiance theme the menubar is dark and its font is light, while the toolbars can be light, so light font on light bg appears greyed out Change-Id: I0fa4ab8eabdd3cd69eb682e5ddba8314b8c9ff0f
2016-11-17tdf#43740 SimpleWinLayout::LayoutText only advance position for actual glyphs.Mark Hung
Unicode variance selectors selects glyph of previous base character and do not have character width itself. Change-Id: Id0a0d9fcd40794b6db8ff89f84ad42a842472916 Reviewed-on: https://gerrit.libreoffice.org/29618 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-11-16Exit GLyphyTor Lillqvist
Change-Id: Ib84e703d4c1528d022435c7695c97a3fc284563a
2016-11-15tdf#103725: Default to GDI even with the new layout engineKhaled Hosny
It seems that our DirectWrite integration is missing few key features, so back to GDI so at least people who need these feature can have away to make them work. So the situation is now with the new layout engine is like the old one; GDI when OpenGL is not use and DirectWrite when OpenGL is used. Fixing DirectWrite is now someone else’s problem. Should also fix tdf#100986. Change-Id: I102cac8a324f77b050d5183911b5cfda0b6b8f2b Reviewed-on: https://gerrit.libreoffice.org/30868 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>