Commit Graph

331 Commits

Author SHA1 Message Date
Bjoern Michaelsen
fc87cdbd7b use ABC instead of Pimpl for SwXParagraphEnumeration
- abstract base class reduces boilerplate
- Pimpl is pointless here, except for SolarMutex, which is handled by
  overriding release

Change-Id: I191dc0fecd25937f41fd724355e88c04da89db61
2015-06-09 12:54:08 +02:00
Caolán McNamara
f170b307f6 fix OSL_DEBUG_LEVEL > 1 build
Change-Id: If0a98411e5cbcc3411c8b1135df2848563cf320c
2015-06-05 13:20:50 +01:00
Bjoern Michaelsen
1ef03cad1a now rename the new CreateUnoCrsr2 to CreateUnoCrsr, as the old stuff is gone
Change-Id: I82f8ed0560750d4f7bec71ea8bd3c8089b884da7
2015-05-26 00:51:13 +02:00
Bjoern Michaelsen
63536161c8 use new unocrsrs in SwXParagraphEnumeration
Change-Id: Ia57a04e617b1d7301d098524ebb55acd1d0e60b3
2015-05-26 00:51:08 +02:00
Michael Stahl
00eab70295 tdf#90946: sw: ODF import: ignore invalid gradient-name if style SOLID
The bugdoc has a fill-gradient-name that refers to a non-existent
gradient and also draw:fill="solid"; handle this combination without
exception.

Change-Id: I2c912b28a6b1550e2e4c6c71ff8889ae1779c618
2015-05-22 18:36:49 +02:00
Michael Stahl
12f907da95 tdf#91140: tweak fix a bit, turns out xmloff was also passing empty URL
Change-Id: Ia6e1fbe18e72c9c06915e1b437076a1f56a6c206
2015-05-22 18:36:49 +02:00
Christian Lohmaier
ab465b90f6 bin/rename-sw-abbreviations.sh
renames the most annoying abbreviations in Writer (and partially
in the shared code too).

Change-Id: I9a62759138126c1537cc5c985ba05cf54d6132d9
2015-05-20 13:05:49 +02:00
Michael Stahl
97887cd810 tdf#91140: ODF import: try to ignore invalid draw:fill="solid"
... which was apparently written by LO >= 4.1 on a frame with image
background, under unknown circumstances.

Change-Id: Ie86643ab67f58bfe5c19d6a1f80a7af8f793edf2
2015-05-15 20:56:37 +02:00
Stephan Bergmann
80c2dfa225 loplugin:cstylecast: nop between pointer types of exactly same spelling
Change-Id: I0e42e757a6f7b0c28758193aad8b3cb01607b8b1
2015-05-11 12:51:13 +02:00
Noel Grandin
259820af71 loplugin:staticmethods
Change-Id: I90dd921077bbfc57200e398e7959306f26c65cfe
2015-05-05 09:30:41 +02:00
Michael Stahl
3670e3c0c1 sw: ODF import: frame background: do not override gradient transparency
... with style:background-transparency

(regression from 102bb87ca1)

Change-Id: Icead7a47c145eace51249896b6e05d65dfaa2f78
2015-04-21 00:33:59 +02:00
Michael Stahl
09f0919f9a tdf#90640: sw: ODF import: ignore style:background-transparency for
... bitmap backgrounds of frames.  OOo/LO versions <= 4.3 wrongly write
fo:background-color="transparent" style:background-transparency="100%"
for bitmap backgrounds, because of a stupid API implementation with
SvxBrushItem.  They overwrite that with draw:opacity="100%" on the child
element style:background-image, which we don't read if we see draw:fill
attributes, so ignore the background-transparency in that case.

(regression from 5aa360cae0)

Change-Id: I4ca59d8932a8e5d034c35543a54528198ad7d51c
2015-04-21 00:33:59 +02:00
Michael Stahl
c3e49660e7 tdf#90640: sw: ODF export: be consistent when exporting RES_BACKGROUND
The emulation of legacy RES_BACKGROUND properties claims that (unless
fillstyle is NONE) all of them are direct values, which causes export of
legacy attributes like style:background-transparency without
corresponding non-legacy draw:opacity.

