Commit Graph
8545 Commits
Author SHA1 Message Date
Michael Stahl 0fafc03c24 tdf#153083 writerfilter,sw: consolidate StyleName->StyleId in msfilter
Turns out there was already a function MSWordStyles::CreateStyleId()
doing the same thing as FilterChars(), presumably better.

Change-Id: Idd0129c753841b86bd026e1300aa57a56721c89e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146609
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-02-07 15:17:30 +00:00
Noel Grandin 00659bcdbb improve readability of VirtualDevice constructor
(a) It is not obvious what DeviceFormat::DEFAULT means
(b) There are two parameters (each with two states), but only really 2
possible overall states

So
(1) use more useful names
(2) combine the two parameters into one enum

Change-Id: Ic0595b39e032cc9e019b88326389d055b977da00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146589
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-07 10:19:32 +00:00
Tomaž Vajngerl 7ab51def76 sw: implement "Theme" property for the XDrawPage in Writer
Change-Id: I8eed04f0ccb2e626a648abcaecd957b6f62c39d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146226
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-02-01 08:41:21 +00:00
Tomaž Vajngerl 9740331d8b tdf#66580 write more metadata to embedded and attached files
Change-Id: I6f40fd98b48893d01d29a806877821c561688897
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146288
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-02-01 02:11:05 +00:00
Tomaž Vajngerl e052f6e1d4 tdf#66580 write ODF document as an attachment in hybrid mode
This changes the hybrid mode so that the ODF document is written
as an PDF compatible file attachment into the PDF document. It also
keeps writing the /AdditionalStreams element into the trailer to
keep backwards compatibility for now.

Change-Id: Ica31159cfbd591c6741e3da62c42d1fefd085696
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146053
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-24 10:50:49 +00:00
NickWingate 7ebe5e19fb Make PDFExport Password Subdialog Async
Dialog in File>Export As PDF>Security>Set Password
Close subdialog when parent dialog is closed

Signed-off-by: NickWingate <nick.wingate@collabora.com>
Change-Id: I9db8459309f2806ed47f9f932e0bde246400b2dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144854
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145759
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2023-01-19 12:48:06 +00:00
Mike Kaganski f2f008c52a Merge SvXMLAttributeList to comphelper::AttributeList
And simplify the latter, to always use "CDATA" type (as the former did).
"CDATA" was used in all cases but one, where an empty string was used.

Change-Id: I1b3bfae40e29628e4094d9a6e58a69a66865874c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145526
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-15 12:32:29 +00:00
Justin Luth d50eca2a30 tdf#117266 sc oox: export vml button with a correct name
Without a correctly formatted ID, LO was unable to import
the shape into the spreadsheet. Now at least the button
shows up and can be pressed.

MS Word already showed the button before the patch,
so nothing there has changed. That suggests that our
problem may be more during import.

This code path is also followed by DOC and DOCX formats,
but they do completely different things with the results.
This is super nasty code...

Change-Id: I383736a7de9c3e94b427d5747e5949c0348dcecd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145509
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2023-01-15 02:09:06 +00:00
Noel Grandin 21734247d5 drop internal support for 1-bit images
on modern hardware, these are less efficient than regular alpha
channels.

Also, this greatly simplies the range of stuff that vcl needs to deal
with, which will make the upcoming transparency->alpha patch easier to
deal with.

Enhance vcl::CreateFromData to convert incoming 1-bit data to 8-bit
image.

Change-Id: I35829da750029fe373d0d2911a669d10bab6ad23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145321
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-12 06:52:42 +00:00
Andras Timar 241cd824fd lok: hide 'View PDF after export' checkbox in PDF export dialog
Change-Id: I866e4765ba88ca6c93375c9fecd51f22b79ce72e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144535
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2022-12-20 06:40:49 +00:00
Szymon Kłos 63eed8ff31 lok: hide signatures in PDF export dialog
Change-Id: Idd67e7ffe4dffc89555d75773501908165cbdd7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144149
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144513
Tested-by: Jenkins
2022-12-20 06:40:11 +00:00
NickWingate 89f5912ad2 Async PDFExport dialog and parent methods
Filter dialogs are all called generically from
guisaveas.cxx in GUIStoreModel()

