Commit graph

477238 commits

Author SHA1 Message Date
Andrea Gelmini
df31e72e58 Fix typos
Change-Id: I62b11b80e4d3d2a8bd4c461804f39d8da6a58066
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137298
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-21 16:16:44 +02:00
Stephan Bergmann
d022e237f1 More RTTI needed by UBSan now
Presumably after 7a076dd9a6 "use more concrete UNO
classes in writer", CppunitTest_chart2_export started to fail with

> [_RUN_____] Chart2ExportTest::testStockChart
[...]
> warn:sal.osl:3513253:3513253:sal/osl/unx/module.cxx:152: dlopen(instdir/program/libmswordlo.so, 257): instdir/program/libmswordlo.so: undefined symbol: _ZTI12SwXTextFrame
[...]
> unknown:0:Chart2ExportTest::testStockChart
An uncaught exception of type com.sun.star.io.IOException
- SfxBaseModel::impl_store <file:///tmp/Chart2ExportTest__testStockChart_4uwve4.tmp> failed: 0xc10(Error Area:Io Class:Write Code:16) at sfx2/source/doc/sfxbasemodel.cxx:3205 at sfx2/source/doc/sfxbasemodel.cxx:1783

etc.  (And marking only SwXTextFrame as SAL_DLLPUBLIC_RTTI would then cause

> sw/source/core/unocore/unoframe.cxx:1271:18: error: dynamic_cast from 'com::sun::uno::XInterface' with default type visibility to 'SwXTextFrame' with default type visibility [loplugin:dyncastvisibility]
>         xFrame = dynamic_cast<NameLookupIsHard*>(pFrameFormat->GetXObject().get().get()); // cached?
>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/XInterface.hdl:15:40: note: base class 'com::sun::uno::XInterface' with default type visibility defined here [loplugin:dyncastvisibility]
> class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI XInterface
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
> sw/inc/unotext.hxx:44:7: note: intermediary class 'SwXText' with hidden type visibility defined here [loplugin:dyncastvisibility]
> class SwXText
> ~~~~~~^~~~~~~
> sw/inc/unoframe.hxx:47:7: note: intermediary class 'SwXFrame' with hidden type visibility defined here [loplugin:dyncastvisibility]
> class SwXFrame : public cppu::WeakImplHelper
> ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> sw/inc/unoframe.hxx:174:26: note: derived class 'SwXTextFrame' with default type visibility defined here [loplugin:dyncastvisibility]
> class SAL_DLLPUBLIC_RTTI SwXTextFrame final : public SwXTextFrameBaseClass,
> ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

in turn.)