Especially problematic for style:background-transparency, which is set
to 100% if style is bitmap, which is the reasonable default for API
backward compatibility of BackColorTransparency, but wrong for ODF.

Change-Id: I1fa4fa5df45eb00cbfcd2e171b4862c4e195cc7d
2015-04-21 00:33:58 +02:00
Noel Grandin
71b809959b remove unnecessary use of void in function declarations
ie.
    void f(void);
becomes
    void f();

I used the following command to make the changes:

  git grep -lP '\(\s*void\s*\)' -- *.cxx \
    | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;'

and ran it for both .cxx and .hxx files.

Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd
2015-04-15 11:47:12 +02:00
Caolán McNamara
bc892b0414 Related: tdf#90130 gradient transparency goes missing
Change-Id: I0af8eb24dab7bb9f5831bec68f9a22ba88c2be19
2015-04-14 10:16:37 +01:00
Caolán McNamara
855b0af138 Resolves: tdf#90130 don't clobber new solid-color on seeing old transparency
Change-Id: I1ea86dca37cbce416564c5e198779dd132125b02
2015-04-13 21:26:49 +01:00
Stephan Bergmann
2fc4a8c811 Add support for cppu::UnoType<void>
Change-Id: I88259ffaffc73979c240721d2db166c79d3085f1
2015-04-01 12:48:44 +02:00
Stephan Bergmann
574bc065a7 Replace remaining getCppuType et al with cppu::UnoType
Change-Id: I091e11ab1e7fbacf04a0eac51262d22d3835ab17
2015-04-01 08:41:44 +02:00
Bjoern Michaelsen
e139d3f951 have a Reference instead of SwClient meddling
Change-Id: I484061f124e5eaadd6e08a17f91dd18faf30b871
2015-03-28 22:14:18 +01:00
Stephan Bergmann
2828d92eee Clean up C-style casts from pointers to void
Change-Id: I2ec58d0bfe13fae4fc2141f9b017b5a72e0ba2c2
2015-03-28 19:09:27 +01:00
Bjoern Michaelsen
63fccb1101 remove copypasta
Change-Id: Ieed83781b89ff18f870ad8c64ca00d306b097aea
2015-03-26 16:07:01 +01:00
Bjoern Michaelsen
d26725ad0f move SwIterator into calbck.hxx
Change-Id: Icdcd46d392bbf1dbe45448328c310d9a327ba60d
2015-03-19 23:41:06 +01:00
Bjoern Michaelsen
bc2740dd91 unocore: dont use 'shortcut' that is longer than the original
Change-Id: I0bc66003528b6603ce46325176973d72dcbac2ac
2015-03-16 15:17:59 +01:00
Juan Picca
90613f4e47 fdo#39440: remove redundant checks and breaks
Change-Id: I7706aca6b3850b9d9c8d6d9a78e0034889c6f89c
2015-02-06 23:10:42 +01:00
Noel Grandin
278b400511 fdo#84938: convert POLY_OPTIMIZE_ #defines to 'enum class'
Change-Id: I163bd3f521473c5357c23c3ce4978f984be7b6fe
2015-01-09 09:08:35 +02:00
Matteo Casalin
257ff5bea3 sal_uInt16 to size_t
Change-Id: I66239d89049f1386e5725e540c4dcc2b09c3ebf0
2014-12-25 18:21:11 +01:00
Stephan Bergmann
b1fab4ab32 sw: Use appropriate OUString functions on string constants
Change-Id: I9c3e03324c69beb5af4c43da208086600876f875
2014-12-18 14:12:34 +01:00
Matteo Casalin
8aac6ecc58 Use Any specializations for bool, instead of SetValue
Change-Id: I7a5babe494bdb09a71164ea74d7be3f6bf985ff6
Reviewed-on: https://gerrit.libreoffice.org/13215
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-12-10 21:12:20 +00:00
Noel Grandin
b61ca31e53 loplugin: cstylecast
Change-Id: I19be8b6df10515e195a4d3ecb8f003c85d2349c2
2014-11-26 11:46:38 +02:00
Zolnai Tamás
5e52aa124b Make GetTwipSize() call SwapIn() by itself in case of invalid size
Change-Id: I5bc6cf097e61d65007dde531af4a213b19e8ca5b
2014-11-07 10:45:14 +01:00
Zolnai Tamás
1747563813 Make SetSwapState() an internal method
So we can be sure it is always called when user data changed.