Signed-off-by: NickWingate <nick.wingate@collabora.com>
Change-Id: Idfbe85c09f84d4a7cf3f00b9704d5af94868a051
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140403
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144511
Tested-by: Jenkins
2022-12-20 03:11:16 +00:00
Caolán McNamara d968061f00 crashtesting: asserts with outsized object positions
seen during import of:
forums/forum-mso-en4-187408.xls
forums/forum-mso-en4-187900.xls
forums/forum-mso-en4-187890.xls

Change-Id: Id15e9c1ea98d761225d41850b9b2aa58d9c9e407
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144466
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-12-19 16:37:15 +00:00
Caolán McNamara f9395a123e tdf#152094 retain more accuracy from RefDevMode::MSO1
do it like this to avoid adding another mapmode and to keep things
"the same" as much as possible

Change-Id: I1965aa545646f2d27b950d6335b2f608c3e4e04b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143475
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-12-02 15:20:07 +00:00
Samuel Mehrbrodt 19e3bab1a8 tdf#77650 Add option to place comments in margin (PDF Export)
This was somehow possible already when the document was printed with
comments in margin before - but it was not possible to set this option
when exporting a PDF via dialog or API.

To use this setting via API, set the "ExportNotesInMargin" property.

Change-Id: I97a80c5b3b3b2cde669496fd881a41ea0acc5c28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143234
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-11-28 11:24:57 +01:00
Miklos Vajna 574db5efa9 Related: tdf#54053 PDF export: add UNO API to customize the watermark rotation
The watermark direction is currently either 0 degrees for landscape
pages or 270 degrees for portrait pages.

The problem is many people expect 45 degrees rotation angle or some
custom angle in general, and we provide no way to control it.

Fix the problem by adding a new "WatermarkRotateAngle" PDF export filter
option to specify the rotation angle explicitly. Note that the watermark
text is still centered, and the text size is decreased to still fit the page
boundaries. To keep things simple, do this shrinking by going with a
size that matches the shorter dimension of the page, instead of some
more complex iterative approach.

Example cmdline usage:

soffice --convert-to pdf:writer_pdf_Export:'{"Watermark":{"type":"string","value":"draft"}, "WatermarkRotateAngle":{"type":"long","value":"450"}}' test.odt

Change-Id: I1fee14c333e68c92cf4c65ec100e04dcf024f907
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143229
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-11-24 16:30:31 +01:00
Stephan Bergmann 8467aa93e2 Replace a dynamic_cast with UNO_QUERY
Change-Id: Id50f09150fc2c235787c51361d00416119e11937
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143201
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-24 10:54:25 +01:00
Miklos Vajna d1dd9b9733 Related: tdf#54053 PDF export: add UNO API to customize the watermark font name
The font name of the watermark text is currently hardwired to Helvetica,
a sans-serif font.

The problem is that this looks bad in case your document uses serif or
monospace fonts. Or perhaps your document uses a single font and you
want to make sure that the watermark uses exactly the same font.

Fix the problem by adding a new "WatermarkFontName" PDF export filter
option to specify the font name explicitly.

Example cmdline usage:

soffice --convert-to pdf:writer_pdf_Export:'{"Watermark":{"type":"string","value":"draft"}, "WatermarkFontName":{"type":"string","value":"Times"}}' test.odt

Change-Id: I2f065e1517236695b0a95369bdcd803125018587
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143143
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-11-23 15:47:03 +01:00
Miklos Vajna 175e514c93 Related: tdf#54053 PDF export: add UNO API to customize the watermark font size
The font height of the watermark text is currently automatic: we start
with a value based on the page size and then decrease it till the text
fits.

The problem is that sometimes you want a smaller value, but specifying
this was not possible.

Fix the problem by adding a new "WatermarkFontHeight" PDF export filter
option to specify the font size explicitly.

Example cmdline usage:

soffice --convert-to pdf:writer_pdf_Export:'{"Watermark":{"type":"string","value":"draft"}, "WatermarkFontHeight":{"type":"long","value":"100"}}' test.odt

Change-Id: Iceab943b7a995badfcdc6b12ecc9264e39e4a3a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143135
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-11-23 10:42:55 +01:00
Caolán McNamara 5d9b8c367e tdf#152150 make AccessibilityCheckDialog modal when child of modal pdf dialog
Change-Id: If6ff13d17a5ead40d9694ea861dc8946c201147e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143044
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-22 14:13:29 +01:00
Marco Cecchetti 7dd9790b89 svg export filter: text fields not handled correctly
New solution for fixing text field issues:

- small text field are not substituted with the right content because
the placeholder text span several lines
- copy of standard text fields embedded in the default master page are
not substitute with the right content.

