Commit Graph

144 Commits

Author SHA1 Message Date
Noel Grandin
c70d49c7c8 use strong_int for LanguageType
Change-Id: If99a944f7032180355da291ad283b4cfcea4f448
Reviewed-on: https://gerrit.libreoffice.org/36629
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-26 08:50:54 +02:00
Andrea Gelmini
402aa305b7 Fix typos
Change-Id: Ia87318cb323d403cdff947da0b70e0d2aabaacd4
Reviewed-on: https://gerrit.libreoffice.org/35657
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 16:13:45 +00:00
Stephan Bergmann
6cb9e6dad7 Remove redundant 'inline' keyword
...from function definitions occurring within class definitions.  Done with
a rewriting Clang plugin (to be pushed later).

Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8
Reviewed-on: https://gerrit.libreoffice.org/34874
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-03 20:55:50 +00:00
Noel Grandin
64cb9fb42f Revert "convert DBConnURIType to scoped enum"
This reverts commit f0c5726670.

Missed the WIN32 only code where the JET and ACE enumerators were
being used.
2017-02-13 08:37:35 +02:00
Noel Grandin
f0c5726670 convert DBConnURIType to scoped enum
and drop unused enumerators
    DBCONN_MSJET
    DBCONN_MSACE

Change-Id: I4036b8f98488bac8e38094320281aa41f42e9787
2017-02-13 08:17:42 +02:00
Jan-Marek Glogowski
5f2e1eda45 tdf#105288 MM wait until all emails are send
Seems mail merge is now much faster then the sending of the merged
documents via email. This is why the attached workaround patch to
the tdf#103919 bug report, which simply sleeps after queuing a new
message, helped solving the problem. It slows down the mail merge
and gives time to the mail dispatcher thread.

But we actually want to wait until all mails are send, so we have
to add a listener and wait for the mail thread to become idle.

This listener also allows us to cancel further mail merge when an
SMTP error has occured.

Change-Id: I9d13bcd8f0d0ff084b20d72ab96f70afa3a764ba
Reviewed-on: https://gerrit.libreoffice.org/33989
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2017-02-10 10:44:17 +00:00
Jan-Marek Glogowski
9235c5a3c2 MM change listener from friend to a nested class
Change-Id: I245a27e02816d3c96ca7777059b99c42cb64cca5
2017-01-17 16:08:46 +01:00
Jan-Marek Glogowski
bbf246e40c tdf#102010 Never overwrite MM files via UNO
Fixes the regression introduced by
  commit e637b6743a

This commit removed the crazy bSubjectIsFilename handling,
where I didn't understood the case of bSubjectIsFilename
and a user supplied prefix.

Mail merge to files never overwrites an existing document,
but there is the special case, when a user selects a target
filename in the MM dialog for single file MM.

Should be fixed by a successive commmit, reverting this and
removing an existing file before starting the MM job.

Change-Id: Idda487023e6984de9c1e701fc088a6b7f92e9847
2016-11-25 16:27:06 +01: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
Noel Grandin
480f6916ef loplugin:countusersofdefaultparams in sw
Change-Id: I65beb17816641cff6a07379b7ba234afe26806b3
Reviewed-on: https://gerrit.libreoffice.org/29488
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-04 06:36:22 +00:00
Noel Grandin
0f8a303186 loplugin:constantparam in sw
Change-Id: Ibae4cac28e6ff52298c804519f683017729c07a5
2016-09-08 11:47:19 +02:00
Noel Grandin
228d0950f5 loplugin:countusersofdefaultparams
Change-Id: I7150494a56abc6ec9c7fba39cefe3967a475f073
2016-08-25 13:47:05 +02:00
Caolán McNamara
7b355ad06e Resolves: tdf#101382 turn SetMailMergeConfigItem into a shared_ptr
so if the SwView it nominally belongs to is deleted while a
mail merge wizard is open it still exists while the wizard
has a ref to it

Change-Id: I4f5acbcc1ea6404851cf6e0179fd3c795342f726
2016-08-09 14:37:53 +01:00
Jan-Marek Glogowski
b6a698b093 tdf#95251 MM just allow print as single document
Remove kept block from revert of
  138d29aa09