Change-Id: If107907afffb85a7a57817f5807847a5c028416c
2014-11-07 10:45:08 +01:00
Andrea Gelmini
c70f1545e2 Removed duplicated includes
Change-Id: I5362d997bfa086c9fb1726efcb15132a966684f6
Reviewed-on: https://gerrit.libreoffice.org/12160
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-10-31 16:18:30 +00:00
Caolán McNamara
14efdae8ca coverity#1249466 Uncaught exception
Change-Id: I58f646ed921d26c5a7d512279723e9d141886218
2014-10-25 16:56:09 +01:00
Caolán McNamara
331f4663e4 coverity#1247631 Uncaught exception
Change-Id: I92e59b18cef0828040c88ffbde150de6bb0d16a5
2014-10-17 15:19:44 +01:00
Stephan Bergmann
25a76ef791 sw: std::auto_ptr -> std::unique_ptr
Change-Id: I60ac3706b9be335c31039ed0997cb8215808ddaa
2014-10-01 17:35:11 +02:00
Noel Grandin
c9d4a2887c fdo#82577: Handle PolyPolygon
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows
PolyPolygon typedef.

Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-30 11:47:41 +02:00
Caolán McNamara
5aa360cae0 Resolves: fdo#80468 and fdo#81223 image/frame backgrounds wrong
writer has code to fill in missing new properties from the old properties
if they exist. But xmloff is stripping them out before they get there.

Don't strip them out, and add in a missing check for one of the
archaic bg colors and add a regression test for fdo#81223

Change-Id: I9a541a9bee0a01c90f2c33383f1144ecd8b0bfff
2014-09-29 16:31:32 +01:00
Noel Grandin
23e1fc277d loplugin: cstylecast, update PTR_CAST macro to use static_cast
I introduce a template method into the PTR_CAST machinery
to maintain constness.
There is now a FIXME in sd/../docshell.cxx because I needed
to use a dynamic_cast there to work around the games it appears
to be playing with OLE in-place activation.

Signed-off-by: Stephan Bergmann <sbergman@redhat.com>,
dropping the GCC-extension, unnecessary use of typeof from tools/rtti.hxx

Change-Id: Iba5ace1aa27e02b34fcc91af1e658c43371afd03
2014-09-23 17:27:47 +02:00
Stephan Bergmann
ea733ab5b6 Turn SfxItemState into a C++11 scoped enumeration
...to gain further confidence in the claim "that none of the existing
code tries to uses combinations of these enum values"
(d92602c5b1 "more fixes for SfxItemState")

Change-Id: I987922d945e8738e38adfde83b869adf3ff35b13
Reviewed-on: https://gerrit.libreoffice.org/11384
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-12 06:08:32 +00:00
Miklos Vajna
2248aaf58a std::set::find() is faster than plain std::find()
Change-Id: I11ca9474e4b6b751f0348b78b53abaa81682eaa6
2014-09-05 15:26:18 +02:00
Michael Stahl
c310523a5f C++ name lookup is hard, especially for clang tinderbox
Change-Id: I50a25e5cfa219bbdcf0a23c03b8e6a2cff72c3d6
2014-08-20 17:12:13 +02:00
Michael Stahl
37ea2c99b9 fdo#72695: avoid double-free race condition for SwXFrame
The problem is that Modify() may be called from ~SwFmt while another
thread is waiting on SolarMutex in the ~SwXFrame or derived class
destructor, so the ref-count is 0 and the uno::Reference in Modify()
will cause a double-free.