Change-Id: Ifc8773f1ba41f9d0fe6f6ef3982cb64a514fcec7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143045
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143051
Tested-by: Jenkins
2022-11-22 12:15:41 +01:00
Marco Cecchetti bbe4161818 svg export filter: when a text field is too small, its content is wrong
When the text field width is too small, the placeholder text spans
several lines.
That stopped the js engine to substitute the text field placeholder
with the right content.
This is a workaround but it should work in the majority of cases.
A complete solution needs to support svg text wrapping.

Change-Id: Ide52e08acd35b3764b8abc600e4b467acea0a248
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142760
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ash@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143050
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2022-11-22 12:15:24 +01:00
Marco Cecchetti 0abbef139f svg export filter: footer was not replaced with the right content
When a user create a copy of the footer text field which can be
included in a master page, the copy content was kept to the text
placeholder instead of being substituted with the right content.

Change-Id: I411349026e41d49b606cdae5d13d990d0fa0b07c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142759
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143049
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2022-11-22 12:15:07 +01:00
Mike Kaganski aa0c9eb6bd tokens.gperf: Use LF line endings also on Windows
This fixes the warnings during the build:

  C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/workdir/CustomTarget/filter/source/svg/tokens.gperf:9: warning: junk after %% is ignored
  unsupported language option C++
  , defaulting to ANSI-C
  C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/workdir/CustomTarget/filter/source/svg/tokens.gperf:2: junk after declaration

This is https://savannah.gnu.org/bugs/?53732, and is expected to be fixed in
http://git.savannah.gnu.org/gitweb/?p=gperf.git;a=commitdiff;h=13c9383b10872525688ef2b4daab090037ea3576
However, the last gperf release is still 3.1 from 2017, and has not that fix
included. Since we use Python 3.x, it is OK to just use 'newline' argument
in the open call.

Change-Id: I33585d1cc698eb55e353adbc684a83c1e0156507
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143095
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-11-22 12:05:08 +01:00
Noel Grandin 57fcfc5a50 loplugin:unusedfields
Change-Id: Icf6e7e116a087e7f68b86bdb645850a2edaa2f78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143087
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-22 11:04:22 +01:00
László Németh 07711c8482 tdf#149800 SVG export: remove extra white line of semi-transparent shape
A shape is exported using two svg:paths, first one is for the
fill, and the second one is for the line. Semi-transparency of
shapes enabled the disabled stroke of the first path, resulting
an ~1 pt width extra white line behind the normal line of the
shape. It was visible only, if the normal shape line was thinner
than 1 pt, or if the normal line was semi-transparent or disabled.
The extra line got the same transparency value, as the fill,
so its visibility depended on that, too.

Change-Id: Idc40971cc73ec9e4f241974ae29c876d06cc0658
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143003
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
2022-11-21 08:08:26 +01:00
Samuel Mehrbrodt 950bd818eb tdf#148999 Add rescan button to PDF a11y check dialog
Change-Id: I772f529ea4bd225701b9864ad9156c573f41484c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142715
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-11-18 09:06:55 +01:00
Miklos Vajna 21c4749d02 Related: tdf#54053 PDF export: add UNO API to customize the watermark color
PDF export has a watermark feature, but its color is hardcoded to light
green, which won't fit all documents.

On the other hand, the input from Heiko in
<https://bugs.documentfoundation.org/show_bug.cgi?id=54053#c12> is to
keep the dialog clean, so adding one more UI option is not great.

Fix the problem by only adding the option at an UNO API level for now,
this relaxes the hardcoded color without cluttering the UI.

Also available on the cmdline for e.g. 0xff0000 / red color:

soffice --convert-to pdf:writer_pdf_Export:'{"Watermark":{"type":"string","value":"draft"}, "WatermarkColor":{"type":"long","value":"16711680"}}' test.odt

Change-Id: I38a3650df86fd34dfc09e3a5643511baa371aa83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142835
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-11-17 14:50:07 +01:00
Noel Grandin 8011b16e05 Use BitmapEx in BitmapPrimitive2D
we no longer need to wrap it in the framework XBitmap
implemenation

Change-Id: I0dc56ad63364e2c5a4cedd5e70d4ae7ea7eae563
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142746
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-16 07:57:00 +01:00
Miklos Vajna c725028f15 SVG export: fix handling of semi-transparent, multi-para shape text
The bugdoc had a shape with two paragraphs. The export of the second paragraph
went wrong: the position & size of the text was larger than expected.