Change-Id: I5535853885a471d846458d3c6baf538ef047546b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137300
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-21 16:16:04 +02:00
Andrea Gelmini
91809c9050 Removed executable bits on doc files
Change-Id: I20142959913d80e9fb683de8285e6ffde69741f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137265
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-21 16:15:05 +02:00
Andrea Gelmini
1c50d7e229 Removed duplicated include
Change-Id: I0ebf29930fd6162c34f3d03ad74aa188839c7e31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137023
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-21 16:14:19 +02:00
Andrea Gelmini
6d5399965a Removed duplicated include and typo
Change-Id: Idd50b3533e8b32e66cb4975e1257048f9233089b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137078
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-21 16:12:53 +02:00
Andrea Gelmini
84b096680f Removed duplicated include
Change-Id: I4c12d6f27957b344b2f04215ef4e76595bd5c21f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137020
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-21 16:11:00 +02:00
Andrea Gelmini
5bca4d8a76 Remove duplicated include
Change-Id: I78af6fe3599bfcd7ce2c167936589e48f68608c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137297
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-21 16:07:42 +02:00
Andrea Gelmini
e6168781f2 Fix typos
Change-Id: I626c182fc8c9b8fd17000f3ab3739c1bfb334a37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137243
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-21 16:07:00 +02:00
Jean-Pierre Ledure
cd8ab93d9b ScriptForge - tdf#149983 dialog.Execute() failure
(patch https://gerrit.libreoffice.org/c/core/+/137084 cont'd)

In SF_PythonHelper._PythonDispatcher():

Force a hardcoded call of the methods in the Dialog
service which may potentially be invoked while the
dialog is displayed, bypassing the generic CallByName()
Basic builtin function:
   Activate
   Center
   EndExecute
   Resize
   Execute => was missing in the list
              Case when a parent dialog opens a child dialog
(Controls is already hardcoded because returning an array)

Change-Id: Ia12fccbb61362768301df6670161f258b32d3a78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137289
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
2022-07-21 14:53:30 +02:00
Stephan Bergmann
f570de5df5 One more -Werror,-Wunused-result
...similar to cf69bb4f50
"-Werror,-Wunused-result", after c6965c5bcc
"tdf#145528 add round1Rect to SmartArt text area corrections"

Change-Id: I59292c7e4aae07be2ea46ae5c3db9629fa129a58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137295
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-21 14:52:54 +02:00
Noel Grandin
4d42b6fa4e tdf#119840 don't load redlines in lcl_FindParagraphClassificationField
we don't need them here.

Shaves 10% off load time

Change-Id: I38050c131af24bf0cc7cadb71d0d4d9fa7a5a9f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137290
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21 14:07:57 +02:00
Noel Grandin
49e559625d allocate SwFormatVertOrient inline in SwNumFormat
which reduces allocation overhead when loading some documents

Change-Id: I587752f9a59754e4cbb41963665d8be476f2d8c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137291
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21 14:07:48 +02:00
Caolán McNamara
9659860c56 tdf#149823 default to MouseWheelBehaviour::FocusOnly
instead of MouseWheelBehaviour::ALWAYS

Change-Id: I77bf4db6ec30c00b680a1091670fa331a026e154
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137271
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-21 14:03:03 +02:00
Caolán McNamara
e3f5bf99ab tdf#149823 follow MouseWheelBehaviour for GtkSpinButton
so with FocusOnly set when it doesn't have focus don't react to scroll-events

Change-Id: I520550590c7102ad823b677dfcce184b8b4ca377
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137268
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-21 14:02:46 +02:00
Regina Henschel
c6965c5bcc tdf#145528 add round1Rect to SmartArt text area corrections
Some SmartArt types use text area rectangles different from defaults.
The new rectangle is available in element <txXfrm>. This patch adds the
needed corrections for type round1Rect. It is four times used in
SmartArt 'Titled Matrix' with rotations 0deg, 90deg, 180deg and 270deg.

Change-Id: I8c82b446a982ad93026e976b2a47d509b858858d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137287
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2022-07-21 12:41:01 +02:00
Mike Kaganski
9426e90c2c Cleanup restoring last position
The checks of valid bottom were introduced in commit
f50ec0bda2
  Author Martin Gallwey <mtg@openoffice.org>
  Date   Wed May 16 16:08:38 2001 +0000
    #86580#, #86953#, #86294#, make ReadUserDataSequence bullet-proof

Possibly initially, bBrowse passed to SwView::ReadUserData was
sometimes false; but at some point it became always true, making
the code using right and bottom (stored in aVis) unreachable. That
became evident after commit db93b92d78
  Author Noel Grandin <noel@peralex.com>
  Date   Thu Mar 17 11:21:56 2016 +0200
    loplugin:constantparam in sfx2

So just drop the unused pieces, that for large documents often resulted
in last position not being restored, because the code exited early at
nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) check.

Change-Id: If9b4e6faa2754b94cb1298a7221e70736c94f27e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137186
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-07-21 12:10:56 +02:00
Aron Budea
f319363b0e tdf#141294 Use DPI scale factor for sidebar width limit in config
And don't lock up if the calculated minimum exceeds the maximum
(sidebar remains unresizable in that case, however).

Change-Id: Ibe96a43ad5d6a3fe4132a9fb64fe244ab022668d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137267
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
2022-07-21 11:41:39 +02:00
Noel Grandin
80a900838e elide some makeStringAndClear() calls
Change-Id: Ifd8de0042b843de0766a370fb19b9f7791974612
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137284
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21 11:24:10 +02:00
Miklos Vajna
1dce9ee7e1 sw content controls, plain text: apply formatting to the entire contents
The difference between normal (rich text) content control and a plain
text one is that if you try to format a subset of the contents, that's
possible in the rich text case, but the plain text case extends the
formatted range to the entire content control.

Handle this in SwTextNode::InsertHint(), similar to how it's done for
input fields.

