Commit Graph

87 Commits

Author SHA1 Message Date
Mike Kaganski
3f1b8f02ca Use default initialization instead of memset here
Change-Id: I6f4164e9c7a28e1f9d18fd6fc69dad8c48b53d9a
Reviewed-on: https://gerrit.libreoffice.org/80754
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-10-14 14:42:18 +02:00
Stephan Bergmann
d010358198 Silence -Werror,-Wmissing-field-initializers (clang-cl)
Change-Id: I4c6a820a91f620e9677f6a946265c38e9ca6ef73
Reviewed-on: https://gerrit.libreoffice.org/79933
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01 19:29:54 +02:00
Stephan Bergmann
6d341ad7f0 -Werror,-Wenum-compare (clang-cl)
Change-Id: I1d15098564779ad0ef137b47f36d6a1b23beeb29
Reviewed-on: https://gerrit.libreoffice.org/67147
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-30 22:00:26 +01:00
Stephan Bergmann
2035b3ea53 loplugin:nullptr (clang-cl)
Change-Id: Ief2ac9e55c042252e9e9b0f2334057af8602e087
Reviewed-on: https://gerrit.libreoffice.org/67140
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-30 21:59:43 +01:00
Stephan Bergmann
31d07df57f loplugin:redundantcast (clang-cl)
Change-Id: Id86b69f1bceb228d6bc5e383e7d98f177780d402
Reviewed-on: https://gerrit.libreoffice.org/67148
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-30 19:03:25 +01:00
Mike Kaganski
485d2df7d5 tdf#42075: Perform scan after selecting a scanner on Windows
On Windows, we use dialogs provided by system TWAIN DSM. We can't add
a "Scan" button to the "Select source" dialog; but it's reasonable to
assume that user would select a scanner to scan, so let's proceed to
scan when user confirms selection in the dialog.

Change-Id: Ic49b1ce914db65221d52d9378369afa5278d95d1
Reviewed-on: https://gerrit.libreoffice.org/65736
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-30 12:33:33 +01:00
Mike Kaganski
70e1be1b2f tdf#114635: Scan operations are modal
To ensure that a document frame isn't modified/closed while an
asynchronous scan operation is performed, the frame is blocked
for the lifetime of the shim process.

Change-Id: I7e21c816ca6de8eb0a53498e77eae359985dbf71
Reviewed-on: https://gerrit.libreoffice.org/65727
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-30 01:43:26 +01:00
Mike Kaganski
aeb54120a4 Use correct message filters in MsgWaitForMultipleObjects
Omission from commit 648f24f5d1, that
made TWAIN GUI to lag.

Change-Id: If2bbc53c2abf11e724f0cd6ad470a0263cd8457d
Reviewed-on: https://gerrit.libreoffice.org/65713
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-29 15:40:32 +01:00
Mike Kaganski
648f24f5d1 tdf#114635: reimplement TWAIN-based scan using 32-bit shim on Windows
Since TWAIN is only actually available as 32-bit component on Windows,
to use it in a 64-bit program, we need a 32-bit shim program that does
all actual communication with TWAIN subsystem.

This change reimplements TWAIN implementation to be a separate 32-bit
process. Image is transfered from the shim to main program using file
mapping API.

This reverts most of commit 585d980696.
64-bit LibreOffice doesn't bundle TWAIN DSM library now. TWAIN DSM
source code is still used for TWAIN headers.

Change-Id: I46f178ad36acd97a9eff156624b99036fcbb83f8
Reviewed-on: https://gerrit.libreoffice.org/65688
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-29 09:58:09 +01:00
Gabor Kelemen
492ea7e085 tdf#42949 Fix IWYU warnings in include/vcl/[ab]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: If18c80fc64e55d797953e24e40e5d5e62bd9c625
Reviewed-on: https://gerrit.libreoffice.org/63453
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-19 09:38:53 +01:00
Stephan Bergmann
928b1b04ad loplugin:external (clang-cl)
Including:

