Commit Graph

6877 Commits

Author SHA1 Message Date
8171e713e7 fdo#71450 fdo#71698: ODF import: fix frame name corner cases
Trying to set a name that is already in use will throw an exception (and
set a different, generated name); if there is actually no name in the
file then there's no point trying to set anything.

(regression from b69d152cfa1da868ba960345d72ba78f9f8e1b35)

Change-Id: Ie54d4a830cc23e2853a6efeb81f77dcc788192ea
2013-12-02 23:37:12 +01:00
d9a5a84e6d typo: intarnal -> internal
Change-Id: Ib7803de02d41440668b1e7410dfe0fa40ca2a536
2013-12-02 19:56:46 +01:00
f74149bc21 Fix some typos for "height"
Change-Id: Ibe1fdd7a63ff09097cfe053279d779592d389539
2013-11-25 23:03:11 +01:00
2b243ba51e Support regression curve name in ODF.
Change-Id: Ic065d63eee507906febfa15eb6d5ae1e7de58280
2013-11-24 19:43:17 +01:00
fc87d57f04 replace OUString::reverseCompareTo("xxx") with operator==
operator== with OUString and literal internally does a reverse-compare
(via OUString::equalsAsciiL) anyway, so no need to keep explicit calls
to OUString::reverseCompareTo with literal argument

Change-Id: I799d9bcd0d5c308a9547ce7cacb2db6042fdb643
2013-11-22 11:23:05 +02:00
5668e73beb avmedia: Implement "block untrusted referer links" feature
See f0a9ca24fd4bf79cac908bf0d6fdb8905dc504db "rhbz#887420 Implement 'block
untrusted referer links' feature" for details.  This adds some further /*TODO?*/
comments, and one known problem (marked /*TODO!*/) is that movies/sounds are not
blocked during a slideshow presentation.

Change-Id: Ib2d0c7e4f7b02c4bdec0d8a90cee5e7e1bee8325
2013-11-20 14:44:27 +01:00
363cc39717 convert equalsAsciiL calls to startWith calls where possible
Simplify code like:
    aStr.equalsAsciiL( "%", 1 )
to
    aStr.startsWith( "%" )

Change-Id: Iee0e4e60b0ae6d567fa8f72db5d616fffbec3c00
2013-11-19 12:49:29 +02:00
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
306a39ec0d Resolves: fdo#62461 put preferred image first
with fallback after.

"Each child element of a frame is a different representation of the same
content. The order of content elements reflects the document author's
preference for rendering, with the first child element being preferred. That
means that consumers should render the first child element that they support. A
frame may contain multiple content elements, but shall contain at least one
content element."

Change-Id: If50062cad58f5b8561ad6bd8dc1a06956d2f444b
2013-11-15 16:04:34 +00:00
ab5d1fbfb4 SAL_WARN_UNUSED com::sun::uno::Any
Change-Id: I9058044d13f696e07667dce706f6c311af6dbea0
2013-11-14 21:02:40 +01:00
f0a9ca24fd rhbz#887420 Implement "block untrusted referer links" feature
For now, this checks for a trusted referer (if the BlockUntrustedRefererLinks
configuration prop is set) in utl::MediaDescriptor::impl_openStreamWithURL and
SvxBrushItem::GetGraphicObject.  Checking in additional places will probably be
necessary to block /all/ unwanted communication.  Also, some places marked
/*TODO?*/ currently pass in an empty referer (which is always considered
trusted) and will probably need to be adapted.

Ideally, Referer URIs would never be empty (and consistently use something like
<private:user> for cases where access is explicitly initiated by the user and
should never be blocked), but that's a very daunting task, so start small by
identifying the places that potentially need blocking and adding appropriate
Referer URIs there.  Also, Referer information should always be computed as
freshly as possible from the context in which an access attempt is made, but,
again, always carrying the information from the context all the way to the
relevant functions is a very daunting task, so for now store the information
upon object instantiation in some cases (SvxBrushItem, SdrGrafObj, ...).

The Referer URI (css.document.MediaDescriptor property; SID_REFERER) was already
used to track macro execution, and there is one place in
SfxApplication::OpenDocExec_Impl where opening of hyperlinks (explicitly clicked
by the user) is done that needs the current document's URI as Referer to check
execution of macro URIs but needs an empty (or <private:user>, see above)
Referer to not block non-macro URIs.  Special code has been added there to
handle that.