Change-Id: I9a1ad0095f0ca810da24d5c4ce4aa48d1ac59225
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137280
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-07-21 11:18:36 +02:00
Noel Grandin
bc6e6fe77f elide some makeStringAndClear() calls
Change-Id: Id81a0c0046d0d84e6c327eef4447b21fecae6ddc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137283
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21 11:01:40 +02:00
Noel Grandin
faa40c022c elide some makeStringAndClear() calls
Change-Id: I8636102554a76f2ba3f6297219b40761473a4489
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137285
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21 11:01:22 +02:00
Gabor Kelemen
716c5a3c19 Update git submodules
* Update helpcontent2 from branch 'master'
  to da7edbd2fd925bd80fdd6affe2ff6510c8ac1c5d
  - (related) tdf#134281 tdf#149351 Update shortcuts descriptions
    
    usable on the Presenter Console and the presentation canvas.
    
    Also the one added in c11b6b64f6
    
    Change-Id: I55a392730ca24f92cac1e11e1f3c2ef1771a00d3
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/137240
    Tested-by: Jenkins
    Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2022-07-21 10:43:52 +02:00
Noel Grandin
a6d4a66486 shrink size of SwRangeRedline
by re-arranging members, remove holes in the structure

Change-Id: I934d4867f29bdd1bfd4e6afb8d8ed0ccc88ca219
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137282
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21 10:29:13 +02:00
Bartosz Kosiorek
a0bcd1d187 tdf33787 lotuswordpro: fix increments of ordered bullets
With previous implementation there was an bug which causing missing
incrementing ordered bullets. For example:

        A. Lettered bullet uppercase 1 (A. )
        A. Lettered bullet uppercase 2 (B. )
        A. Lettered bullet uppercase 3 (C. )

This patch is fixing that, and increments is working correctly:

        A. Lettered bullet uppercase 1 (A. )
        B. Lettered bullet uppercase 2 (B. )
        C. Lettered bullet uppercase 3 (C. )

It is also make sure that nested and skipped bullets are working correctly:

        1) Numbered bullet w/ bracket one (1) )
           Skipped bullet
        2) Numbered bullet w/ bracket two (2) )
            a) Lettered bullet w/ bracket lowercase 1 (a) )
            b) Lettered bullet w/ bracket lowercase 2 (b) )

Change-Id: I1d1ad9ee549039077b418756efefb10bacfa1ddd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137112
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-07-21 09:11:31 +02:00
Tomaž Vajngerl
d449da3608 tdf#123983 fix loading graphic that is in root folder + test
We need to detect that the storage name is empty, so in that case
the root storage needs to be set as the current storage.

Change-Id: Ibe3287ccf1f1513a3531dcf4d540a456cca8dfb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137276
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-21 09:01:51 +02:00
Tomaž Vajngerl
6c24f112ad chart2: apply line props. to borders when rendering a data table
This sets the color, line width, line style to the borders of
the table when rendering the data table. We also need the
ChartModel inside DataTableView, so we can access the needed
line dashes.

Change-Id: Id3bef23b75e88517d6569ad87a716f178ed64343
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137158
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-21 09:01:27 +02:00
Noel Grandin
7a076dd9a6 use more concrete UNO classes in writer
as opposed to opaque UNO interfaces.
This is a prelude which enables performance work because now I can
regular C++ method

Change-Id: I9bcfdca1000b4439431c9ea3b17bed081d80f0b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137275
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21 09:00:05 +02:00
Noel Grandin
85f4938719 clang-tidy modernize-pass-by-value in svx
Change-Id: Iedd87d321f4d161574df87629fdd6c7714ff31c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137248
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21 08:59:50 +02:00
Stephan Bergmann
cf69bb4f50 -Werror,-Wunused-result
...when building against a recent libc++ that marks std::clamp [[nodiscard]], in
code newly introduced in 7e23cbdbb6 "tdf#149551
separate TextRotateAngle from TextPreRotateAngle"

Change-Id: Ifdce627b5d76fac269f1403e7bb98d4576dfa682
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137257
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-21 08:41:40 +02:00
Stephan Bergmann
eea7038c18 Fix CppunitTest_vcl_svm_test for big endian
These crc values are the results of Bitmap::GetChecksum() calls, and for
headless Linux the formats of those bitmaps (ScanlineFormat::N24BitTcBgr |
ScanlineFormat::TopDown vs. ScanlineFormat::N24BitTcRgb |
ScanlineFormat::TopDown) depend on little vs. big endian (see the definition of
SVP_24BIT_FORMAT in vcl/inc/headless/CairoCommon.hxx), so these tests failed on
big endian Linux s390x.

So I updated the tests with whatever values I got reported on s390x, whether or
not those values are actually correct...

Change-Id: I05d2b656ae2e0cf00cd870b895e1bf3cb9cf82f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137270
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-20 23:07:59 +02:00
Miklos Vajna
da8e95ebe0 sw content controls, plain text: add doc model & UNO API
OOXML's <w:sdt> with <w:text> describes a plain text content control. We
are currently mapping this to fields, and then on export it's possible
to map this to FORMTEXT fields. The trouble is that our doc model could
not differentiate between content controls and fields for non-formatted
form text, so the exporter can't do the opposite of import.

