Commit Graph

197 Commits

Author SHA1 Message Date
Noel Grandin
c85a261695 use rtl::Reference in SwOLEObj
instead of manual ref-counting

Change-Id: I26e55ec7803e60f090f093b5584faec74ebbb8bb
Reviewed-on: https://gerrit.libreoffice.org/43419
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-17 08:58:24 +02:00
Caolán McNamara
96d90bd4df ofz: check if fallback creation fails
Change-Id: If64965f8ced5840a7687c60f20a407e53938c227
Reviewed-on: https://gerrit.libreoffice.org/42371
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-17 13:54:22 +02:00
Miklos Vajna
a3782f1152 sw: prefix members of SwOLEObj
Change-Id: I55f2b9c1c518a569dc36d968450b94efeffa4c5f
Reviewed-on: https://gerrit.libreoffice.org/41410
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-08-22 11:10:46 +02:00
Miklos Vajna
ec630a0021 sw: prefix members of SwOLENode
Change-Id: I2b79ae40afad8c392f219f1798ce44b41649e5b9
Reviewed-on: https://gerrit.libreoffice.org/41163
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-08-15 09:21:08 +02:00
Noel Grandin
c14f1abc49 loplugin:constparams in sw part4
Change-Id: Ic42b2691869b61ba906222db893e284d8b9c39c1
Reviewed-on: https://gerrit.libreoffice.org/40767
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-04 16:06:22 +02:00
Caolán McNamara
00657aef09 migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl
* all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string")
* ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching
  MODULE .mo files
* UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui
  goes from l10n target to normal one, so the res/lang.zips of UI files go away
* translation via Translation::get(hrc-define-key, imbued-std::locale)
* python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there
  to keep finding the .hrc file uniform) so magic numbers can go away there
* java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation
  mechanism
* en-US res files go away, their strings are now the .hrc keys in the source code
* remaining .res files are replaced by .mo files
* in .res/.ui-lang-zip files, the old scheme missing translations of strings
  results in inserting the english original so something can be found, now the
  standard fallback of using the english original from the source key is used, so
  partial translations shrink dramatically in size
* extract .hrc strings with hrcex which backs onto
   xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap
* extract .ui strings with uiex which backs onto
   xgettext --add-comments --no-wrap
* qtz for gettext translations is generated at runtime as ascii-ified crc32 of
   content + "|" + msgid
* [API CHANGE] remove deprecated binary .res resouce loader related uno apis
      com::sun::resource::OfficeResourceLoader
      com::sun::resource::XResourceBundleLoader
      com::sun::resource::XResourceBundle
    when translating strings via uno apis
      com.sun.star.resource.StringResourceWithLocation
    can continue to be used

Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-21 08:20:50 +01:00
Noel Grandin
e5ece06205 loplugin:oncevar in sw
Change-Id: Ia96172489eec09607113d388a5b683bb6e0d2dec
Reviewed-on: https://gerrit.libreoffice.org/39290
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-27 13:06:59 +02:00
Andrea Gelmini
dbcc169d8c Fix typos
Change-Id: I2ce725f87ee6f8ebcffbac268cc7e7f8850023e5
Reviewed-on: https://gerrit.libreoffice.org/39232
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-06-26 09:20:18 +02:00
Caolán McNamara
d0069e5189 add COVERITY_NOEXCEPT_FALSE
to markup dtors that coverity warns might throw exceptions
which won't throw in practice, or where std::terminate is
an acceptable response if they do

Change-Id: I32b94814e8245372e1d1dc36be0d81e3564042f4
Reviewed-on: https://gerrit.libreoffice.org/38318
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-06-06 14:15:43 +02:00
Caolán McNamara
2155e04d63 make string translation loading more uniform
change various ResId classes that use conversion operator to OUString to
functions that return a OUString

drop various defines