After this revert MM just supports pinting via a single merged
document. Printing as inidividual files should have still worked,
but as a workaround we remove this functionality, until the print
backend can handle multiple-file print jobs correctly.

Change-Id: I70d0852cdcc369b0fc9f344086830f15d8dea451
Reviewed-on: https://gerrit.libreoffice.org/27721
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2016-07-30 15:02:25 +00:00
Noel Grandin
508c95f1b6 improve passstuffbyref return analysis
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c
Reviewed-on: https://gerrit.libreoffice.org/27317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-27 06:48:25 +00:00
Stephan Bergmann
9f7f7d6cfa loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: I7e7cdfa5efaf18bb47d40947d4e1d91a2c9b5a57
2016-07-07 18:59:55 +02:00
Noel Grandin
82644f5952 loplugin:singlevalfields in sw(part4)
Change-Id: I73d94ae89edb2e6f37cfa087a0d85b5a90df4a8a
Reviewed-on: https://gerrit.libreoffice.org/26679
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-27 05:23:32 +00:00
Noel Grandin
84d15d6e54 loplugin:unuseddefaultparams
Change-Id: I0fe173534dc2e70c3d507eae757a91e48a26acfc
Reviewed-on: https://gerrit.libreoffice.org/25757
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-02 06:32:25 +00:00
Noel Grandin
47f62540bd loplugin:unusedmethods in sw
Change-Id: I05e224bcc7d2b08cf1349c14e3acf274d422e109
Reviewed-on: https://gerrit.libreoffice.org/25145
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-23 11:55:36 +00:00
Oliver Specht
7b24f21a46 tdf#98985 create merge results at the right time
When using mail merge toolbar the resulting documents are now created
on OK in Save/Print and Send dialogs.
Additionally the 'To' is set in the save dialog and the
MailMergeConfigItem ist not deleted twice anymore.

Change-Id: I21f1f49d8bbd40c11b6f771e15b89e0f6c4bc87a
Reviewed-on: https://gerrit.libreoffice.org/25104
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2016-05-19 07:08:33 +00:00
Noel Grandin
89fa923a28 loplugin:passstuffbyref in sw
Change-Id: I124bdd4f28c7d7508e77b902dfa23c398454bf38
2016-04-14 09:21:40 +02:00
Jan-Marek Glogowski
bc477f93a7 MM: rename MergeNew => Merge
Since all old code from the original Merge function is gone, just
do the rename.

Change-Id: I7cc1b4b58cc73bea83a723b2478a8b4bf59a382f
2016-03-24 22:40:56 +01:00
Jan-Marek Glogowski
bdb0c4e128 tdf#95292 MM: cleanup bEndOfDB handling
bEndOfDB was handled inconsistently in ToNextRecord for record
selections and normal record iteration. The new unified semantics
are defined to set bEndOfDB for the first failing record fetch.

This includes a rename of the function ExistsNextRecord, which
did never check for a next record, but just verified the current
record set to be valid.

This way we can also drop the bAfterSelection selection, which
was just needed for the inconsistent bEndOfDB handling.

Change-Id: Ibbd7ae95e5969b51e32f44b442e5dc778655e8a9
2016-03-24 22:40:48 +01:00
Jan-Marek Glogowski
435ca34e14 MM: merge cancel and error variable
An error always includes the "cancel", while a cancel doesn't have
to be an error. So merge handling by using an enum.

Change-Id: I154dccbd3063d7ce37ee3cb90b4f193cb1edd466
2016-03-24 22:40:46 +01:00
Jan-Marek Glogowski
5c1433d87c MM: cleanup of comments and asserts
Also adds a README to explain some of the code flow of MM.

Change-Id: I363fdd73824a8d41f7073b6de2e9c24184005397
2016-03-24 22:40:45 +01:00
Jan-Marek Glogowski
88761228ad MM: some assertion on MM input
Change-Id: Id29ede49acf86ad6109eab88fbae5d9bbb2d8720
2016-03-24 22:40:42 +01:00
Jan-Marek Glogowski
e637b6743a MM: move email subject and address into descriptor
Both are not related to the DBManager, but the mail merge job.

While at it, also drop the insane bSubjectIsFilename handling, add
an independent sPath, rename sAddressFromColumn to a more general
sDBcolumn, as it's also used for file name lookup in FILE mode, and
unify the DB column data handling.