This has the benefit that input fields do a reasonable job of providing
the feature set of plain text content controls, but it has the downside
that we map two OOXML features to a single Writer concept, loosing
formatting.

Fix this by introducing a dedicated "plain text" content control type,
which can be used for OOXML's <w:sdt> with <w:text>, and keep using the
input field only for OOXML fields.

This commit just adds the document model & UNO API, follow-up commits
will add the remaining functionality.

Change-Id: I0a0317adbd5f58c6ab880dccf6170292462d2671
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137263
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-07-20 23:01:11 +02:00
Hannah Meeks
4205fb7231 VBA Fix off by one error in setting range
xEnd should not be smaller than xStart for compatibility
Add first Document tests

Change-Id: Ia8898d79db8c2885c6253ee9aaca793082b9dd20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137262
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-20 22:45:18 +02:00
Hannah Meeks
f6d45f07fc VBA: Selection.Find should select whole doc if no prior selection.
Change-Id: I8b77ae982a772a95290aea186f4fe6556f2a2e1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137202
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-20 22:44:28 +02:00
Christian Lohmaier
1844326df4 tdf#141421 xml export: default stacksize for threads on macOS is too small
libxslt usage means lots of recursion for the sample document and the default
for non-main threads is 512kB, see
https://developer.apple.com/library/archive/qa/qa1419/_index.html
and contrary to linux it doesn't default to the value set via ulimit.

https://docs.microsoft.com/en-us/windows/win32/procthread/thread-stack-size
says default for Windows is 1MB, so use that as a new default.
(on linux it effectively is 8MB via ulimit, if not specified it would default
to 2MB for most architectures)

Change-Id: I10bd25301b0aea83e5bbb0c2103a0dd47a7e0736
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137269
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-20 21:52:52 +02:00
Stephan Bergmann
eda0c48278 Make combineScanlineChannels stop before padding bytes
At <https://ci.libreoffice.org/job/lo_ubsan/2467>,
CppunitTest_sd_export_tests-ooxml1 failed with

> ==4831==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x629000211c54 at pc 0x7fcdcb44093f bp 0x7ffe85792760 sp 0x7ffe85792758
> READ of size 1 at 0x629000211c54 thread T0
>     #0 0x7fcdcb44093e in (anonymous namespace)::combineScanlineChannels(unsigned char*, unsigned char*, unsigned char*, unsigned int) /vcl/source/filter/png/PngImageWriter.cxx:27:22
>     #1 0x7fcdcb43fbaf in vcl::pngWrite(SvStream&, BitmapEx const&, int, bool, bool, std::__debug::vector<vcl::PngChunk, std::allocator<vcl::PngChunk> > const&) /vcl/source/filter/png/PngImageWriter.cxx:231:21
>     #2 0x7fcdcb43ce80 in vcl::PngImageWriter::write(BitmapEx const&) /vcl/source/filter/png/PngImageWriter.cxx:318:12
>     #3 0x7fcdcaf04bc1 in GraphicFilter::ExportGraphic(Graphic const&, std::basic_string_view<char16_t, std::char_traits<char16_t> >, SvStream&, unsigned short, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const*) /vcl/source/filter/graphicfilter.cxx:1801:28
> 0x629000211c54 is located 0 bytes to the right of 19028-byte region [0x62900020d200,0x629000211c54)
> allocated by thread T0 here:
>     #0 0x4fd898 in operator new[](unsigned long) /home/tdf/lode/packages/llvm-llvmorg-12.0.1.src/compiler-rt/lib/asan/asan_new_delete.cpp:102
>     #1 0x7fcdcbcbd50b in ImplCreateDIB(Size const&, vcl::PixelFormat, BitmapPalette const&) /vcl/headless/svpbmp.cxx:123:24
>     #2 0x7fcdcbcbb483 in SvpSalBitmap::Create(Size const&, vcl::PixelFormat, BitmapPalette const&) /vcl/headless/svpbmp.cxx:152:13
>     #3 0x7fcdca406c59 in Bitmap::Bitmap(Size const&, vcl::PixelFormat, BitmapPalette const*) /vcl/source/bitmap/bitmap.cxx:136:15

because for the given N24BitTcBgr bitmap of size 89x71 we have
pAccess->GetScanlineSize() = 268 = 89 * 3 + 1, so combineScanlineChannels wanted
to erroneously read an excessive 90th RGB triplet.

