100 Commits
Author SHA1 Message Date
Vasily Melenchuk 6c9055aaac tdf#158512: PPTX import: reset useBgFill flag when it is unused
Even if current fill is not "use background" we should reset useBgFill
explicitly, since this value could be set from master slide and was
nested in current shape.

It is somewhat confusing to have fillStyle as none and using slide
background at the same time. So better to clean it explicitly.

Change-Id: I0d817dc295785be7a6cb8f884d5023d316cd2ebf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165994
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-12-09 15:34:03 +01:00
Vasily Melenchuk 3c371b7bde Windows Taskbar: use progress bar feature (ITaskbarList3)
Any status progress in LO status bar is also represented
as progress in Windows taskbar.

Change-Id: Ibd7131ff6246cf5ea37ab8730d0eddfa084265c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171886
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-11-18 13:03:52 +01:00
Vasily Melenchuk c6803b18d8 tdf#160553: writerfilter: RTF import: fix problem with first table in section
Handles section properties between tables.
JUnit test included

Change-Id: I1db8b80749d18c0e73112e4fd1d13d6331aa7291
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165286
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
2024-10-25 15:26:29 +02:00
Vasily Melenchuk 0c6642ed3a vcl: support for Windows ITaskbarList3 interface
And a demo implementation for these features as a taskbar window
will become red once LO is displaying any error message.

Change-Id: Ifc04026c699059da2e457de2c69e7363e756109c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166740
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-07-17 21:05:15 +02:00
Vasily Melenchuk e0b930e1dd VCL: Windows: more usecases for FlashWindow() API to inform on changes
FlashWindow() can be used to bring user attention to application
in background. Right now in LO it has implementation only for
Windows. Here some new cases were added when flashing is used:
 * dialog window did open
 * document loaded
 * LO started

Some redesign of previous solution is also performed: no manual
search for top window, let's reuse existing code.

Changed behavior for bringing LO window to foreground: it is made always and not depending on current value of NewDocumentHandling:ForceFocusAndToFront. It has no sense to tweak this behavior: if user clicks on document in file explorer, LO should came to foreground, no exceptions.

Change-Id: I22b5b4e2b170cd25632083a55b3e9f0358bcae03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166615
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2024-05-16 12:50:31 +02:00
Vasily Melenchuk 084882a66c sw: fixed crash on GetCreateView() returning nullptr
Change-Id: Id0cb44ac7d805a1736fa8170aaffb97b54211707
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166617
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2024-04-29 12:06:00 +02:00
Vasily Melenchuk 07137ccd7f configure: cygwin issue with date fixed
previous variant was causing: "bash: /dev/null: ambiguous redirect"
and value was written

Change-Id: Ic8762a98f11ef2fee669478b5694ae1c5fb0b8ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166294
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-04-22 14:38:34 +02:00
Vasily Melenchuk 68f55fc9a1 vcl: interface for WinAPI FlashWindow() function
To improve LibreOffice UX it will be great to have possibility to
signal user on some event did happen, but without capuring focus
and bringing LO to foreground, like it is happenings sometimes. It
can be annoying.

For example, if dialog window is opening slowly and user did switch
to another application, this is used to inform user that there
are some updates in LO window: dialog finally alive.

There are somewhat confusing implementation of this feature: VCL dialog
window became visible and actual Windows window should use
::FlashWindow() are very different in hierarchies, so it is somewhat
challenging to find window to flash or even decide shoud we flash window
or not.

Change-Id: I6ca6706d2dda8902aea273ebe6e318ec9bf4beda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158472
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2024-03-04 15:30:22 +01:00
Vasily Melenchuk 1b0b11db49 tdf#158409: RTF import: use current run props for fields
Fields import was not using current run properties causing
fallback to used style or default style what is wrong for RTF.

Change-Id: I0189c6122b703a23ff910ee38da78aa05ac4d9f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160387
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2024-02-06 13:27:06 +01:00
Vasily Melenchuk b6a7d8201b tdf#158083: RTF: drop export for \pgdsctbl
This table is not standard extension to RTF format. It is not
described in RTF specification and even is not used by Writer
on import these days.

Change-Id: I52f27dfd30877d461ad535b7847f40dd4c6f4ea5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158986
Tested-by: Jenkins
Tested-by: Gabor Kelemen <kelemeng@ubuntu.com>
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-07 14:59:46 +01:00
Vasily Melenchuk 3d83bdb94a vcl: removed redundant check
Change-Id: Iec2c344df9eb1fa61bb04355c3eee38499edcdac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158422
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2023-11-02 09:41:06 +01:00
Vasily Melenchuk 24ee09ab41 tdf#104288: rtf export: drop \nonshppict on export
- these days hard to find a reader not able to read shapes

- RTF file will became compact without pictures duplication

- WordPad nowadays is able to display shape pict, no reason
for fallback

- Fixing possible rtf file bloat on exporting some WMFs

Change-Id: Icc8b60da6541acef939f42021d8d5e81bbcd1ae4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158507
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2023-11-02 09:38:05 +01:00
Vasily Melenchuk da2e7b1e0b tdf#156030: sw: better import of IF field for RTF and DOCX
Since long time IF field was converted to ConditionalText, but no
parameters were given. So condition, then text and else text were
lost during import.

Change-Id: I9b45e8ab394f3c53bb34370bf3ea15a939a400fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154101
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-07-17 15:56:14 +02:00
Vasily Melenchuk 2d0a87f97e tdf#151974: writerfilter: apply props only to new document
Properties applied to document shoudl be a case only for new doc,
but DomainMapper can be called during pasing of RTF and cause
modifications to props in already open document.

Tested only for "NoNumberingShowFollowBy" but I assume this is
a case for all compatibility props.