drop unnecessary toString calls

Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92
Reviewed-on: https://gerrit.libreoffice.org/37817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-19 15:40:40 +02:00
Noel Grandin
8c8f2a5285 remove unnecessary explicit linefeeds from end of SAL and OSL log calls
Change-Id: I3fa363c8e76e6cfb297f4ec346e3f031c09d6fbf
Reviewed-on: https://gerrit.libreoffice.org/36727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-21 09:15:11 +02:00
Miklos Vajna
a5a571307f tdf#82580 tools: rename Rectangle to tools::Rectangle
Mostly generated using

make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle"

Except some modules have their own foo::tools namespace, so there have
to use ::tools::Rectangle. This commit just moves the class from the
global namespace, it does not update pre/postwin.h yet.

Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2
Reviewed-on: https://gerrit.libreoffice.org/35923
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-03-31 06:27:11 +00:00
Noel Grandin
1c3e84d819 teach lolugin:stringconstant about calling constructors
so we can remove unnecessary calls to the OUString(literal) constructor
when calling constructors like this:
   Foo(OUString("xxx"), 1)

Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36
Reviewed-on: https://gerrit.libreoffice.org/33698
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-31 08:56:20 +00: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
28a42c1b72 New loplugin:externvar: sw
Change-Id: If850989ee513d29ed373df0c6dd9905ec694026c
2017-01-09 15:40:22 +01:00
Stephan Bergmann
0e513fdc44 loplugin:unnecessaryoverride (dtors) in sw
Change-Id: Ia54c3e8b8e307ddb89347e4471e2792d4097a96e
2016-12-02 11:14:23 +01:00
Noel Grandin
b8aa1def37 convert ND constants to o3tl::typed_flags
Change-Id: I5fe3df5515017ec24db1184e8aca823714fcfdb3
Reviewed-on: https://gerrit.libreoffice.org/31343
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-29 08:20:23 +00:00
Michael Meeks
17320183bd sw: avoid busy loop waiting for OLE objects to load.
Change-Id: I7f26a88d3dcdb47260eb95f7803702d55f4a9119
Reviewed-on: https://gerrit.libreoffice.org/31164
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-11-25 09:23:31 +00:00
Bartosz Kosiorek
c840c49b62 tdf#42949 Remove unused uno headers from /sw/source/core
Change-Id: I0029144d049ad1c5ee3ff4d188ff969b6881712f
Reviewed-on: https://gerrit.libreoffice.org/31095
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-23 07:29:13 +00:00
Noel Grandin
954f752cf1 convert MapUnit to scoped enum
I left a prefix on the names "Map" so that I would not have to re-arrange
each name too much, since I can't start identifiers with digits like "100thMM"

And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore.

Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224
Reviewed-on: https://gerrit.libreoffice.org/29096
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-05 06:51:20 +00:00
Stephan Bergmann
91dd2db17b loplugin:override: No more need for the "MSVC dtor override" workaround
The issue of 362d4f0cd4 "Explicitly mark
overriding destructors as 'virtual'" appears to no longer be a problem with
MSVC 2013.

(The little change in the rewriting code of compilerplugins/clang/override.cxx
was necessary to prevent an endless loop when adding "override" to

  OOO_DLLPUBLIC_CHARTTOOLS    virtual ~CloseableLifeTimeManager();

in chart2/source/inc/LifeTime.hxx, getting stuck in the leading
OOO_DLLPUBLIC_CHARTTOOLS macro.  Can't remember what that
isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.)

Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-13 13:19:22 +02:00
Caolán McNamara
93f9a32cdf cppcheck: noExplicitConstructor
Change-Id: Id0a6cd461b2ba56e3b9b944514f3b0d0eb75cc44
2016-07-27 11:02:28 +01: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
Noel Grandin
76ad32bec8 add tagging to ThreadTasks so we don't need more one pool
If more than one place in the code submits tasks to the shared
pool, then waitTillDone() becomes unreliable.
Add a tagging mechanism, so different callsites can wait
on different sets of tasks.

Also try to protect our worker threads against exceptions from
the thread tasks code.