Change-Id: Ida117999de075b8906f43bfe4c2b7fa98df80b0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137261
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-20 21:43:44 +02:00
Regina Henschel
2f3b87d18a tdf#149551 Unit tests for insets in SmartArt
This is followup to commit 7e23cbdb. That commit contains for several
types of shapes a correction of the position and size of the text area
rectangle.
That commit fixes bugs tdf#59802, tdf#136234, tdf#118009 and duplicate
tdf#142841 were the here tested shape types are involved.

Change-Id: I7c8c9676cf3dbdcc3f91fe25d75901b63d0ca4da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137264
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2022-07-20 20:48:22 +02:00
Miklos Vajna
92914312cf external: update pdfium to 5187
build.patch.1 is extended to avoid:

> C:/lo/master/workdir/UnpackedTarball/pdfium/third_party/libopenjpeg/openjpeg.c(438): error C2491: 'opj_decoder_set_strict_mode': definition of dllimport function not allowed

and also is extended to avoid:

> /opt/rh/devtoolset-7/root/usr/include/c++/7/bits/stl_tree.h:2028:5: note:   no known conversion for argument 1 from ‘std::pair<fxcrt::RetainPtr<CPDF_Object>, std::unique_ptr<CPDF_PageObjectAvail> >::first_type {aka fxcrt::RetainPtr<CPDF_Object>}’ to ‘const CPDF_Object* const&’

Change-Id: Icacc05627a8612b33d6445685d26470e7c757b8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137238
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-07-20 20:06:12 +02:00
Gülşah Köse
9790585a62 tdf#149915 Proper creation of vnd.sun.star.pkg:// URL
Using different methods of creation (one using DecodeMechanism::NONE,
another using DecodeMechanism::WithCharset) gave differently encoded
end results, comparing unequal.

The proper way is using DecodeMechanism::NONE on the document's URL,
as implemented in commit 06756e412b
  Author Mike Kaganski <mike.kaganski@collabora.com>
  Date   Sat Nov 18 22:41:40 2017 +0300
    One more proper construction of vnd.sun.star.pkg URL

Co-authored-by: Mike Kaganski <mike.kaganski@collabora.com>

Change-Id: I272f277ef8b4bd23e6cb7884e68f3c79f742683a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136901
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-07-20 19:20:33 +02:00
Caolán McNamara
f37395de71 ofz#48366 Timeout
Change-Id: Id643e80696843e0c22ae7eee2b5862320948ae27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137249
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-20 18:05:19 +02:00
Caolán McNamara
779fc912b2 ofz#49200 Timeout
disable slow path for fuzzing

Change-Id: Ic23d7ba56210915b53b4330edb44458a672ba4ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137255
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-20 18:05:03 +02:00
Gabor Kelemen
2d466a95fc tdf#92610 Fix missing/conflicting accelerators on Header/Footer tab page
Change-Id: I54099745b1246b474d2f389b7c87abb18d944cab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137241
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-07-20 17:32:20 +02:00
Hannah Meeks
4a49644c97 VBA: Add Select Method to ActiveDocument
Change-Id: I0d8d02c555fd113b96661085b339b12d83c6010f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137109
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-20 14:46:37 +02:00
Hannah Meeks
4d945a41bc VBA: Add test documents for vba
Mostly disabled for now pending core fixing

Change-Id: Idf71cea820c52f2b56fb26b1d8de2666026bf90e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137105
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-20 14:44:23 +02:00
Justin Luth
b4c55cb614 tdf#139759 doc import: import comment highlight/shade
Round-tripping depends on earlier commits for this bug.

These two attributes are SvxColorItems in EditEng,
but SvxBrushItems in Writer. So direct mapping doesn't work.

Although it might be a highlight, LO doesn't have such a silly
duplicate thing in the editeng code. So just map this as
the same thing used for normal char background.

As of LO 7.x, we default to exporting as char background anyway,
so highlight is on the way out in LO.

P.S. Highlight is one of 17-ish colors. It is the background
button in the Char panel in MS Word. Background is on Word's
Para panel (even though it is a character property),
and so it can fairly easily be removed in MS Word.

Change-Id: Id25879d90ba4a0eeff2d6afed030fc029d1c1039
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137239
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-07-20 14:39:24 +02:00
Miklos Vajna
7d56dae337 tdf#127236 vcl: fix missing encryption of PDF images during export
Regression from commit 78e25558e8
(tdf#106059 PDF export: create a reference XObject for JPG images with
PDF data, 2017-02-23), once a PDF image was inserted to a document, an
encrypted PDF export lost those images.