Change-Id: I4558d809ca477918373b15fa05500ed985e170a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151069
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-05-03 01:16:52 +02:00
Vasily Melenchuk 992d86b1b6 tdf#150542: DOCX import: support for document varibles
Writer does insert document variables only if they are in
document body as DOCVARIABLE fields. But ones given in
settings.xml (w:docVars/w:docVar) were ignored.

Moreover variables in settings should have priority and
overwrite ones in fields. Word by default does show only
field results, but refreshing field values will override
values with ones from settings.

Change-Id: I7103c90eef59ab18f8a25e616dcf8a8b1c6dcb08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149646
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-03-31 12:57:59 +00:00
Vasily Melenchuk 26d74a57d5 tdf#103956: RTF import: fix for \cellx0 or no params.
If cell width is not given or zero lets not confuse it with too
narrow cell. Lets keep zero to allow domain mapper define some
width.

This patch does not solves autofit issue completely, but finally
tables with autofit are visible somehow and do not contain cells
with minimal almost invisible width (41).

Change-Id: I640228ed117f1d65dde9753a00b8403dda45dd40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145148
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2023-01-10 08:05:43 +00:00
Vasily Melenchuk 788cc6ff3b tdf#148578: Do not apply table shift for RTF
Table shift based on cell lect margin should be applied
for DOCX (earlier compat options) but not actual for RTF.

Maybe earlier RTF version did behave this way, but nowadays
this behavior does not match MS Word 365.

Change-Id: Icdc4fa6298167fe5f263c85164d7c4c4176be25f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145088
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-01-09 07:54:51 +00:00
Vasily Melenchuk e8d18b471e tdf#152784: RTF import: more default paragraph params
If numbering is not explicitly mentioned in para properties
it should not be used from referred paragraph style. So
default value of 0 (no numbering) is used by default.

Change-Id: If8e8f2aaf19190f64a557444188f67b24a699b54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144839
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-01-06 14:47:23 +00:00
Vasily Melenchuk f011a13b3e writerfilter: removed remains of GAP_HALF define and its usage
Change-Id: I8dee16f923686f557c8213d9a7870392bd5fe9bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145090
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2023-01-06 07:26:15 +00:00
Vasily Melenchuk b22bbfa25a Related: tdf#125093 Check Windows Security Zones for macros
In Windows, files get assigned security zones (local, from intranet,
from internet, etc) after download via browser or email client. This
is used by MS Word to decide in which mode it is safe to open file.

This patch implements basic support for similar feature: by default
there are no changes in macro behavior. But it is possible to use
expert configuration options to tweak default behavior, and for
example disable macros automatically, if a file is downloaded from
Internet or other unsafe locations.

Change-Id: I0bf1ae4e54d75dd5d07cab309124a67a85ef2d4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143680
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-12-30 04:24:27 +00:00
Vasily Melenchuk d5a9722874 ms format import: better handling for invalid styles
If referred paragraph style is not found or it is not a paragraph
style, this can lead to exceptions in writer core and thus current
paragraph can be not corretly initialized. For example, numbering
can be not applied because of exception of not found style earlier.
This is not a critical error, we should just not apply a style
we could not resolve.

Of course such documents are invalid but bit more tolerance to errors
will not harm.

Change-Id: I9150786e6357a7d6098440bac29ec501fc6aa802
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144852
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-12-29 22:39:55 +00:00
Vasily Melenchuk b15c82e02c tdf#151912: sw: suppress exceptions during SDT evluation
Failure in XPath processing during retrieving fresh value from
data source is not a critical problem and should not cancel
document loading.

Just put warning in log and continue to eval further.

Change-Id: I76ecf0e0e227f46a270db3e77d86c19f7e9ad21a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142428
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2022-11-14 09:20:42 +01:00
Vasily Melenchuk 0d545f1f0a tdf#151370: RTF import: docvar name/value can have several sequences
In case of unicode used there can be tokens, replacements, etc.
So it is better to collect and join all received strings, not
overwrite with just last received.

Change-Id: I2b6ce465d87db4ee30987cbe0ecce1470386242f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141007
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-10-07 11:06:48 +02:00
Vasily Melenchuk da100343e5 tdf#147724: DOCX STD import: use storeid to indetify custom XML
We need to identify XML document to use by storeid in sdt block
and in properties of external XML file. Otherwise are possible
content collisions when same xpath can evaluate successfully
absolutely unrelated custom XML.

Change-Id: I6d201a539130b110046deb1818340513cc47a061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139771
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2022-09-28 09:58:00 +02:00
Vasily Melenchuk 57d9cc81b0 tdf#127806: RTF import: use shape dimensions for pib picture
If RTF shape contains pib (embedded picture) we should override
any picture sizes by values from shape. Values provided inside
\pict are ignored by MS Word; only shape values matter.

To achieve this we need to know shape dimensions so it's
calculation is moved to earlier step before internal picture
eval.

Change-Id: I99c1af7ba62c343b64b3db734b837ff101483ad8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139043
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-09-01 20:35:28 +02:00
Vasily Melenchuk 599da3fa69 tdf#114769: sw html export: better handling for relative URLs
Usage of INetURLObject makes sense only in case of full URLs,
but once relative one is provided it will contain invalid data.

Change-Id: Icc5e191e2337a3dd9a76c660b1c7709551099a1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138875
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-08-30 09:30:07 +02:00
Vasily Melenchuk 4d6243693c tdf#143703 sw: always assign name for fly section
Previously generated name was assigned only if not in doc
reading mode. But there is no guarantee that it will be assigned
later. Better to insert any name in SwDoc::MakeFlySection_() and
later it can be overwritten, but fly will definitely have
any unique name.

* Some test failed because GraphicImport_Impl::applyName() overwrote the
  name with a different generated one.

* This breaks chaining of VML shapes, see test testTDF87348.

  The code introduced in commit 091fe76b63
  in DomainMapper_Impl::ChainTextFrames() breaks if the text frame
  already has a name; it's a bit confusing which names there come from
  the file and which come from the API, and it also mixes 2 different
  cases of VML chaining and DrawingML chaining that look like they
  should be using different data.