Change-Id: Idde664ab50008d31a2dd73910bb22f50e62ae22f
Reviewed-on: https://gerrit.libreoffice.org/27042
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-18 06:49:09 +00:00
Stephan Bergmann
2744b00906 Blind fix attempt for some GCC versions
Change-Id: Id84c3e8d2306f65ce3153de54efff8c13adcaf37
2016-07-14 15:05:23 +02:00
Stephan Bergmann
7a3485a62f Disambiguate DeflateThread classes
...in package/source/zippackage/ZipPackageStream.cxx and
sw/source/core/ole/ndole.cxx.  The -fvisibility-ms-compat used under -fsanitze=*
(cf. gb__visibility_hidden in solenv/gbuild/platform/com_GCC_defs.mk) causes the
vtables of both classes to each be exported weakly from the package2 and sw
libraries, respectively, and e.g. CppunitTest_chart2_export under ASan happend
to erroneously use the vtable from sw in package2, causing a bogus error.

Change-Id: I4e3ca96f1fd9a423b8df9fb1d9682dab8cb63192
2016-07-14 13:58:23 +02:00
Armin Le Grand
be08f61d6f Disabled async/parallel chart loading for now
Need to check deeper for circumstances leading to problems

Change-Id: I58c9601008edc53c958d59d04a30d11bc0c1bba3
2016-07-08 18:14:07 +02:00
Stephan Bergmann
a9d87f33d2 loplugin:nullptr
Change-Id: Ic37247f1e4ffe5a32e2fbb73464dfdfa59a79296
2016-07-07 23:07:06 +02:00
Armin Le Grand
63ed9d7f5b Related: tdf#50613 use an own instance of ThreadPool
Using the global ThreadPool (getSharedOptimalPool()) can lead to
problems when more than one usage executes and one of them
already calls waitUntilEmpty() what of course influences the
other usage. Thus I added an own instance of ThreadPool for
async loading of chart models in writer

Change-Id: I4bea64af0d36e87081abec95c75574966d0fe5b9
2016-07-07 22:32:39 +02:00
Armin Le Grand
c1f476d918 tdf#99165 avoid passing empty control points for beziers
Some graphic sub systems have problems to create correct
geometry for fat line drawing when 'empty' control points
are handed over for bezier curves. Avoid this by offering the
mathematical correct default in that cases.

Change-Id: I20f484ef4537076889d832d83581844690514acc
2016-07-07 22:32:39 +02:00
Armin Le Grand
3dc8ee7d8e sw: tdf#50613 fix async chart load handling
Especially if synchronous loading is requested, an async worker is on the way
and we would need to 'wait' for the data.

Change-Id: I20f9938738c1b46bda6b9a7f5a761e82153aed3b
2016-07-07 22:32:39 +02:00
Armin Le Grand
68e8d075d9 sw: tdf#50613 fix waitFinished into a loop
Change-Id: Ic8a720657c326d8d51bb3a73688b8f02b7096488
2016-07-07 22:32:39 +02:00
Armin Le Grand
9f0766917a tdf#50613 add support to load charts asynchronously
Generating primitives for chart visualisation can be moved to a
paralell executed task that loads the chart, thus speeding up
initial visualization. This is not possible for e.g. PDF or print
targets, only for edit visualization. On fallback, the replacement
images of the charts are used which are metafiles and have less
quality as primitives, but load quicker.

Change-Id: I68caa9e1bec50832bce535b5f54633d53cdef037
2016-07-07 22:32:38 +02:00
Armin Le Grand
64e1113916 tdf#50613 buffer OLE primitives for charts
If OLE is a chart, buffer the primitives used for presentation as
info at the SwOLEObj, after getting them the first time using the
ChartHelper.