Change-Id: Iafbdc07a9fe925d9ee580d4f5778448f18f2ebd9
2013-11-14 11:13:25 +01:00
24cad6a649 Move MediaDescriptor from comphelper to unotools
...so it will be able to use SvtSecurityOptions internally.

Change-Id: Id7433247e8fc53651935578510bedbcca5aa2ac9
2013-11-14 11:13:24 +01:00
99bd37faa5 -Werror,-Wunused-member-function
Change-Id: Ibfc721a819c044b5e6ec06e5bbad694662fe9e3f
2013-11-14 10:15:00 +01:00
cd6c6de525 -Werror,-Wunused-member-function
Change-Id: Ied485bebaee36107178acee33eea1eecef70315e
2013-11-14 10:15:00 +01:00
39c8da8c86 remove unnecessary sal_Unicode casts in XMLOFF module
Change-Id: I836c7a28d5ec9039c0b185e8db2aa6d01ac62566
Reviewed-on: https://gerrit.libreoffice.org/6665
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2013-11-14 06:16:12 +00:00
46b934679a clear c++11ish
Change-Id: I4eea774206a5bd1de1c10a69aceb6476c5feecbf
2013-11-13 15:48:04 +00:00
5ce50b8d17 Respect svg:font-face-format element.
Call libeot to parse font if value "embedded-opentype" is found.

Change-Id: I03a072fd4db47d151a3934e959ad17c1e24fcf09
Reviewed-on: https://gerrit.libreoffice.org/6144
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-11-13 14:37:53 +00:00
21123da759 xmloff: include <> for external includes
Change-Id: Ic92d0121e928041bcff00b12706f794a4d8e25c8
2013-11-11 22:37:28 -06:00
fcd1637d51 convert OUString compareToAscii == 0 to equalsAscii
Convert code like
   aStr.compareToAscii("XXX") == 0
to
  aStr.equalsAscii("XXX")
which is both easier to read and faster.

Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
2013-11-11 12:58:13 +02:00
ef90021abe convert OUString !compareToAscii to equalsAscii
Convert code like
   if( ! aStr.compareToAscii("XXX") )
to
   if( aStr.equalsAscii("XXX") )
which is both clearer and faster.

Change-Id: I267511bccab52f5225b291acbfa4e388b5a5302b
2013-11-11 12:58:12 +02:00
0a9ef5a18e convert OUString 0==compareToAscii to equalsAscii
Convert code like:
   0 == aStr.compareToAscii("XXX")
to
   aStr.equalsAscii("XXX")
which is both clearer and faster.

Change-Id: I2e906d7d38494db38eb292702fadb781b1251e07
2013-11-11 12:58:12 +02:00
e52779d2f8 remove unnecessary use of OUString constructor
Change-Id: Ifb220af71857ddacd64e8204fb6d3e4aad8eef71
2013-11-11 11:21:26 +02:00
fd2d0bc88f cppcheck: reduce scope
Change-Id: I7a20f89e5a113c6c8760d51475d8198e28ad6aac
2013-11-10 14:32:25 +01:00
63752c9989 remove misleading comment
Change-Id: I8c4187f3f50c4675ab4fe392ef0f0736109788da
2013-11-07 20:34:22 +01:00
bcb51cff22 fdo#63020: Replace ::comphelper::stl_begin()...
And use some templates inside include/com/sun/star/uno/Sequence.hxx

Change-Id: I48875fa1517751fc4cb0cf2b6c08b88975a29b47
Reviewed-on: https://gerrit.libreoffice.org/6599
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2013-11-07 10:43:34 -06:00
c87a8fc648 remove unnecessary use of OUString constructor in XMLOFF module
Change-Id: I3bb704d2b1063cd8c2c903cbfa237a7723c321d2
2013-11-07 13:22:56 +02:00
107c2c7c7b Remove #ifdef TIMELOG'ed SAL_INFOs
...the code doesn't make much sense that way.

Change-Id: I506e37b44924701255431f6d20d4610f7f52287d
2013-11-06 20:55:58 +01:00
f8f0f18d71 check for empty string
as demonstrated by kde246118-4.odp

Change-Id: Idf1224555e0d7be9a679862da9ff256cf7a4d128
2013-11-06 15:16:38 +00:00
f689578dc4 Resolves: #i123542# corrected ODF XML export of 3D cube and sphere
(cherry picked from commit a8cc15c001ac76c0d320837cc4cdf65ecb7fc923)