* This also breaks moving flys anchored at-char in flys into them in
  SwXText::convertToTextFrame(), see ooxmlexport13 testFlyInFly.

  This kind of worked by accident before: the fly is copied and then the
  original deleted, keeping the same name (with help of
  SwDoc::mbCopyIsMove); with no name it would compare the SdrObject
  pointer, which is different for the new copy, now the name is the
  same.

  Fix this by only moving flys anchored at the edge of the selection
  back inoto the body; it turns out that Word actually supports at-char
  anchors in text frames, but only if it's a VML shape or Compatibility
  Mode or whatever; i wasn't able to do it in a document created from
  scratch.

  This is a bit tricky to ignore the nodes added for floating tables as
  seen in ooxmlexport10 testFloatingTablesAnchor.

* Another change is required in SwDoc::SetFlyName() because of
  testTdf127732, as it would rename a frame named "Frame1" to "Frame2"
  when called to rename it to "Frame1".

* Some tests failed because after MakeFlySection_() assigns a name it is
  immediately unconditionally overwritten; replace that with asserts

Change-Id: I46752a4413ba3a9e981eccd1e153b3aaf8053781
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127556
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-08-03 17:57:50 +02:00
Vasily Melenchuk a7d9837a8a tdf#148360: sw: do not ignore list label followed by
...even if numbering is empty.

Since this is a core change to avoid impact on other formats
(mostly ODT) it is implemented as a new document setting.

Change-Id: I35e1cec97eb40f9f3411e3ba74cb553bd8afac59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134989
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-08-02 15:59:35 +02:00
Vasily Melenchuk 772f7a2dc3 tdf#150161: senddoc: use corrected name url: original can be a file path
...and in this case file name will be not parsed and --attach-name
parameter will be empty. This leads to missing file name of
attachment. In case of Thunderbird it is not a big problem,
but Outlook does not want to attach .tmp files: it is "potentially
unsafe attachment".

Change-Id: I7c2f696391e1183211a169b08004c6668771f288
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137480
Tested-by: Gabor Kelemen <kelemeng@ubuntu.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-07-27 14:27:03 +02:00
Vasily Melenchuk a4ab155ae1 tdf#149313: DOCX import: improved conditions for removeparagraph
Quite complex conditions to define if current paragraph can be
removed for document were forcing to keep paragraphs after page
break with only section definition. Usually these pars are removed,
but since tdf#103975 fix they were kept.

It looks like to resolve that problem will be enough to ensure
current break is a column break: they are bit different and
processed in a different way unlike other break types.

So this condition part instead of "do not remove par with section
info after any break" it is right now "do not remove par after
column break".

Change-Id: Ib6290dc6254430883a598bef3ecd1f7ab7063922
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135969
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
2022-07-12 21:16:48 +02:00
Vasily Melenchuk e4e03e79fa tdf#149200: docx export: transparent color fix
If there is no color value we should not also try to write
transparency information: otherwise w:srgbClr will have no
parameter value and MS Word won't open such documents.

Change-Id: Id67f174c5ae9aadf90ae54c126aef9a43ff3ba17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134945
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-30 11:52:44 +02:00
Vasily Melenchuk 02f53bd612 tdf#148132: Revert "n#758883 dmapper: paragraph-level..."
Seems original problem is no longer reprodicible with recent builds
but ovewriting of numbering style params with inline values leads
to another problems.

Removing this mechanics do some impact on RTF filter: it tries to
modify numbering styles, so this was also corrected. It is not ideal
yet but looks better in support numbering char properties different
from paragraph ones.

This reverts commit 2123ede032.

Change-Id: If8c79d6191de13b2f09c128b59d17efcfdb1a4ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133877
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-05-19 11:58:24 +02:00
Vasily Melenchuk 198381eb32 tdf#148455 docx import/export: improvements to lvlOverride
On save LO was just emitting w:lvlOverride to actual level
where override does happen. But MS Word won't accept override
for next level if there are no overrides for previous ones.

For example, if we are overriding level 3 we should also emit
empty lvlOverride for levels 0-2.

Provided fix did cause some problems on DOCX import: overrides
were applied to current level, but in this context current !=
actual level where override did happen.

Change-Id: Ia00dd9a5990f7f122027e8126f411642c32da189
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134411
Tested-by: Jenkins
Tested-by: Gabor Kelemen <kelemeng@ubuntu.com>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-18 14:59:58 +02:00
Vasily Melenchuk d45315c8eb tdf#142840: doc export: use BookmarkToWord() for hyperlinks
Inernal hyperlinks to bookmarks should not contain spaces. This
is not required for RTF or DOC: MS Word is okay with spaces there
(unlike in DOCX). But since we are replacing spaces in bookmark
names we should do this also in links to these bookmarks.

Change-Id: I7a3e530817572ed53032c2be1ad96f8e8498bac3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133590
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-12 03:27:45 +02:00
Vasily Melenchuk 3a05acb8f0 tdf#148515: RTF filter: do not use char prop defaults for tables
During deduplication of table row (when nStyleType == 0) we should
not deduplicate character properties against default style: this
leads to invalid default settings for table rows/cells.

Attempts to do so are already made during \pard processing when
default style is checked if it is paragraph style. But this is
not enough: style definition can contain paragraph and character
properties as well.

Change-Id: If520c5a248897728b7de08a017136ca1a01a5f13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132943
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-04-27 00:56:10 +02:00
Vasily Melenchuk 7678e7ed88 rtf filter: reduce memory allocations count
RTFValue in most cases contain only one value: either num, string,
picture, etc. No reason to allocate all of them in the same time.

RTF filter should became faster and consume less memory, however I
did not made any measuremets.