Change-Id: I1b583f4a67279a229329ba7cd15fb8d2c215737c
2016-03-24 22:40:41 +01:00
Jan-Marek Glogowski
ffe0b2c3b6 MM: rename and constify variables
Instead of the huge comparisons (in terms of text space), this
deconstructs the mail merge type into smaller uppercase variables.

bCancel is renamed to m_bCancel to especially distinguish it from
the bNoError local variable, as both are supposed to be handled
together.

Otherall this should improve the readability of the code.

Change-Id: I51ab17f7cd90a9e195d09dfcf37a0d194aa9fbbd
2016-03-24 22:40:39 +01:00
Jan-Marek Glogowski
c103bdedfe MM: refactor DBManager related duplicated code
Moves the duplicated code for saving documents, configuring the
printer and DB cursor forwarding (next record) into static local
functions.

Change-Id: I75f183a2a515ecbae276461613a05ab50c56e600
2016-03-24 22:40:38 +01:00
Jan-Marek Glogowski
4ba9bf6ad0 Revert "tdf93236 N-UP printing in combination 1/4"
Whole subject was: "tdf93236 N-UP printing in with mailmerge broken
file-print 1/4"

This reverts all dbmgr.cxx changes, which were a result of this
commit. This patch merges the reverts for the following patches:

* "sw: remove include of sw/source/inc/uibase/dbui.hxx from dbmgr.hxx"
  commit 4b01af28e6
* "coverity#1346891 Unused value"
  commit 1876d9a807
* "tdf93236 N-UP printing in combination with mailmerge broken file-print 1/4"
  commit d8ff907197

Change-Id: Ic51230c484fb9ee5dba2331c51ced1d20a787afa
2016-03-24 22:40:32 +01:00
Noel Grandin
9585c8b8c8 loplugin:constantparam in sw
Change-Id: I56925a8fd776b3ee787cc26adbaa08c58dd022c0
2016-03-22 11:47:35 +02:00
Jan Holesovsky
f7a28b3b0b mailmerge: Create the target view independantly of the mailmerge execution.
Change-Id: Ib6a53b89b0fe2a30eac104afd1c8fe75d2348edd
2016-03-18 09:13:56 +01:00
Jan Holesovsky
51be0ed6da mailmerge: nStartingPageNo and sStartingPageDesc shouldn't be return values.
Change-Id: I86a049411c2ec461e66009e6dc54d8ea086e7f12
2016-03-18 09:13:56 +01:00
Jan Holesovsky
56a51fb78e mailmerge: bPageStylesWithHeaderFooter should not be a return value.
Change-Id: I8d39b6b031b543e4cc6a31cf57d207b04a19ba38
2016-03-18 09:13:56 +01:00
Markus Mohrhard
e94d5233dd work on sane lifecylce for SfxFilter
all SfxFilter instances should now be hold inside of a std::shared_ptr.

This fixes a number of huge memory leaks in the test framework and
removes one huge source of memory issue in sfx2. SfxMedium contains a
pointer to the SfxFilter but does not own. Therefore it is required that
any SfxFilter belonging to a SfxMedium lives longer. However this seems
to work mostly by hoping that all SfxFilter instances are stored in a
global array. As we have seen with the tests this is not true (there are
also some cases inside of sd that seem to not follow that pattern as
well).

Change-Id: I12fd04a504cc4efc0a94967abd91c6fe2c6a8ce8
Reviewed-on: https://gerrit.libreoffice.org/23140
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-03-11 06:38:15 +00:00
Noel Grandin
9cc8a26fcd loplugin:unuseddefaultparam in sw
Change-Id: I1a8a25c09ae0c8ba39fcedb032562df93fdd6ba4
2016-03-04 11:48:04 +02:00
Noel Grandin
ee74e401aa loplugin:unuseddefaultparam in sw (part3)
Change-Id: Ibff7ac9718929349ee7daa3febb0f8fe4a9fa4db
2016-02-29 11:11:29 +02:00
Noel Grandin
b14224fe97 loplugin:unusedmethods
using an idea from dtardon:

