And introduce GetTextWidth / GetTextHeight variants returning double.
It allows to avoid premature rounding.
At least in one case - testTdf145111_anchor_in_Fontwork - it allowed
to make the test DPI-independent (at least in my testing on Windows,
using 125, 150, and 175% UI scaling).
Change-Id: I973d2c729ec6bb7114b4f99b9027f1ead7c1d061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166237
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
and flatten it a little
Change-Id: I3377f832658c504a2541c6994f7386adad06b0e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166321
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
I was concerned that I might override highlights
set in numbering.xml but in that case
pFormat && pFormat->hasItem(RES_CHRATR_HIGHLIGHT)
so pCleanSet no longer hasItem.
(see num3n.docx and TestDoc_highlight2.docx)
Note: must use Word 2010+ to see numbering.xml highlights!!
This is strictly a visual thing. Unit testing has traditionally
used magic tile rendering x,y positions to check the color,
which seems completely untrustworthy.
Change-Id: I026252f127107e4782d08f72bfd5e2a412142111
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166303
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Ported two more SDK examples ChartInDraw and ChartInWriter from Java to
Python.
ChartInCalc and helper classes which contain additional helper methods
were ported in a previous patch.
Change-Id: Idffa0c07282dfc2c0f09ec5a9959f1db34a1d9a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165088
Tested-by: Jenkins
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
speed up the matching of duplicates in CellAttributeHelper by using
std::set and partial sorting by name
Takes my time from 33s to 6s
Change-Id: I06376c1e253981cb5a3020142d24fa5776513d4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166262
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
...which are needed at compile time (the emscripten::class_<T> ctor always
records the address of emscripten::internal::raw_destructor<T>, even in cases
where it never calls it; and raw_destructor internally calls delete, but the
dtor of the UNO interface types is protected) but not at runtime (as those UNO
interface types are only accessed through css::uno::Reference smart pointers)
Change-Id: I09e4f258f8dfc0fc53c0fe7210c7f709d86be176
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166304
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
since we assign it from a temporary OString.
No idea why this hasn't caused a problem already.
Change-Id: I5480fb2ab5d1e07212ad804f99223946abf5a6c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166297
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Linking Executable/soffice.html kept warning about
> warning: JS library symbol '$allocateUTF8' is deprecated. Please open a bug if you have a continuing need for this symbol [-Wdeprecated]
> warning: deprecated item in EXPORTED_RUNTIME_METHODS: printErr use err instead.
> em++: warning: warnings in JS library compilation [-Wjs-compiler]
printErr had been introduced in f090004c5f "WASM
adapt link and debug flags" and allocateUTF8 had been introduced in
ce60a3dd4d "Add LOKit functions and whitelist
export for it to WASM", but in both cases no code seems to ever have made use of
either of those two methods, before or after.
Change-Id: I1e81ca6ddad748d91653f709c272328cc8f2b679
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166296
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
The existing code had two issues: For one, e.g. calling a function that
returned a null interface reference mapped that to JS null, while querying an
object for a non-supported interface via `new css.uno.X...(y)` mapped that to
an "empty" JS object instead. (So checking for a non-null reference needed to
be done as either `x !=== null` or as `x.is()`, depending on context.) And for
another, while calling $is() on a non-"empty" object worked fine, it failed on
such an "empty" object (as the Embind internals of that object lacked the $$
property).
So change the querying mechanism from the `new css.uno.X...(y)` constructor to a
`css.uno.X....query(y)` function call syntax, which now returns JS null when
querying for a non-supported interface. (And drop the broken $is method.)
Change-Id: I8fa488ab2892423f2a461d9b72db47e1d4df3b8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166255
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Unfortunately the actual computed margins are not stored in text
formatting data structures so are only available directly from
SwTextMargin.
Change-Id: Ia7ce5e148194a55b5d9874ed112aaa977ed16c7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166258
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Select A1+A3 in Calc, copy, try to paste in B1, nothing happens.
This is because lok::Document::getSelectionTypeAndText() for a Calc
document ends up in ScViewFunc::CopyToTransferable(), which only handles
the SC_MARK_SIMPLE* cases.
Fix the problem by implementing support for SC_MARK_MULTI, similar to
what ScCellShell::ExecuteEdit() does in the SID_COPY case, which also
calls CopyToClip().
Keep the test highlevel as the Calc shell doesn't seem to have an easy
function to do the same as the Ctrl-click on a cell without duplicating
lots of code in the testcase.
Change-Id: I641d9db95ca391a4f39d96aeeb33422129262288
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166279
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Excel refuses to open a file if there is no sqref specified
<protectedRanges>
<protectedRange name="corruptFile"/>
</protectedRanges>
In this case, import failed to import sqref="10:131".
A follow-up commit avoids exporting these shorthand ranges.
I don't see much point in trying to create a unit test for this.
(I assume protectedRange is simply round-tripped
because I doubt LO has working support for protectedRanges.)
commit 9cee6a4563
Author: Eike Rathke on Thu Mar 20 10:16:50 2014 +0100
added ScEnhancedProtection to ScTableProtection
Change-Id: I97ef1ee801898bdcace067d62890c4ce0e7cf1d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166265
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Justin Luth <jluth@mail.com>
Although it is completely NOT normal to put any rPr's
in the style's pPr (since they normally just go
into a stand-alone rPr), MSO is able to read and apply
those - while LO just ignored them (as misplaced properties).
It seems harmless to me to import it this way as well.
make CppunitTest_sw_ooxmlexport14 \
CPPUNIT_TEST_NAME=testHighlightEdit_numbering
Change-Id: Ie4a6c4c91a8214f40e34dc58c47b0bb9381bac1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166189
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
The check for the property being set was wrong: the state in a parent
style may be DIRECT_VALUE but a derived style may have a list style set,
which effectively overrides the ParaLeftMargin and ParaFirstLineIndent.
Fix this so that the compatibility override only happens when required.
(regression from commit 7cf5faec6f)
Change-Id: I6c8ca493df946afcb48a63c01c132620bcd7b390
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166257
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
to make it obvious we are dealing with nasty global state here
Change-Id: I7f2193600a6459c3a5cd51fece8151ac46aebe7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166242
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Make XLOOKUP function able to search for empty cells.
Change-Id: Iefa71b938fe658a59d52e0bf605dbef7a62742c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166263
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
This avoids premature rounding in TextLayouterDevice::getTextBoundRect.
The box in D2DWriteTextOutRenderer::performRender needs to be expanded
to allow room for the line width (which now will be guaranteed on all
sides; previously, the rounding could happen to give no room on some
side, even prior to commit 8962141a12).
Fixes some lines partially cut off in smaller text (or zoomed out).
Change-Id: I07335136021f894cf045363b4d736bfab06c64d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166236
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
There is a special handling of CrossRefBookmark, which has no end position
in the document model, but must span the whole paragraph, and end position
is generated explicitly.
Since commit 1d7ce42148 (tdf#159438: when
there's no frame, close previous bookmark first, 2024-01-30), end marks
of an index are sorted before start marks of the same index, with the
expectation that start / end marks represent non-empty span. Dun in case
of empty paragraphs with a CrossRefBookmark, both start and end mark were
emitted into the same index, and the new sorting resulted in the wrong
order of the elements.
Fix this by checking if the start index is less than node end, and don't
handle CrossRefBookmark specially, if the check is negative. This writes
a single text:bookmark, instead of a text:bookmark-start, followed by a
text:bookmark-end.
Change-Id: I533c4f7814edddc3cf24b1213490f251d60b2273
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166266
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Same as in commit e275726861
(tdf#160593: make sure to use current element's font size for em unit,
2024-04-18) for em.
Change-Id: Id9003c0426a6b373456da1aa1550f7ff07f766a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166235
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(If throwUnoException directly took a css::uno::Any argument, JS client code
would need to create one with `new Module.uno_Any(...)` and call .delete() on
it, but there is no place where it could call .delete(), so make
throwUnoException take two arguments instead and assemble the css::uno::Any on
the C++ side.)
Change-Id: Iae4ae6af804354d5cf752115e272b79d61427440
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166253
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Since commit 690526f95e
(Generalize basegfx::fround for templated return type, 2024-04-14),
an assertion could fail for certain case, like
include/o3tl/unit_conversion.hxx:75: sal_Int64 o3tl::detail::MulDiv(I,
sal_Int64, sal_Int64) [I = long]: Assertion `isBetween(n,
(SAL_MIN_INT64 + d / 2) / m, (SAL_MAX_INT64 - d / 2) / m)'
The problem was unchecked case of empty B2DRange.
Change-Id: Ice9125ea557b73a7fabf64bc1ad9368f503ad525
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166101
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
The note at
<https://emscripten.org/docs/porting/exceptions.html#handling-c-exceptions-from-javascript>
is a bit vague whether decrementExceptionRefcount would only be needed for
Wasm-based (-fwasm-exceptions) exceptions, or also for the JS-based
(-fexceptions) ones that we currently use. (But it does state clearly that for
the latter we need to manually call incrementExceptionRefcount first.)
Change-Id: I7714935607c990385f68730d02e367e70fa0ea03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166250
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
This fixes the error of identical treatment of em and ex in font-size,
which violated https://drafts.csswg.org/css-values-4/#font-relative-length.
The fix uses the fallback of 0.5em for ex, similar to the code used in
SvgNumber::solveNonPercentage. A follow-up should implement the correct
use of "x-height of the first available font".
Change-Id: Id9d581994e158d629d9752299ad93ac7e9fe4cad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166234
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
According to https://drafts.csswg.org/css-values-4/#font-relative-length
em is "equal to the computed value of the font-size property of the element
on which it is used". This means, that for an element that defines its own
font-size, attributes like 'dy' using em refer to the new font-size, not to
inherited font-size.
Change-Id: Ie5a013df99a68edddf466e4c0ee5311f6219fcb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166233
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(main, sub, axis titles) texts properly to/from odf format.
Fix odf export of formatted chart titles. The exported data structure
will look like:
<chart:title svg:x="3.304cm" svg:y="0.285cm" chart:style-name="ch2">
<text:p>
<text:span text:style-name="T1">This</text:span>
<text:span text:style-name="T2"> is</text:span>
.
.
.
<text:span text:style-name="T3">3</text:span>
<text:span text:style-name="T2"> a </text:span>
</text:p>
</chart:title>
Fix import of formatted chart titles. Put the properties and related texts
into the chart2::XFormattedString2 uno objects.
Follow-up commit of:
55e9a27afd
Related: tdf#39052 - chart ooxml: export formatted chart titles
4f994cec38
tdf#39052 - Chart: make characters formatable in editable chart textshapes
--
TODO: chart data point / dataseries labels are handled differently
since those are not editable objects, but that is a completily different
issue.
--
Change-Id: I1842f2c69c132bdf578bb2d354f451cc9d49c63c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166122
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
...now that we have uno_Any get() since 8428368d79
"Improve Embing'ing of UNO Any somewhat"
Change-Id: I06572e1ca152117c5c93a1552e50b1399af84780
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166244
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
* Update helpcontent2 from branch 'master'
to 7e29cad08d812997ae5053444c86edf1c8c971d4
- Use svg icons in Help page
Change-Id: I1418d54df7393321e79706d4885af50e6fdea59b
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/166249
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
* Modify the code so that all connections to MS Access files, both .mdb
and .accdb are made with the provider "Microsoft.ACE.OLEDB.12.0".
* Remove all references to the "Microsoft.Jet.OLEDB.4.0" provider to clean
up the code.
* Leave only one entry "Microsoft Access" in the Connection Wizard, which
would work for .mdb and .accdb files.
* Remove the entry "Microsoft Access 2007" from the Connection Wizard,
since it is no longer needed.
Change-Id: If523712d071199d61e0c994b35291d3a69246ad1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165756
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
the comment when calling MakeCellStyleSheet does not match the
implementation, so make the implementation match the comment.
i.e. if there is an existing stylesheet with that name, just return it.
Reduces load time for me from 47s to 33s
Change-Id: If1bd08baf8515933b87c075d9eef04bc0a125357
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166241
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>