Change-Id: Ic12a941ce774b9066d7c57b38139af07851ac7b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131720
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-26 08:34:55 +02:00
Vasily Melenchuk 8b646cf931 natvis: some extra patterns for SvRefs<...> and writerfilter
Change-Id: I077232d641fee38da0f50cb838091c0fd0787189
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133416
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2022-04-26 07:47:37 +02:00
Vasily Melenchuk a31a7b53c4 tdf#147472: sw: bug in numbering with previous level NONE
Previous fix for tdf#146257 was not complete and was not able to
take care of disabled numebering started just at beginning of the
numbering string.

UI test test_tdf144439_outline with modifications is covering this
situation. No need in extra testcases.

Change-Id: Id17838cec7fb4fb039f9b457b7ee9ad3ab345678
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133124
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2022-04-18 20:07:48 +02:00
Vasily Melenchuk b2b821715a tdf#148551: sw ui: set default format value for Insert Field dlg
My previous implementation was changing current format selection
only for field edit dialog. However it should be initialized also
for insert field dlg. It is not always first element. Instead of
older confusing approach right now there is a switch to set
defaults: it is less confusing IMO.

Change-Id: I189339ba66effc49267004a42345a28892cb693c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132980
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-04-15 18:02:00 +02:00
Vasily Melenchuk 844be7358f tdf#95706: RTF import: tolerant font table parsing
While font name in font table should end with semicolon
({\fonttbl{\f42 Arial;}}) it is not always true and
MS Word is tolerant to it: it still able to parse this
correctly. Seems LO also should not require strict spec
conformance.

So idea of font parsing is changed: instead of inserting
font on semicolon, it is done on next \fN or destination
end. All collected text to this moment is a font name.

Change-Id: I6b41951217442a71fd2ebbfc58a3fc79f6f913db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132686
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-08 11:22:54 +02:00
Vasily Melenchuk 965313b9ef tdf#95706: RTF import: Use fontname suffixes to detect encoding
Font names like "Arial CE", "Times New Roman Cyr" are not special
fonts. They are classical Arial, Times New Roman... And these
suffixes can be used to detect encoding used for RTF text.

Most interesting: for MS Word these suffixes have priority:
{\f34\cpg1253\fcharset161 Arial Baltic;} will have cp1257
and not cp1253.

Looks like compatibility issue came from dark ages.

Change-Id: Ife8e781d5d04c3f6a8c11fcf604357c74bf33055
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132584
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-07 14:29:04 +02:00
Vasily Melenchuk fafadd7aee tdf#148361: docx sdt: cleanup databinding data after inserting
Databinding data is used only for current sdt block. It should
be clean up after usage to avoid impact on next sdt blocks.

Change-Id: I53f47dd655ed027d40eb518784dcae69813e612f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132524
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2022-04-05 16:50:21 +02:00
Vasily Melenchuk e3a996bf72 tdf#139948: docx and rtf import: emulate border in between
Writer does not support border in between available in all MS
formats. Since this feature is missing in core it will be
better to emulate it with top borders than to ignore it
completely.

Change-Id: I4e5a99cde5908066c4bb483136cfe9a1316df53c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132429
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-05 15:50:54 +02:00
Vasily Melenchuk f0c7746e83 tdf#116358: rtf import: "keep with next" also affects table rows
Like in DOCX for RTF there is exactly same behavior for paragraphs
inside cells. They do affect table breaking over the pages.

So:
1) Enable "TableRowKeep" doc setting for RTF documents.
2) Do not ignore \keepn token for paragraphs in tables.

Change-Id: I11e45ca9114c792b8cdbeb77dd51359717129651
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132305
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-31 08:35:57 +02:00
Vasily Melenchuk 9d033508af tdf#148111: docx std fields: use placeholder text for empty data
It is quite unexpected Word behavior: if data source for sdt field
exists but contains empty string it is not used. Placeholder is
inserted instead.

In general behavior is more complex: logic of replacement is defined
by <w:showingPlcHdr> property and results can vary (see testcase).
But LO does not support this property correctly yet.

Change-Id: I2ec8efe05f79a01af5d74d21bfcd05f3b19e3970
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132096
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-03-26 23:02:01 +01:00
Vasily Melenchuk e5f96e2881 tdf#111851: rtf import: fifty shades of grey
Unlike in DOCX in RTF token \clshdngN can represent much more
transitional cell shade values from 0 (white) to 10000 (black).
So we should not match these values strictly but use ranges
instead.

Change-Id: I4e0066e2b79e73cf6fbc3dd773047be8dab2b907
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131931
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-23 09:21:35 +01:00
Vasily Melenchuk 24b5490cb0 tdf#104390: rtf import: init default font for entire state stack
If first document element is buried deep in destinations and thus
deep in state stack (m_aStates) initialization of default font
is very local and will be lost after closing these destinations.

So let's initialize entire states stack with default font if none
is provided istead of initialization just a top element.

Change-Id: I966c282f43b84baece909a4c3cd359cbcd317e63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131906
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-22 09:38:07 +01:00
Vasily Melenchuk 79b5ff92b1 tdf#118047: RTF import: better deduplication for header/footer
Here are two related fixes in one patch:

1. By default current style index is 0, not -1. Due to this we
can assume usage of default "Normal" style during deduplication.
Seems there is no difference in case of no style mentioning in
run or mentioning "Normal" one (\s0), so value -1 looks
unnesesary.

2. During header/footer "substreams" processing StyleTableEntires
was not reused in new domain mapper impl instance. So deduplication
did not work well.

2a. To avoid copying of whole StyleTableEntries between instances
it is stored as pointer in domain mapper impl.

Change-Id: Id003d35554e9b43186238920d9a6373452095121
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131899
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-21 15:58:54 +01:00
Vasily Melenchuk 494020efe6 tdf#131234: RTF import: extend default char props list
There are much more character attributes should be applied
wth default values if style contain them, but they were
not mentioned in current run.

These are obviously not a complete set yet, but most common
ones are included.