Conflicts:
	xmloff/source/draw/shapeexport2.cxx
	xmloff/source/draw/shapeexport3.cxx

Change-Id: I35f7817f3ea95177dd3aa633b9cbb1b5703f08a0
2013-11-05 15:13:20 +00:00
0794e9ec93 corrected export of polygons with text
(cherry picked from commit c0f65b29f8028ab750c8caac033645c3da3cf2f5)

Conflicts:
	xmloff/source/draw/shapeexport2.cxx

Change-Id: Ic8da384d094ce735ecba51b282de7a697558e51f
2013-11-05 15:00:18 +00:00
5285beeaa4 remove redundant calls to OUString constructor in if expression
Convert code like:
  if( aStr == OUString("xxxx") )
to this:
  if( aStr == "xxxx" )

Change-Id: I8d201f048477731eff590fb988259ef0935c080c
2013-11-04 10:11:08 +02:00
aeb41c9b9b remove redundant calls to OUString constructor
Change code like this:
  aStr = OUString("xxxx");
into this:
  aStr = "xxxx";

Change-Id: I31cb92e21658d57bb9e14b65c179536eae8096f6
2013-11-04 10:11:07 +02:00
0e6a2601b3 Convert code that calls OUString::getStr()[] to use the [] operator
This also means that this code now gets bounds checked in debug builds.

Change-Id: Id777f85eaee6a737bbcb84625e6e110abe0e0f27
2013-11-04 08:06:10 +02:00
68e39b840d Revert "transpose "data in rows" ranges for internal data provider, fdo#62057"
This reverts commit 14fa5488a829936275f79a7693b13da55114220e.

Conflicts:
	xmloff/source/chart/SchXMLTableContext.cxx
2013-11-02 20:44:38 +01:00
dc704d724f Directly use OUString
Change-Id: I9029bab2b0ab98a2d78166145a35792e298c9115
2013-11-01 14:56:48 +01:00
09c5325115 I assume this is missing
...from the changes to xmloff/source/draw/shapeexport2.cxx of
f15874d8f976f3874bdbcb53429eeefa65c28841 "i123433 Detect pseudo-vertices at svg
import, unify svg:d handling, correct svg:d import for relative sub-polygons in
svg import [...]," given how other changes in that file that introduce
aPolygonString use it.  Found by -Werror,-Wunused-variable.

Change-Id: I915b53ed74e03f84f240f1fa1f17768148f030d6
2013-10-31 18:51:11 +01:00
e44335abe0 Related #i123433# PolyPolygonBezier must be drawing::PolyPolygonBezierCoords
Change-Id: Idc7e0a2651f2e0b499bbf8b8443ffb84b54a45b6
2013-10-31 15:56:14 +00:00
223f6b631c Resolves: #i123433# Detect pseudo-vertices at svg import...
unify svg:d handling, correct svg:d import for relative sub-polygons in svg
import; changed default for moveto writes for svg:d in ODF to absolute

(cherry picked from commit f15874d8f976f3874bdbcb53429eeefa65c28841)

Conflicts:
	basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
	basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
	basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx
	basegfx/source/polygon/b2dpolypolygontools.cxx
	basegfx/source/polygon/b2dsvgpolypolygon.cxx
	basegfx/source/polygon/b3dpolypolygontools.cxx
	basegfx/source/tools/makefile.mk
	basegfx/test/boxclipper.cxx
	basegfx/test/clipstate.cxx
	basegfx/test/genericclipper.cxx
	canvas/source/tools/surfaceproxy.cxx
	sdext/source/pdfimport/tree/drawtreevisiting.cxx
	sdext/source/pdfimport/tree/writertreevisiting.cxx
	xmloff/inc/xexptran.hxx
	xmloff/source/draw/XMLImageMapContext.cxx
	xmloff/source/draw/XMLImageMapExport.cxx
	xmloff/source/draw/shapeexport2.cxx
	xmloff/source/draw/shapeexport3.cxx
	xmloff/source/draw/xexptran.cxx
	xmloff/source/draw/ximp3dobject.cxx
	xmloff/source/draw/ximpshap.cxx
	xmloff/source/style/MarkerStyle.cxx
	xmloff/source/text/XMLTextFrameContext.cxx
	xmloff/source/text/txtparae.cxx