<dtardon> noelgrandin, hi. could you try to run the unusedmethods clang
plugin with "make build-nocheck"? that would catch functions that are
only used in tests. e.g., i just removed the whole o3tl::range class,
which has not been used in many years, but htere was a test for it...
<noelgrandin> dtardon, interesting idea! Sure, I can do that.

Change-Id: I5653953a426a2186a1e43017212d87ffce520387
Reviewed-on: https://gerrit.libreoffice.org/22041
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-08 06:08:14 +00:00
David Ostrovsky
6597550883 Fix typo
Change-Id: I6fe407bb449b0f91509bfc91f42c0b0f320ecb09
Reviewed-on: https://gerrit.libreoffice.org/21914
Reviewed-by: David Ostrovsky <david@ostrovsky.org>
Tested-by: David Ostrovsky <david@ostrovsky.org>
2016-01-30 11:44:34 +00:00
Noel Grandin
90d892664a loplugin: unused return values
Change-Id: I4eb1f0c9245c04058fd5e47046f043f8840a79c7
Reviewed-on: https://gerrit.libreoffice.org/21628
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-21 07:18:38 +00:00
Noel Grandin
5fe99ea3ee loplugin:unusedmethods in sw/
Change-Id: Id452bfac5c83f130a138e06984a0c79c37af70ac
2016-01-19 11:01:56 +02:00
Michael Stahl
4b01af28e6 sw: remove include of sw/source/inc/uibase/dbui.hxx from dbmgr.hxx
Quite unnecessary, just remove the implementation details from the
header.

Change-Id: I5712ff32756bb1d31ff7701424b85a323438cced
2016-01-06 16:51:52 +01:00
Jan-Marek Glogowski
d7e0d0135b tdf#93565 Use multiple docs for individual PDF MM
There is actually a comment in the mail merge code:

  // convert fields to text if we are exporting to PDF
  // this prevents a second merge while updating the fields
  // in SwXTextDocument::getRendererCount()

This was included to fix i#93714.

But the reference to 2005-05-23 #122919# in the actual code
doesn't help to understand, why the original code is needed.
I would like to get rid of it, but currently don't have time
for tests.

So the optimization to skip ConvertFieldsToText() and use a
single working document for individual document mail merge
breaks for PDF, as the working document won't contain any
fields after the first document is written.
This uses multiple working documents for PDF export again.

Change-Id: I0cf1c64da27863fc5fb4bb6c7812fed90b737d13
2016-01-05 22:41:43 +01:00
Juergen Funk
d8ff907197 tdf93236 N-UP printing in combination with mailmerge broken file-print 1/4
Refactory the methode "MergeMailFiles"

Change-Id: I65441ade522c06335b0da23cb2fed9afc5bcb72e
Reviewed-on: https://gerrit.libreoffice.org/20714
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
2015-12-21 10:34:59 +00:00
Noel Grandin
b5eaa0f9f0 use unique_ptr for pImpl in sw/
Change-Id: I8508894d70e1ff16cfb9d7a9d716f11a923f453d
2015-11-17 13:21:50 +02:00
Stephan Bergmann
01b49802c7 loplugin:nullptr (automatic rewrite)
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
2015-11-10 10:31:53 +01:00
Ashod Nakashian
04783fd918 Misc tweaks and cleanups.
Streamlined a couple of hotspots and some
minor cleanups.

Change-Id: I85a9423e03f7e20ce78736a44d668da859a443cd
Reviewed-on: https://gerrit.libreoffice.org/19720
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2015-11-07 21:22:01 +00:00
Noel Grandin
7a401e5e83 com::sun::star->css in sw/inc
Change-Id: I6ffdb1deaa32156c65f997a1a1056928b7cd863d
Reviewed-on: https://gerrit.libreoffice.org/19803
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-06 05:44:52 +00:00
Michael Stahl
5d3c37b99e sw: remove SwDBTreeList_Impl::m_aConnections
... which actually does nothing since commit
fca027b0bd but was dutifully converted to
a boost::ptr_vector.

Change-Id: I69186d6ba7d90fb2f94b417fede3a907811c32c0
Reviewed-on: https://gerrit.libreoffice.org/19518
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-28 06:39:11 +00:00
Michael Stahl
61b9eea781 sw: try to fix the MSVC build...
Change-Id: I1983ea770e48c67a3af054c976460dd4e13a8933
2015-10-02 23:38:25 +02:00