Change-Id: Ide52245bc98628febc2f3bd2e25166f0dcdf35cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131853
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-21 08:36:40 +01:00
Vasily Melenchuk bcede3c0ed tdf#146851: sw: even numbering=None is still a numbering
Text node containing a numbering rule with numbering format
with SVX_NUM_NUMBER_NONE is still a numbering: it will display
prefix, suffix and other numbering properties.

Change-Id: I52077824b4a1db2e9220701fdd514670490a59db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131410
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-03-16 04:43:27 +01:00
Vasily Melenchuk f50a8f1d88 tdf#146851: writerfilter: do not recreate list levels on override
AddLevel() can be called on w:lvl and on w:lvlOverride. But if
we have level override and some extra level definition level is
recreated and override information is lost.

Change-Id: I6f1b9b50bdd3410b4ae2d403e760e4d6df5677d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131304
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-03-16 04:42:59 +01:00
Vasily Melenchuk 8c94a17e40 tdf#144563: remove final dot in cross-references to paragraph
It looks like in cross-references ending with dot (".") one last
dot is removed in case of MS Word. This is not a true for any other
suffixes after numeration.

Change-Id: I554e62cf45e643bf27823df5344e1689b5b6ae54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131254
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-03-12 18:21:17 +01:00
Vasily Melenchuk 96e1be1154 tdf#146917: docx import: better support for style with num reset
When paragraph style is disabling numbering defined in parent
style we should apply margin properties (like we already do
in other numbering cases), but we should include only properties
from styles not affected by numbering. In other words, only
styles without w:numId are used.

Unittest was extended to cover different combinations of this
situation.

Change-Id: Ic19e00fcfe16b2357cdfe763b4f969cc63122e89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129701
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-02-11 01:16:05 +01:00
Vasily Melenchuk 42c5506a9e docx import: right margin was not respected for para with list
If paragpraph has list defined somewhere in styles and right
margin defined in current style this margin was overriden with
older value from parent styles.

Change-Id: Ic0a2e9a1ce5f77b9ef38c549a62f1494c050982c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129595
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-02-09 00:54:56 +01:00
Vasily Melenchuk 19bca24486 tdf#126287: docx import: use defered linebreak
In some cases when we have combo linebreak, endparagraph and
end section at very bottom of page, MS Word does ignores linebreak
to avoid empty page with same section and lonely end paragraph mark.

With defered linebreak we could simulate and ignore such linebreaks
during import.

Change-Id: Ie6ee4c0990ee1c2e853691a76953c83191664e43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119709
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-02-07 21:20:15 +01:00
Vasily Melenchuk 87fe449c4c tdf#140020: Disable also menu File->SaveAll for docs with LockSave
If LockSave attribute is applied, docs with it are not affecting
File->Save All menu item: these documents are not enabling this menu
and also not saved during this process.

Change-Id: I00bcd251fccfab3f13cb42c20ccb61b54ab49346
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128650
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2022-01-21 09:10:49 +01:00
Vasily Melenchuk f455927415 tdf#140019: Revert "Don't disable "Send doc via email" ..."
Locked export should also disable ability to send document.

This reverts commit b9930d0d05.

Change-Id: I3b7b423c0e17a59872065ec7ceadbaf1cda45ccc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128550
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2022-01-20 09:13:11 +01:00
Vasily Melenchuk f0ad6ec2a2 tdf#145059: sc: always write dxf node for color filter for XLSX
If there is no dxf reference to color filter (for example if selected
color is not in range of available colors for current range) Excel
is not able to show color filter correctly: it is not marked as used
filter, no ability to reset, etc.

Change-Id: I65378ddd6f8f8233cda147ff9dcd28f455a58225
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127745
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-06 21:25:18 +01:00
Vasily Melenchuk 923665ac52 crashtesting: set document reference only once
For SdtHelper we need to keep valid reference to main document
(in our case first call), not to any of substreams like header,
footer, etc.

Change-Id: Id9d99c1a9bff9a3392eea4cc6e2abe774e5868d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127672
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-12-29 12:36:30 +01:00
Vasily Melenchuk bf2b46aa15 tdf#146257: sw: better handling for list numbering = NONE
Previously during refactoring were lost some corner cases with
some level having disabled numbering. In this case LO should
strip useless delimiters up to next level.

For example, if second level has disabled numbering, third level
should look like "1.1", but not "1..1".

Change-Id: I259a16b456f51bc76d5c8360974d0acadfc36776
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127517
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-12-27 15:47:21 +01:00
Vasily Melenchuk c38dbafe0f tdf#104823: unittest
Ensure reading and writing to datasources

Change-Id: Idbc907a21fe3b881d1b835ed0e8c795c4ea36863
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127311
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-12-22 17:42:09 +01:00
Vasily Melenchuk b5c616d10b tdf#104823: support for sdt plain text fields
This is a squashed commit containing set of changes:
* Create a input field from sdt text block.
* Advanced support for reading field data from data bindings
  which can point to custom xml or properties xml. For this
  XOOXMLDocumentPropertiesImporter idl interface was extrended
  with extra getterrs to get properties as xml dom elements.
* Support for exporting of this feature back to docx. For this
  some extra parameters for sdt block are kept in newly introduced
  grabbag for input fields. If field does not contain grabbag it
  being exported as before (FILLIN or whatsoever), otherwise
  sdt block is counstructed based on data from grabbag.
* Basic support for updating custom xml values back into
  custom xmls with usage of xslt transformations. To achieve
  this extra parameters were introduced to XXSLTTransformer:
  now it is able to support in-memory transformation stylesheets.

Some unittests were corrected: since sdt plain text edit area is
a field located inside paragraph in outout corresponding sdt is
also located inside paragraph (instead of Word's approach with
paragraph inside sdt). Seems this is not critical.