Change-Id: I5171b4a3559ea116bea45152e1f2685666463635
2013-10-31 15:56:14 +00:00
8b8ef8d633 Remove the xmloff::token::ResetTokens race condition
...where multiple parallel calls to xmloff::token::ResetTokens or
xmloff::token::GetXMLToken can see dangling pOUString pointers.  There is no
point in releasing this (bounded) amount of memory referenced from global
aTokenList, anyway.

There is still a race when parallel calls to xmloff::token::GetXMLToken write to
a pOUString pointer in parallel, but that's more harmless, and maybe calls to
GetXMLToken are synchronized by Solar Mutex?  Calls to ResetTokens (e.g., via
URP remote release request -> ~ScXMLExport -> ~SvXMLExport) were definitely
/not/ synchronized via any mutex.

The xmloff::token::Inc/DecRescheduleCount functions are now pointless and have
been removed, too.

Change-Id: I85905d4de1f042ed5c9a37589f942910d8ef80fd
2013-10-31 12:45:04 +01:00
e2451bd729 Convert indexOf->startsWith and lastIndexOf->endsWith
This is both an optimisation and a cleanup.

This converts code like
   aStr.indexOf("XX") == 0
to
  aStr.startsWith("XX")
and converts code like
  aStr.lastIndexOf("XXX") == aStr.getLength() - 3
to
  aStr.endsWith("XXX")

Note that in general
  aStr.lastIndexOf("X") == aStr.getLength() - 1
converts to
  aStr.isEmpty() || aStr.endsWith("X")
so I used the surrounding context to determine if aStr could be empty
when modifying the code.

Change-Id: I22cb8ca7c2a4d0288b001f72adb27fd63af87669
2013-10-31 08:34:21 +02:00
9239dc026a Fix for Chart Series Names
For Docx files, the chart series names (labels)
    were rendered incorrectly and hence exported incorrectly.
    In place of the correct label, the series name
    for next series was displayed.

Change-Id: I988571d76d9c706ac2f7693881198bb604ec3fa8
Change-Id: I52631bc62fce46a43298c284cb11c2e8916fabe3
Reviewed-on: https://gerrit.libreoffice.org/6350
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2013-10-30 11:21:00 +00:00
a45953ed7c fixincludeguards.sh: xmloff
Change-Id: I0e7d9daac1ad88fad8d240373e91ef323966bb47
2013-10-23 23:22:32 +02:00
8396cce9b5 clean up places accessing the NULL at the of an OUString
There were only a couple of real bugs fixed, but we're a little
bit safer now.
This also fixes the assert and the comment in OUString::operator[]
about this.

Change-Id: Ibe16b5794e0ba7ecd345fa0801586d25b015974c
2013-10-23 13:12:55 +02:00
f852bda5ec clean up some include guards
Conflicts:
	sw/source/ui/inc/content.hxx

Change-Id: I58d81881271fc6e3320bf3b5f1321594b28614a6
Reviewed-on: https://gerrit.libreoffice.org/6388
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-10-23 10:28:07 +00:00
7a06928bcf convert code to use OUString::endsWith
Convert places that call
   aStr[aStr.getLength()-1] == 'x'
to use the shorter form
   aStr.endsWith("x")

Change-Id: I1b3a19c0e89b8989cdbeed440f95fc76f9a4b6b6
2013-10-23 08:29:15 +02:00
a7724966ab Bin comments that claim to say why some header is included
They are practically always useless, often misleading or obsolete.

Change-Id: I2d32182a31349c9fb3b982498fd22d93e84c0c0c
2013-10-22 16:56:28 +03:00
67aec43915 cleanup
Change-Id: I7bfd221f89718ba8634417c93a26b3a199178694
2013-10-16 05:41:26 +02:00
94755bd8f2 Combine a pointlessly split class implementation and bin unused private field
Change-Id: I44cee32e256e0767bb3b40bdba93e15b717c9ba6
2013-10-13 14:36:21 +03:00
ce69f5d2ce Test _WIN32 instead of UNX as it's Windows that is the more specific case
Change-Id: Ifa5b522603a0ea592d873ae79b266091163e993f
2013-10-13 14:08:45 +03:00
d22ee5be41 sal_Bool to bool
Change-Id: I3db66690f9eaa809bcbf2257804d319aaec0f975
2013-10-13 02:35:48 +09:00