Since ClientModify() does some re-parenting of listeners, it is at first
glance better to call Modify() in this situation (although it is quite
possible that it actually doesn't matter), so don't avoid the call in
~SwFrmFmt by adding a SwClient* member there, but put a weak reference
to itself into SwXFrame so it can check if it's still alive...

Change-Id: I492bb8a8557af5fc725fdb7f8b21013e0886f63b
2014-08-20 16:40:09 +02:00
Michael Stahl
102348fcd1 make SwXFrame derived constructors private
... so that new instances have to be created by the factory functions.

Change-Id: I643a154609b1a277d5cbc22d739ef8e357028f56
2014-08-20 16:40:09 +02:00
Michael Stahl
00b5f1ef2e i#105557: thread-safe caching of SwXFrame instances
Replace SwXFrames::GetObject() with factory functions that use the
WeakReference SwFrmFmt::m_wXObject to cache the instance in a thread-safe
way.

Change-Id: If56e4d7f95cb4f2e112139f228fb832ae9bf7d76
2014-08-20 16:40:08 +02:00
Miklos Vajna
0606ab6a73 SwTextBoxHelper::findTextBoxes: return a set of const pointers
Change-Id: I8e3ea996959bad72e6d15dc9c980ea9d18d31fb3
2014-08-15 16:48:57 +02:00
Valentin Kettner
535971f3a1 Refactored IDocumentStylePoolAccess out of SwDoc.
Added non const SwDoc::GetDfltTxtFmtColl and SwDoc::GetTxtFmtColls
and SwDoc::GetCharFmts.
Had to make the manager friend of SwTxtFmtColl and SwConditionTxtFmtColl
Had to make SwDoc::_MakeCharFmt and SwDoc::_MakeFrmFmt public.

Change-Id: I19a36d91f92b3781a6c4313ec12eb8f7d4dfacc3
2014-08-12 23:26:38 +02:00
Valentin Kettner
5494954b26 Refactored IDocumentLayoutAccess out of SwDoc.
Into the new class DocumentLayoutManager.

Change-Id: I02d0cfcc63633d0bdab380508b2ef563187fd269
2014-08-12 23:26:38 +02:00
Miklos Vajna
1e6ff8f7f8 XFillStyle -> css::drawing::FillStyle
Change-Id: I6b2fabd72fd34f4ac1b3a18f386c90794bc39ce4
2014-07-19 00:30:37 +02:00
Valentin Kettner
f634ec520f Refactored IDocumentContentOperations out of SwDoc.
Into the new class DocumentContentOperationsManager.

Made SwNodes in sw/inc/ndarr.hxx friend class to
DocumentContentOperationsManager so it can call DelNodes at end of
DocumentContentOperationsManager::DeleteSection .

Added DeleteAutoCorrExceptWord to SwDoc, its needed in the Manager.

Added a non const version of SwDoc::GetDfltGrfFmtColl() to SwDoc
because its needed in the Manager.

Made SwDoc a friend class to DocumentContentOperationsManager so it
can call SwDoc::checkRedlining and SwDocL::_MakeFlySection.

Moved SwDoc::CopyImpl_ , SwDoc::CopyWithFlyInFly and
SwDoc::CopyFlyInFlyImpl into the Manager.

Moved "struct ParaRstFmt" and "lcl_RstTxtAttr" from docfmt.cxx
in DocumentContentOperationsManager.hxx .

Change-Id: Icaab57f4a8c158a85e549ecb4aacc752bc95bbc9
2014-07-15 15:44:04 +02:00
Philipp Riemer
303df30fe9 fix merge peculiarities
Change-Id: I8f01f16c52624611ac19dbd040ba0389ceccece2
2014-07-13 18:04:48 +02:00