Change-Id: I1a73ef300db3619804f7adf18579bea708764c14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127015
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-12-20 00:16:12 +01:00
Vasily Melenchuk be172e5a93 tdf#104823: basic support for reading field data from databinding
Change-Id: Ie45eb18205c1c54a631303b45887e54e456b6d5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125550
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-12-18 15:54:11 +01:00
Vasily Melenchuk 41a9ff8d9e sw: support for other sdt attributes roundtrip in datepicker
Word Control Field with datepicker is implemented with LO datepicker,
but during this conversion we lose some field data, like control
color, data mapping, etc. This data is already retrieved and stored
in grab bag, so we need just to keep this grabbag in field and use
it again on export.

Change-Id: I6af8204fe1a7d2f9081d83372a6786b2f86260d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125486
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-12-02 21:16:01 +01:00
Vasily Melenchuk fe1da0ce2e writerfilter: extend SdtHelper for better support control types
There is much more different controls which must be supprorted
in future. So approach with isInsideDropDownControl() and
validateDateFormat() is not sufficient. Use enum to determine
and store control type.

Change-Id: Ibea7fde117c059053195be213a3ae821644f277c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125471
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-12-01 13:33:15 +01:00
Vasily Melenchuk 42c6e2eb52 docx export: preserve spaces in field instructions
MS Word is putting spaces between field mark and field instruction
text. Writer preserves these spaces, but without xml:space="preserve"
they are not displayed by Word later.

Change-Id: I480e6febf0ee278b56e9dfc6e0430c5fd5bdfd71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125875
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-11-29 12:57:01 +01:00
Vasily Melenchuk 5f3af56b2c sw: refactoring for docx sdt blocks output
Previous approach with almost duplicate storage and processing
for paragraph-level and run-level sdt blocks was very bulky.
Especially this became visible once supported std elements list
start to grow.

Paragraph-level sdt block and run-level sdt block data are almost
identical, so they can be kept in one standard class
(SdtBlockHelper) and use the same methods for collecting data
from grabbags and writing to output without passing huge amount
of parameters.

Change-Id: I4e1183eddf20317e954cb8aca72e97a4fc45ac68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125372
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-11-29 11:42:51 +01:00
Vasily Melenchuk 7db38a496a tdf#137466: docx: support w:placeholder & w15:color in w:sdtPr
Content controls in Word can contain some other elements which
are not supported by Writer. Put them into grabbag and write
back to DOCX on save to avoid losing quite sensitive data.

Test testSimpleSdts is modified: testcase is actully containing
4 sdt elements with ids in input and output.

Change-Id: I1f9addd03ed828bf375ccac5188a004f011e8a0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125271
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-11-29 11:41:53 +01:00
Vasily Melenchuk 75a49947c2 tdf#81507: word content control support for w:multiLine
<w:text multiLine="1"/> is now supported for import/export
to DOCX. Like other content control items it is stored in
grabbag.

Change-Id: Id6f1aa0072dc5db980d0fa43cab4b38a0aa047fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125024
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-11-18 08:42:43 +01:00
Vasily Melenchuk e140caf263 UITest: refresh fields for test to ensure we check calculated value
Change-Id: I696d24ba087c2e7d19e9818f4f653e09eca7f32e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125222
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-11-15 14:59:20 +01:00
Vasily Melenchuk a4485bd8e0 tdf#145610: lists should not have includeUpperLevels < 1
Unlike its name, this variable stores *total* amount of levels
to includes, so during conversion even empty list format to
prefix/suffix/includeupperlevels we should keep last one above
zero so list even in future will not have issues with levels
to display.

Change-Id: I4992c1ac0194f381df9f7b965ecdb2d688892b30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125022
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-11-13 09:58:46 +01:00
Vasily Melenchuk e0b41fcb56 tdf#144668: docx export: simpler way to create lvlText in numberings
Oldr approach with populating ListLabelString with some predefined
values and than replacing them by placeholders is not so good. It
can lead to collisions if we use numbers in format string.

Anow with support of list strings in core we do not need this: it
is enougth to replace LO placeholders %1%, %2%, ... by MS binary
placeholders \0, \1, ...

Additionally added support for list level initialization in DOC
import: that case was still setting just prefix/suffix leaving
list level uninitialized.

Change-Id: Ia85551f46b4e229dea93c663459ec1a8715c8a23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124326
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-05 10:54:47 +01:00
Vasily Melenchuk b66ed4cb37 tdf#145215: docx: do not initialize prefix/suffix and include levels
On DOCX import we do not need to provide prefix, suffix and included
levels: these values are calculated in SvxNumberFormat out from list
format. Moreover these values are incorrect and do not correspond
not to DOCX data nor to internal writer representation of list level.

Change-Id: I91ec9de679e67056ba3746f2e1a0bd923532d76c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124090
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-10-23 21:28:25 +02:00
Vasily Melenchuk da5580369b tdf#144907: sw ui: allow closing of "Fields" dialog
In some cases (described in task) dialog is not closed.
This is happens due to not delivered request to
SwTextShell::ExecField(). So we could just close dialog
explicitly, if Execute() action did fail.

Change-Id: I1c712295a21037bc8bb28e2a97e750299b41250c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123059
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-10-06 12:08:08 +02:00
Vasily Melenchuk 54cc6c21c8 tdf#144439: generate list format string on level change
Changed values for included upper levels should cause
generation of new list format string.

Same applies to outlines editing.

Change-Id: I90e19d6b5169f68c83ae3e55ec41b9016623d8ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122590
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-10-04 15:30:38 +02:00
Vasily Melenchuk e6bf21d2d5 tdf#144578: numbering: generate include upper levels for UI
In spite of used list format in ODF for UI we still need to
show prefix/suffix (already was there) and included upper
levels (done in this patch) for correct visualization of
level properties.

Moved initialization of ListLevel to later steps to avoid
overriding of generated values for prefix, suffix and
IncludeUpperLevel by some invalid values.