* expanding STDAPI to its definition (as per
  <https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add
  __declspec(dllexport) into its middle, in
  extensions/source/activex/so_activex.cxx; as discussed in the comments at
  <https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in
  setup_native, use __declspec(dllexport)", having a function both listed in a
  .def file EXPORTS and marking it dllexport is OK, and the latter helps the
  heuristics of loplugin:external; however, the relevant functions in
  extensions/source/activex/so_activex.cxx probably don't even need to be
  exported in the first place?

* follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx

Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191
Reviewed-on: https://gerrit.libreoffice.org/60938
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-24 17:22:05 +02:00
Mike Kaganski
dc4dae1263 extensions: MSVC: pragma warning: make more specific, remove obsolete
Change-Id: I7bbb280810af51adc25595667f1c40aca0a8ae26
Reviewed-on: https://gerrit.libreoffice.org/48977
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-01 10:42:07 +01:00
Stephan Bergmann
9af8f190ed More loplugin:cstylecast on Windows
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after
cab0427cad "Enable loplugin:cstylecast for some
more cases" and a409d32e7f "More
loplugin:cstylecast"

Change-Id: Ib3355159dd08333e1b7a8d091caf2069cdcc7862
Reviewed-on: https://gerrit.libreoffice.org/48317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-23 07:54:51 +01:00
Stephan Bergmann
b3ef638cb2 Various loplugin (clang-cl)
Change-Id: Ib91d9f82b99989a37e5e03ecb9138a59436ce2c8
Reviewed-on: https://gerrit.libreoffice.org/47674
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-09 23:21:08 +01:00
Mike Kaganski
7ea805eb81 tdf#114635: fix TWAIN on Windows 64 bit
DG_IMAGE / DAT_IMAGENATIVEXFER / MSG_GET is documented [1] to take
a handle as its pData parameter, but said to be TW_UINT32. The latter
is false, because it returns a Windows handle to DIB to that parameter,
and it has 64 bits on 64-bit Windows systems. A crash resulted when
wrong value attempted to be GlobalLock'd, pBIH was nullptr, and was
dereferenced.

Also, in some circumstances, duplicate MSG_XFERREADY might arrive
sequentially; the second one arrives when current state has already
changed value, and thus TWAIN_EVENT_QUIT used to be sent, resulting
in mpImpTwain destroyed before TWAIN_EVENT_XFER processed. This had
lead to absent result of scan.

[1] http://www.twain.org/wp-content/uploads/2016/03/TWAIN-2-Spec.pdf

Change-Id: Ic03fe7681f6003e5fda0c071be181696f9bc866a
Reviewed-on: https://gerrit.libreoffice.org/46944
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-12-22 10:43:50 +01:00
Stephan Bergmann
ffa11622ea loplugin:includeform: extensions (Windows)
Change-Id: I6619004353fb7e94506e2a75c77b42156f0b6c6d
2017-10-27 19:28:51 +02:00
Mike Kaganski
362a21d3a1 Use explicit function names for fooA/fooW WinAPI; prefer fooW
We should only use generic foo function name when it takes params
that are also dependent on UNICODE define, like
LoadCursor( nullptr, IDC_ARROW )
where IDC_ARROW is defined in MSVC headers synchronised with
LoadCursor definition.

We should always use Unicode API for any file paths operations,
because otherwise we will get "?" for any character in path that
is not in current non-unicode codepage, which will result in failed
file operations.

Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633
Reviewed-on: https://gerrit.libreoffice.org/42935
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-30 11:23:41 +02:00
Jens Carl
998532d854 tdf#96505 Get rid of cargo cult "long" integer literals
Remove "long" integer literals in extensions/

Change-Id: I2eb5daa178ec9adcaddb999bad410aff0e94220c
Reviewed-on: https://gerrit.libreoffice.org/39149
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-07-04 12:25:23 +02:00
Stephan Bergmann
fed3783e77 Add missing #includes
...like 6dce9c6757, for Windows-only code

Change-Id: I35f37aae2e6f55ff8ed82afc710a9b59a43b028c
2017-02-08 08:40:06 +01:00
Stephan Bergmann
e57ca02849 Remove dynamic exception specifications
...(for now, from LIBO_INTERNAL_CODE only).  See the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html>
"Dynamic Exception Specifications" for details.

Most changes have been done automatically by the rewriting loplugin:dynexcspec
(after enabling the rewriting mode, to be committed shortly).  The way it only
removes exception specs from declarations if it also sees a definition, it
identified some dead declarations-w/o-definitions (that have been removed
manually) and some cases where a definition appeared in multiple include files
(which have also been cleaned up manually).  There's also been cases of macro
paramters (that were used to abstract over exception specs) that have become
unused now (and been removed).

Furthermore, some code needed to be cleaned up manually
(avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no
configurations available that would actually build that code.  Missing @throws
documentation has not been applied in such manual clean-up.

Change-Id: I3408691256c9b0c12bc5332de976743626e13960
Reviewed-on: https://gerrit.libreoffice.org/33574
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-26 12:54:43 +00:00
Stephan Bergmann
d11ac60459 clang-cl loplugin: extensions
Change-Id: I659d8a3b098c7417235006c86ea60e7fe1e56a44
Reviewed-on: https://gerrit.libreoffice.org/29867
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-16 14:19:16 +00:00
Stephan Bergmann
106ea87205 Remove _TYPED suffix from tools/link.hxx macros
...which was introduced with 3ead3ad52f "Gradually
typed Link" to distinguish the new, typed versions from the old, untyped ones,
but is no longer necessary since 382eb1a23c
"remove untyped Link<>" removed the old versions.

Change-Id: I494025df486a16a45861fcd8192dfe0275b1103c
2016-10-05 07:56:12 +02:00
Caolán McNamara
3cecadbddd Related: tdf#92478 speculative win64 scanning fix
TWAIN-2.3-Spec.pdf says...

All TWAIN 2.x Sources must be prepared to work with either TWAINDSM.DLL or
TWAIN_32.DLL, which may still be used by older Applications.

The TWAIN DSM is a shared library named TWAINDSM.DLL.  There is a 32-bit and a
64-bit version of this file.

Change-Id: I047d872271573a5b2efc3ee2af4ecfc4e142a2b2
Reviewed-on: https://gerrit.libreoffice.org/26541
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-07-07 11:55:20 +00:00
Caolán McNamara
7c98344565 Resolves: tdf#92478 avoid crash on using scanner on windows x64
which appears to correspond to backtrace
http://crashreport.libreoffice.org/stats/crash_details/ad46ef89-6b98-44f9-b060-ccb25015269d

Change-Id: Ic5a4b66028db6ba4aea08baf5bf4a672f71745a0
Reviewed-on: https://gerrit.libreoffice.org/26197
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2016-06-12 13:48:56 +00:00
Jochen Nitschke
4c7ec9f112 cleanup: remove unused com/sun/star/uno includes
Sequence.h(xx), Any.h(xx) and Type.h(xx)
and remove unused using-declarations from these files.

Add a few missing includes provided by them.

Change-Id: I6b91b6d1fdf9d0496dd546c0aab9bdcc6831a5d4
Reviewed-on: https://gerrit.libreoffice.org/23805
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-12 06:38:26 +00:00
Noel Grandin
52e438caaf remove unnecessary parentheses in case labels
Change-Id: I987bf68c767709080c67c8b183c036a4109c6caa
2016-03-15 08:52:23 +02:00
Noel Grandin
2087484c65 use consistent #define checks for the Windows platform
stage 2 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

In this stage we focus on replacing usage of the WIN macro

Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84
Reviewed-on: https://gerrit.libreoffice.org/22393
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-17 11:33:57 +00:00
Stephan Bergmann
61057a61ab -Werror,-Wmicrosoft-exception-spec
Change-Id: I0a4256047ae0142a03903101036d2a3c8d17429b
2015-11-28 08:44:46 +01:00
Noel Grandin
dd1729f854 use uno::Reference::set method instead of assignment
Change-Id: Ib297f2ab1c0c82703030f28d034d24f8a84a85ea
Reviewed-on: https://gerrit.libreoffice.org/19732
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-02 06:46:53 +00:00
Noel Grandin
8460a4dcac convert Link<> to typed
Change-Id: I760bd9ad3d0da20c0ad38aace765a42983e28531
2015-10-19 16:53:25 +03:00
Noel Grandin
bd8b93fdff make PostUserEvent Link<> typed
Change-Id: I13f10bda985d55d419a5bff481130a456ae2db8a
2015-08-28 09:49:56 +02:00
Takeshi Abe
975875d53a tdf#88206 replace cppu::WeakImplHelper* etc.
with the variadic variants in extensions.

Change-Id: I45e9dc5769150181df88791b3f748002ca713c02
Reviewed-on: https://gerrit.libreoffice.org/17517
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-08-06 08:14:23 +00:00
Stephan Bergmann
6dc42c82ba Use IMPL_LINK_NOARG[_TYPED] where applicable
Change-Id: I70598072c1d492e360ef46dd7b5ef5a2fa4be495
2015-05-10 12:06:16 +02:00
Stephan Bergmann
3ead3ad52f Gradually typed Link
Turn the Link class into a template abstracting over the link's argument and
return types, but provide default template arguments that keep the generic,
unsafe "void* in, sal_IntPtr out" behvior.  That way, individual uses of the
Link class can be updated over time.

All the related macros are duplicated with ..._TYPED counterparts, that
additionally take the RetType (except for LINK_TYPED, which manages to infer the
relevant types from the supplied Member).

(It would have been attractive to change the "untyped" LinkStubs from taking a
void* to a properly typed ArgType parameter, too, but that would cause
-fsanitize=function to flag uses of "untyped" Link::Call.)

Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
2015-04-30 10:20:00 +02:00
Noel Grandin
7f8f277b94 fdo#84938: convert STREAM_ #defines to 'enum class'
Change-Id: Ibbf14c7e9a5c1883c1311d4c86f948f74f8e473e
2015-01-07 11:20:44 +02:00
Caolán McNamara
025387b6e7 coverity#983672 Uncaught exception
Change-Id: I1b2ff484906ba3dc85fa4926dbbf45c91a57c6be
2014-05-24 16:11:00 +01:00
Thomas Arnhold
aa3548fba6 prewin.h includes windows.h
Change-Id: I221e9f704f75472234a6ce2b09930aeff6279c7a
2014-05-09 22:32:54 +02:00
Noel Grandin
16a2e90335 remove SvStream::operator<< methods
.. and convert the last few places still using those methods.

Change-Id: Id2cd8f9c0dd281df43af439d4fef65881f34a6fd
Reviewed-on: https://gerrit.libreoffice.org/7495
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-01-22 22:00:47 +00:00
Noel Grandin
610b2b94b3 remove unnecessary use of OUString constructor when assigning
change code like
   aStr = OUString("xxxx");
to
   aStr = "xxxx";

Change-Id: Ib981a5cc735677ec5dba76ef9279a107d22e99d4
2013-11-19 10:29:31 +02:00
Michael Stahl
e0280873b8 extensions: try to fix WNT String
Change-Id: I17ec25a836eda7bb023c440db1f40186b6156067
2013-10-22 14:55:17 +02:00
Caolán McNamara
c0e827297b stray String in extensions
Change-Id: Iea98e52fd026d93f68ab9916ccb583b156d5c9a7
2013-10-22 13:55:46 +01:00
Thomas Arnhold
ba0a57702c remove OUString wrap for string literals
For some functions and all kinds of Exceptions.

CannotConvertException
CloseVetoException
DisposedException
EmptyUndoStackException
ErrorCodeIOException
Exception
GridInvalidDataException
GridInvalidModelException
IOException
IllegalAccessException
IllegalArgumentException
IllegalTypeException
IndexOutOfBoundsException
NoMasterException
NoSuchElementException
NoSupportException
PropertyVetoException
RuntimeException
SAXException
ScannerException
StorageWrappedTargetException
UnsupportedFlavorException
VetoException
WrappedTargetException
ZipIOException
throwGenericSQLException
throwIllegallArgumentException

createInstance
createInstanceWithContext
forName
getByName
getPackageManager
getPropertyValue
getUnpackedValueOrDefault
getValueByName
hasPropertyByName
openKey
setName
setPropertyValue
supportsService

bash command:

for i in `cat list`; do git grep "$i\s*(\s*OUString(\s*\"" -- '*.[hc]xx'
	| cut -d ':' -f1 | sort -u
	| xargs sed -i
		-e "s/\(\<$i\s*(\)\s*OUString(\s*\(\"[^\")\\]*\"\)\s*)\s*/\1\2/g"
		-e "s/\($i.*\)\"+ /\1\" + /g";
done

Change-Id: Iaf8e641b0abf28c082906014f87a183517630535
Reviewed-on: https://gerrit.libreoffice.org/4624
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2013-06-29 21:52:54 +00:00
Fridrich Štrba
0986d0d558 mingw64: cast to pointer from integer of different size in extensions
Change-Id: Ie2162b71e4e9de9fe24ce54815e5139774bb2ec0
2013-06-10 14:03:38 +02:00
Fridrich Štrba
35a65baefe Slowly, but surely going on compiling for mingw64
Change-Id: I590aa6a854a040281bf73d5be768c05d4906a984
2013-06-06 15:52:05 +02:00
Stephan Bergmann
1eda84de6a -Werror=unused-macros (MinGW, extensions)
Change-Id: I208b5f1a8f3faabd03961bd58e2f09bb8338c790
2013-04-17 11:51:14 +02:00
Luboš Luňák
1946794ae0 mass removal of rtl:: prefixes for O(U)String*
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk
have kept them, in order not to break external API (the automatic using declaration
is LO-internal).

Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2013-04-07 14:23:11 +02:00
Thomas Arnhold
909fd7e71d remove some more macros
Change-Id: Ia93a938309d25fb9932ed92ca2b2f93bf7991927
2013-04-01 22:45:37 +02:00
Tor Lillqvist
2976b53ff8 Bin more pointless comments and ASCII graphics
Suggested Easy Hack: Replace all instances of // -------- comments
including surrounding newlines with a single newline.

Another Easy Hack, slightly harder to automate: Remove all the
pointless comments that just tell the class name right before the
declaration of that class.

Change-Id: Ia890ed613b53c5d719988697e20a983d62334123
2013-03-16 22:40:42 +02:00
Tor Lillqvist
09b08d4adb More MSC -> _MSC_VER, sorry
Change-Id: Ie5070d514c1f4dd9f9708253eb44134baec6524a
2012-12-27 14:09:50 +02:00
Noel Grandin
bb121c864c fdo#46808, Convert frame::Desktop to new style service.
I had to drop XEventBroadcaster from the merged interface
because it introduced method name conflicts (addEventListener).

Shouldn't be an issue since it was scheduled to be dropped anyhow,
and the service implementation still implements it, so existing clients
will be fine.

I dropped the interface XPropertySet from the combined IDL because nobody
seems to be using it, and it's primary purpose appears to be to set weird
flags.

I dropped the optional interfaces
   XStatusIndicatorFactory
   XDispatchInformationProvider
from the combined IDL because the service does not implement them, and
nobody seems to be using them. I suspect they were mistakenly copied
from XFrame.

I also did not convert the Title, UserDefinedAttributes and LayoutManager
properties to attributes, again because no-one is using them.

Change-Id: I678a00006ed2cca2d6c37c4e39465811442c33af
2012-12-21 10:57:09 +02:00