The reason for this is that we started to preserve PDF images as vector
data with the above commit, but this means we copied over PDF objects
from PDF images to the export result as-is, so encryption was not
performed for them.

Fix this by separating the write of the PDF object headers, stream
content and object footer and then calling
checkAndEnableStreamEncryption() / disableStreamEncryption() for each
object, even if it's not something our PDF export created but comes from
a PDF image.

Note that when existing PDF files are signed, PDF objects are also
copied into a vcl::filter::PDFDocument, but such PDF images are never
encrypted, so it's fine to have stub implementations in
vcl::filter::PDFDocument.

Change-Id: I2f74b9f51cd35b4319221532ca890e197bab9cf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137242
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-07-20 12:54:45 +02:00
Chris Sherlock
845393b9aa move wintypes.hxx from tools to vcl
Change-Id: Ief9949fd4252de9e33df172af07aa7ed097b5520
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136560
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-20 12:20:59 +02:00
Caolán McNamara
6721eddbcf forcepoint#107: reproducible testcase
make this reproducible without asan

Change-Id: I32cee0a22616e96d85c59d76319a6f6074fcde8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136228
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-20 10:00:39 +02:00
Regina Henschel
7e23cbdbb6 tdf#149551 separate TextRotateAngle from TextPreRotateAngle
The import filter had only one member for both and had it mapped to
TextPreRotateAngle. That resulted in lost text area rotation when a
shape had both types of rotations, and sheared text when only text
area rotation existed.

The patch introduces a new 'moTextAreaRotation' member for the 'rot'
attribute of the <bodyPr> element. It is mapped to 'TextRotateAngle'
property. It becomes the 'draw:text-rotate-angle' attribute of the
<draw:enhanced-geometry> element for a shape and 'style:rotate-angle'
for chart elements in ODF. It must also be used to simulate 'upright'
and is used for the 'rot' attribute in <txXfrm> of diagram shapes.

The 'moRotation' member is now only used for the 'TextPreRotateAngle'
property. That angle describes a rotation of the text without changing
the text area. Valid values are multiples of 90deg. It is used for
simulating vertical writing modes that are not yet implemented. It has
no corresponding attribute in ODF. To make the meaning clear in code,
the member is renamed to 'moTextPreRotation'.

MS Office recalutes a diagram on file opening from layout.xml and
data.xml. That is not yet implemented in LO, but we use drawing.xml,
which gives the state of the diagram at time of saving. The patch
handles the 'rot' attribute of <txXfrm> element as well. It has to be
mapped to moTextAreaRotation, because it might contain angles, which
are not multiples of 90deg, for example diagram 'Gear'.

The <off> and <ext> child elements of <txXfrm> describe the actual used
text area rectangle. The existing import calculates the difference of
the actual used text area rectangle to the predefined one and
incorporates it into the TextArea*Distance attributes. The patch adds
calculating the current values of the text area rectangle as it would
be using the preset markup. At that time in import there is no
SdrObjCustomShape object, thus we cannot use its GetTextBounds() method.
So it is down manually, covering most of those types, which are used in
diagrams of MS Office.

Remarks to unit tests:
Now the rotation introduced by txXfrm is no longer in
TextPreRotateAngle, but in TextRotateAngle. According changes are in
SdImportTest::testN86510_2
Test, testFdo87488

Now the correct preset text area rectangles are used. That requires
adaption of the needed distances. Done in
SdImportTest::testBnc870237()
SdImportTest::testTdf93830()
SdImportTestSmartArt::testTdf134221()

The buggy 'upright' export is fixed. Adaption in
ScExportTest2::testTdf137000_handle_upright()

Change-Id: I79df1559f88b76e96988fe745304dc4162de6316
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136447
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-07-20 08:16:03 +02:00
offtkp
65f1903921 Remove pngwrite.hxx and .cxx as it is replaced by PngImageWriter
pngwrite is now replaced by PngImageWriter which uses libpng so these
old files are removed.

Change-Id: Ie91c314f30b8f56682890000b90009f408a79094
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137140
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-20 08:13:27 +02:00
Caolán McNamara
21a31eefab tdf#149439 set initial customoption values from lpoptions when present
I presume there's a better way to do all this.

Change-Id: Id7e6cd3be5b82e419f17bba31834fef7cfe8299b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137237
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-19 21:47:51 +02:00