Change-Id: I5d132426c06021ed526d16fb09276523105aa7b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122686
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-10-04 15:29:45 +02:00
Vasily Melenchuk 66a7f8a49d tdf#144609: numbering "None" should still show prefix/suffix
Unlike it was implemented in tdf#143605, prefix and suffix
should be displayed anyway, we do not display only numbers.

Moreover tdf#143605 did accidentally fix tdf#135164
in a invalid way. So this patch is also providing a better
fix for it: untittest is already created and failing without it.

Problem in tdf#135164 is inability to distingush missing level
text (bullet char in given case) and empty ("") one. In first
case we should use abstract level definition. In second - not.

Change-Id: Ica3a714d22de4d2f14ebbcb12f0e1311dbc9b801
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122609
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-10-04 15:29:07 +02:00
Vasily Melenchuk b7a425d48c tdf#142578: xlsx export: use continuous numbering for dfx nodes
Since all dxf records are stored in one place it is required
from color filter and conditional formatting to use continuous
numbering for dxf structures to avoid id collision.

Change-Id: I91146e34d462d812b480db137cda522f6db7ef8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122915
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-10-01 17:38:53 +02:00
Vasily MelenchukandSamuel Mehrbrodt 6f908b4837 tdf#143104 Fix xlsx import/export of color filter colors
1. In XLSX filter colors are always stored in dxf as foreground
colors, so Calc should keep them, if possible. So practically
use only one color during import.

3. On export we need to distinguish type of filter, this is done
with cellColor=0 or cellColor=1 attribute of <colorFilter>.

4. Since p.1 there is no need to keep on export separate dxf
structures for fg and bg colors: we always use only foreground
color for color filters.

Co-authored-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>

Change-Id: Iacd352ae46bf84859dc15ee695b6dc63240afe7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122593
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-10-01 14:00:46 +02:00
Vasily Melenchuk 732b3fd5bd tdf#144437: rtf export: bookmark position is written to current run
Bookmark was written to not current position thus did appear not at
desired place inside paragraph.

Change-Id: I917f74c95666efd38c5befeb927b75783915b2e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122722
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-10-01 12:09:02 +02:00
Vasily Melenchuk bf4cb13c7b sc: colorfilter dangling pointer fixed
Upper call to aParam.RemoveAllEntriesByField can invalidate
pEntry, making further calls to pEntry->SetQueryBy* illegal.

Anyway at this branch we are disabling color filter, so this
is not required.

Change-Id: Ia595649975b659d28056ba3f3658c306e63088f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122822
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-10-01 09:02:46 +02:00
Vasily Melenchuk 089c7d05fd tdf#48622 add border line thickness predefined values in UI
According to multiple reports border line width selection will be
more intuitive with some predefined values. Here is an implementation
of this proposal: line width can be selected from combobox from
predefined values (thin, medium, thick and custom). Classical spinner
is right now hidden unless custom line width is selected.

Change-Id: I87a6237335b79a5f5b63e109360e1ea8f12ae071
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114709
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2021-09-27 17:15:00 +02:00
Vasily Melenchuk daa1469e3e tdf#123642: keep last bookmark at the document end
In some cases DomainMapper_Impl::RemoveLastParagraph() can also remove
last bookmark from real last paragraph. This does never happens
when we use xParagraph->dispose(), but pretty always during older
way with xCursor->setString(OUString()).

Unfortunately without deep refactoring of redlines, bookmarks, etc.
I see no other way to avoid this removal except given hack which is
trying to store last bookmark and if it did disappear restore it.

Some existing unittests were adjusted: corresponding original DOCX
files did contain final bookmarks not taken into account by the code.
In some cases test code is modified, in some just removed final
bookmark in DOCX: such multi-format tests as in ooxmlfieldexport.cxx
will be more identical to RTF & DOC variants.

Change-Id: Ie9948b58cda705a0b85fa8e5e08b72fbb7d682b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121409
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-09-13 00:36:44 +02:00
Vasily Melenchuk 14d299f8f1 tdf#126426: support for hyperlinks in TextParagraphContext
Usually hyperlinks are processed by TextBodyContext, but
for grouped shape we accidentaly gone into TextParagraphContext
It has almost all possibilities to process txbxContent,
but not hyperlinks.

Additionally some hyperlink char attributes (color and underline)
can expand to follow up ordinal text. Additional small hack applied
to avoid this.

Unfortunately this is not a final solution: such document fails
roundtrip and hyperlinks are lost after saving to DOCX.

Change-Id: Ie954f53696bd872cb1f59cb586fb55f6cd7c73bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121172
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-09-10 12:27:14 +02:00
Vasily Melenchuk 1fd9116fbc tdf#143990: writer: default value for SetIncludeUpperLevels is 1
Same as in e08fba90 for tdf#143858: zero for SetIncludeUpperLevels
has no practical sense, since actually this value is amount of levels
to display. Default and minimal value is 1 (current level), zero
used only in cases when there should be no numbering.

Change-Id: I303386339a9e13944e11d0287c933523c7410b6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120863
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-08-24 12:16:44 +02:00
Vasily Melenchuk 37dd6e18f5 tdf#143858: sw: default value for nInclUpperLevels is 1
SvxNumberFormat::nInclUpperLevels (matches text:display-levels in ODF)
bit incorrect in its name: is counts total amount of levels to display,
including current level. So value "0" seems have no sense: display 0
levels in total?

In UI you can't select less than 1 level and ODF standard (19.797)
using 1 as a default. This looks plausable.

Change-Id: I596386c7b3cc4370910cd0ff6e927e501179fbdf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120458
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-08-17 16:53:39 +02:00
Vasily Melenchuk a72f2dcf73 tdf#129270: sw: do not copy list level on paragraph cut
Current list level (RES_PARATR_LIST_LEVEL) is initialized
before, but current value can overwrite it with invalid
in given context. So we could have mismatch of outline
style (which are not overwritten) and actual list level.