This problem was specific to semi-transparent text.
SVGTextWriter::setTextPosition() is recursive in this case. The non-transparent
case left nCurAction unchanged in the outer setTextPosition() and it returned 1
("text is found"). The semi-transparent case changed nCurAction by +2 and
returned 0 ("text is not found"). This led to all sorts of trouble, including
mismatching Push() and Pop() calls on the output device when replaying the
metafile.

Fix the problem by routing the empty state from the inner setTextPosition() to
the outer one: if we return 1 ("text is found"), then we know that the state is
non-empty. Once the empty state is correct in the outer setTextPosition(), then
even the transparent case also leaves nCurAction unchanged and the whole shape
text has the correct position and size.

I forgot to update this empty state in ther outer setTextPosition() in commit
666f252457 (SVG export: fix lost semi-transparent
text on shapes, 2020-07-17).

Change-Id: I7dc93fe13c4510220bf09a388e742799ed042510
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142590
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-11-11 19:35:55 +01:00
Stephan Bergmann d45d1e14d7 -Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): filter
Change-Id: Ia69631701e2f1f5d61fda8ce6a7f7fc76ecc6e3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142326
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-05 18:27:01 +01:00
Caolán McNamara e126c98bf8 ofz#53016 Undefined-shift
before commit 4b95451f85
Date:   Wed Sep 21 20:54:00 2022 +0200

    split utl::TempFile into fast and named variants

    which makes it easier to know what each variant requires
    to stay on it's happy path

we closed the writable stream and got another readonly stream, after
that commit we have a read-write stream. With the "true" arg to
Storage it will Commit back to the underlying storage its contents
in its dtor. With a ReadOnly stream this failed and nothing happened,
with a read-write stream there is a write which didn't happen with a
read-only one.

Lets just use false here, we're not interested in keeping the contents.

"Direct" in this context is presumably analogous to the Compound
File Format "Direct mode":

"The mode in which files are accessed, either transacted or direct,
determines when changes are committed.

    Transacted mode uses a two-phase commit operation to make changes to
objects in a compound file, thereby keeping both the old and the new
copies of the document available until the user chooses to either save
or undo the changes.

    Direct mode incorporates changes to the document as they are made,
without the ability to later undo them.

For more information about access modes, see the OLE Programmer's Reference."

Change-Id: I1f710de227807073a6aff11a86d7cfaf6d380509
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142283
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-04 18:38:35 +01:00
Ashod Nakashian f994f4312d svg: export embedded video
Change-Id: Ie5dcd1fb4abbaf53f48107e7def0f42daad24596
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142145
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-04 08:28:25 +01:00
Noel Grandin 6d2ee5d46e SplineLine and SplineFill have never been implemented
Change-Id: I75e01bc8831a9d8e6e1f52fc3a89cd9827e1d6b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142263
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-04 08:18:46 +01:00
Noel Grandin 4d863fd8e3 tdf#54857 elide more dynamic_cast
Change-Id: I42bef355eeef15e3733a5ee57b0569887cfa5e84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142183
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-02 20:30:29 +01:00
Noel Grandin d1b7d7a8d1 tdf#126788 speed up export to pdf of complex table document
Shaves another 20% off the export time, bringing us to roughly the same
time as before commit
    commit 4fc3466d23
    Date:   Thu Apr 14 09:19:35 2022 +0200
    do not cache layout glyphs if fallback is involved

Change-Id: Ic595d4be7b05d857f3328ec28d1ef1232203cb03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141798
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-25 15:04:17 +02:00
Caolán McNamara 262f65a306 T602ImportFilterDialog doesn't need to implement XLocalizable
Change-Id: Iae2cb4d068a0fc1cdc3431fe8f736f1f45cc3d18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141755
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-10-24 16:02:42 +02:00
Caolán McNamara e70243e309 drop newly unused std::locale maResLocale
Change-Id: I3d10189968d15dc7e7465cbbd6e19d42041c0a64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141754
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-10-24 16:02:27 +02:00
Kevin Suo 5e3e507b1a Drop {PDFFilterResId, getResStr, XsltResId} and use FilterResId in "filter"
This is a followup to commit a97bae545d.

Previously different areas within the "filter" module used their own "*ResId" code
to get the translated string. They did the same thing without any difference in
purpose and implementation.

Unify this to use FilterResId instead.