Change-Id: I6d7486185f6eac450de9328d37ea800f424f351b
2016-07-07 22:32:38 +02: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
b9372f0e90 loplugin:constantparam in comphelper
Change-Id: I81e6af1ee869caa3b40d2d00604e8e22517d92d7
Reviewed-on: https://gerrit.libreoffice.org/23808
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-05 06:26:22 +00:00
Noel Grandin
ee74e401aa loplugin:unuseddefaultparam in sw (part3)
Change-Id: Ibff7ac9718929349ee7daa3febb0f8fe4a9fa4db
2016-02-29 11:11:29 +02:00
Michael Stahl
f705570c81 sw,sfx2: assert that embedded object supports XEmbedPersist
Change-Id: Ibdeec746e9664f8bfe4e2af9afb8e5ec0142bd08
2016-02-12 18:54:34 +01:00
Michael Stahl
2edfb8d9b4 sw: unindent SwOLELRUCache::Load()
Change-Id: If1a83fd4716b7a8ebfb09a7118e760fcca3a61b4
2016-02-12 18:54:32 +01:00
Michael Stahl
60d4dd0a6c sw: don't crash if Office.Common/Cache/Writer/OLE_Objects set to 1
(possibly regression from b717bda1f6)

Change-Id: I9113fe2e769cd6ba56bdccc629ac63241b238553
2016-02-12 18:54:31 +01:00
Caolán McNamara
e634cd9f4f crashtesting: fix assert on re-export of ooo74510-1.odt to docx
Change-Id: Id66ab14772b002b140ba6bbfd098c19aeb1a537f
2016-01-10 16:37:13 +00:00
Andrea Gelmini
64d624b651 Fix typos
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
Reviewed-on: https://gerrit.libreoffice.org/21209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-10 14:17:20 +00:00
Caolán McNamara
7c76db3c88 crashtesting: ooo104626-3.odt assert on reexport to odt
try setting DefaultParentBaseURL based on the parent BaseURL
for objects created this way

Change-Id: I8cb1e9692cc4255c0a0b11b6df4bacee737ae184
2016-01-09 16:57:32 +00:00
Caolán McNamara
77846edf44 OSL_ENSURE on p followed by deref -> assert
Change-Id: I4021053efbdaf1c04a9eb4c8fa52ef3da7b98b67
2016-01-09 16:55:13 +00:00
Matúš Kukan
5b22663e37 Make SotFactory private to sot/ and clean a bit
Change-Id: Ia683280a3e95eee995e036db6bde5d28852f92ff
2016-01-05 20:41:11 +01:00
Caolán McNamara
0f02bc189b crashtesting: CreateShellID returns the mediums base url...
when it works the way we want it to work, so presumably we can cut out the
middle man and use getDocumentBaseURL directly which does the same thing.

This has the advantage of being in the IEmbeddedHelper api so assignFrom can be
tweaked to pull the src and dest ids arguments to CopyAndGetEmbeddedObject from
the src and dest IEmbeddedHelpers always available there. So we ensure we
have some ids to present to CopyAndGetEmbeddedObject, avoiding the assert
on converting documents such as ooo89433-1.ppt to pdf

So the explicit args can apparently be dropped, bubbling up then means we don't
need a CloneWithShellIDs (introduced with tdf#71076 and tdf#71767) as normal
Clone should now do the right thing.

And various other arguments in various callers of these, which are typically
filled in with an unhelpful empty OUString placeholder, can go

Change-Id: I9c0be0340e72f98b10ee87ada7d2a021fcc39e23
2015-12-22 20:14:40 +00:00
Michael Stahl
e4a06fc983 sw: set a BaseURL when copying embedded objects
Turns out that SfxObjectShell::CreateShellID() will produce the
SfxMedium's base URL if it exists, so
EmbeddedObjectContainer::CopyAndGetEmbeddedObject() already has
parameters, sw just needs to set them.

Change-Id: I36cedfde4e7c2e25c43c66a30d8ca572f099ad69
2015-12-15 17:44:37 +01:00
Robinson Tryon
49c2b9808d bin/rename-sw-abbreviations.sh
This commit renames the most annoying abbreviations in Writer (and
partially in the shared code too).

Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
2015-11-25 06:07:38 -05:00
Noel Grandin
8569c6d0ad use initialiser list for Sequence<OUString>
Change-Id: Ia5e47261d1fc6fac2d046656c05a1c5eedb07e02
Reviewed-on: https://gerrit.libreoffice.org/19978
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-16 08:35:42 +00:00
Stephan Bergmann
01b49802c7 loplugin:nullptr (automatic rewrite)
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
2015-11-10 10:31:53 +01:00