Change-Id: Ibf34a6f35b922493c4a1477326ea6c1599b4938f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120212
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-08-12 14:10:46 +02:00
Vasily Melenchuk 29e5fad7ed sw: removed unused NO_NUMLEVEL
NO_NUMLEVEL is not used in code for a while.

Change-Id: Ia39879723455dbe5cc13b20042e930088618588d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120113
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-08-10 08:56:00 +02:00
Vasily Melenchuk d1f1f546b2 sw: numbering rule is not constructed for numbering type "None"
Previously during refactoring this condition was lost. And it
is possible practically that we have all format for numbering
(prefix, suffix, format string, etc) but numbering is disabled.

Change-Id: I0c8ab446753308ad80b8d133824a936dacf6cc82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120082
Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-08-08 23:19:30 +02:00
Vasily Melenchuk 6e879d5f14 tdf#99932: sw: fix for invalid anchor location for FLY_AT_CHAR mode
In such case anchor position depends on LastCharRect which can be
invalid because of happened frame movement, resize, etc.

Change-Id: I3d3c6318ee1ce5f4043e21ab091417d283c4260c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120059
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-08-05 18:34:09 +02:00
Vasily Melenchuk 4edf3a964e sw: undo/redo for outline modification
Outline changes done via "Tools"->"Chapter Numbering" were
not tracked by undo/redo before.

Change-Id: I764dda526d2b17ecbb62eca0d6a9fb0b368c4a69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119405
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-08-05 18:33:54 +02:00
Vasily Melenchuk b67b3e2be0 sw: use followby parameter of outline in Chapter field
When Chapter field with format "Chapter number and name" is used
it does not insert any delimiter between number and name. Best is
to use outline/list property LabelFollowBy.

But since it is done inside field we are limited with supported
characters, so practically only space and nothing are correctly
supported. Tab and newline are replaced by space.

Change-Id: I4583b7051ae5ad963132980443fa70b5a19354e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119428
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-07-26 15:21:39 +02:00
Vasily Melenchuk 1da91cd552 sw: undo/redo: change undo id for numbering
Instead of "Reset attributes" new undo id is "Apply attributes". Seems
less confusing when modified numbering rule is appled.

Change-Id: I0bad38475363d6e0af01597271720d71aca7722c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119401
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-07-26 15:19:15 +02:00
Vasily Melenchuk 965636121c tdf#143483: sw field edit: improved selection of format
During selection of used field format do this after list
is initialized. Otherwise selection can be lost during
further treelist filling.

Removed ancient hack which was trying to select at least
something in field format list: it is incorrect and does
not cover all possible fields/formats. It is just hiding
any potenial initialization problems.

Change-Id: Ibbbdd1e9a3436fec37cc49c11e6e235e8afcf4ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119341
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-07-26 15:18:56 +02:00
Vasily Melenchuk d44730148a tdf#143424: support for "Chapter number without separator"
If LO is using list format strings (this is default behavior since
aa5c6d12) it was not able to show just numbering without all formatting,
as it used in some fields.

Change-Id: Ib4695b8e1c2d7a451522c7e04af2216d16aceefe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119309
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Tested-by: Jenkins
2021-07-26 15:18:16 +02:00
Vasily Melenchuk aa5c6d1275 new ODF numbered list parameter loext:num-list-format
Instead of style:num-prefix and style:num-suffix new list format
is much more flexible for storing list multilevel numberings.
Now it is possible to have not just prefix/suffix but any random
separators between levels, arbitrary levels order, etc.

Internal LO format for list format is changed: instead of placeholders
like %1, %2, etc we right now use %1%, %2%... Reason: for ODT documents,
having more than 9 levels there is ambiguity in "%10": it is "%1"
followed by "0" suffix, or "%10"?

Aux changes:
* removed zero width space hack: since format string is always defined
this hack is interfering with standard list numbers printing
(see changes in ooxmlexport14.cxx, ww8export3.cxx tests)
* changed cross-references values to lists: they are now including full
list label string: previously this was bit self-contradictory (see
changes in odfexport.cxx and check_cross_references.py tests)

Change-Id: I9696cc4846375c5f6222539aeaadbca5ae58ce27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117156
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-06-29 00:48:36 +02:00
Vasily Melenchuk 93605ab85a Use containerToSequence for Sequence of dynamic size
Instead of set of conditions to detect size of resulting Sequence
this should be shorter and cleaner.

Change-Id: I52c87ecf3f21f40a52be5ac180a14499f4512072
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116772
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-06-08 10:49:23 +02:00
Vasily Melenchuk 3ffc5df4e1 sw: WriteLong/Short -> SvStream::Write[U]Int[16|32]
Change-Id: I1c09a3bbf301166ccab16ecf0b57f22a335e0791
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116778
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Tested-by: Jenkins
2021-06-07 13:19:16 +02:00
Vasily Melenchuk 726d0a2d54 tdf#137199: sw: convert list format string to prefix/suffix for ODF
Since internally LO is able right now to use list level format strings
and prefixes/suffixes only for backward compatibility, there is a need
for conversion from format string (like "%1.") to prefix ("") and suffix
(".") still used by ODT.

Change-Id: If4b459e1b25b7f0ce511e6ac2de0824bb2c43d05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116288
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-05-28 09:39:34 +02:00
Vasily Melenchuk a4e7df83fc tdf#132752: docx import: improvements for first line indent in lists
As far as I see, Word is using lists with id=0 and no list definitions
to reset list numbering used in this paragraph. At the same time Word
is still using some of default list properties. For example in this
scenario parent style has defined first line indent, but in paragrath
it is overwritten by "not existing" list=0 without definitions.

To this moment I know about only first line indent behavior, but
probably some other properties are also affected.

Change-Id: I344c907bb7a7b83a91f5727e13ad184fb44137b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115795
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-05-25 11:42:14 +02:00