Change-Id: Idccf74601a89b5786e1f61a04631436147710bb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141692
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-24 12:41:00 +02:00
Kevin Suo a97bae545d tdf#151697: Use localized string for "Loading" and "Saving" in status bar
Change-Id: I51967950839e7384e8f31178a70bd944d6f9059c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141662
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-23 17:56:22 +02:00
OmkarAcharekar 75e6ffe31d tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change-Id: I35c883a1b05a797e83a41698fa205796e681d7c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141482
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-10-18 14:24:06 +02:00
Justin Luth 1e0306be6c tdf#148806 vba: IsCompiled is required for SbxFlagBits::Private
Two step approach:
-putting this here where I need it - fairly targeted.
-put it in FindMethod before returning,
 so that everything gets it in a valid state.

Of course the second will probably cause consternations,
but then when it gets reverted at least this will still work.

Change-Id: I8772f85c9b9ae6ed9a25ba7966b50519afe0d6ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141243
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2022-10-12 15:24:28 +02:00
Justin Luth ffc15725b5 tdf#148806 tdf#151393 xls vba: no Auto_Open from ThisWorksheet
Unlike Word, ThisWorksheet cannot hold auto-running
subroutines for Open/Close/New.

This fixes a LO 7.4 regression caused by
commit beb6c62e99.

Change-Id: Idb8f72775d9392b306cb924ee776821272b12f3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141127
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2022-10-11 20:39:04 +02:00
Justin Luth 195cb01573 tdf#148806 fix build for !HAVE_FEATURE_SCRIPTING
I noticed this on one function, but completely
missed it on the second one.

Change-Id: I6ca74485b0c40cec2b04003fe894159198186ebf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141220
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2022-10-11 16:44:39 +02:00
Justin Luth eaa38b0f9d tdf#148806 doc vba: only autoOpen PUBLIC macros
Note: this should NOT apply to Document_Open which normally
is a private subroutine and runs fine as private.

I tested and it DOES apply to all three version of AutoOpen:
-ThisDocument.AutoOpen,
-<AnyModule>.AutoOpen,
-AutoOpen.Main

Note: this is different from Excel.
Private Auto_Open runs just fine there.

Change-Id: If10c8c90c35275c2b14dc2e15fb357674fc580b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141114
Tested-by: Justin Luth <jluth@mail.com>
Reviewed-by: Justin Luth <jluth@mail.com>
2022-10-11 03:08:13 +02:00
Justin Luth d72571fdd4 related tdf#148806 flatten filter/source/msfilter/msvbahelper.cxx
I don't like mixing big formatting changes with logic changes.

Change-Id: Id2dbdfd751ac86918fe39d6627aa9ce15c794323
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141113
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2022-10-09 01:10:59 +02:00
Miklos Vajna e7ca10a35f SVG export: don't loose tab portions
Impress slides are exported to SVG via a metafile. In case shape text
has a string like "A\tB", that was exported as "AB", loosing the tab
character.

The relevant shape is exported as a metafile, with two text array
metafile actions (one for "A", one for "B") and the tab needs no
explicit action as both "A" and "B" has an explicit position. The SVG
contained no explicit position for "B", so the tab was lost visually.

Fix the problem by detecting when the doc model has a "\t" without a
matching metafile action and emitting the explicit position in that
case.

An alternative would be to use implWriteTextPortion() to write a <tspan>
for the tab, but that doesn't guarantee that the width of the tab in the
SVG is the same as in Impress.

Change-Id: Ie21bffce9d09194159e460fb28ab23fbefd52102
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141014
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-10-06 16:12:07 +02:00
Justin Luth 8253b8d6f1 tdf#148806 docm: fix vba macro events without ScriptCodes
Prior to this, none of the DOCM ActiveX macros were called.
Now, just like magic, it all works.

Already broken at commit c5fc57de56
Author: npower Developer on Tue Mar 2 15:04:15 2010 +0000
    npower14miscfixes: #i109706# move back msvbahelper to the filter module

Change-Id: I25b25850b12609e5e00dd4bd5189a734abcbddd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140750
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2022-09-30 00:10:41 +02:00
Noel Grandin 4b95451f85 split utl::TempFile into fast and named variants
which makes it easier to know what each variant requires
to stay on it's happy path

Change-Id: I3275a2543573367714bc78092e882f6535507285
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-29 09:11:18 +02:00
Noel Grandin f725629a62 use more string_view in filter
Change-Id: I75c98f1da8898840bb882c17c7f1e59ec11ae8af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140648
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-27 15:04:00 +02:00