download.lst
| 4
external/harfbuzz/0001-Fix-applying-synthetic-slight-to-glyph-origins-5629.patch.1
| 102 ----------
external/harfbuzz/UnpackedTarball_harfbuzz.mk
| 1
sw/qa/extras/layout/data/cell-vertical-align-middle-in-fly-at-page.fodt
| 35 +++
sw/qa/extras/layout/layout5.cxx
| 18 +
sw/source/core/inc/pagefrm.hxx
| 8
sw/source/core/layout/layact.cxx
| 10
7 files changed, 71 insertions(+), 107 deletions(-)
New commits:
commit 0a22cd7868a887d27503907c1f1edd81aae553cb
Author: Xisco Fauli <[email protected]>
AuthorDate: Wed Nov 5 08:59:57 2025 +0100
Commit: Adolfo Jayme Barrientos <[email protected]>
CommitDate: Wed Nov 5 19:59:04 2025 +0100
harfbuzz: upgrade to 12.2.0
* 0001-Fix-applying-synthetic-slight-to-glyph-origins-5629.patch.1
has been fixed upstream
Downloaded from
https://github.com/harfbuzz/harfbuzz/releases/download/12.2.0/harfbuzz-12.2.0.tar.xz
Change-Id: I61c8edc0286389fe476b9ba84e8eac8f19f2016a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193444
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <[email protected]>
(cherry picked from commit f2557cfaae6e367973101c19f76848ec39a0e0c4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193453
Reviewed-by: Adolfo Jayme Barrientos <[email protected]>
diff --git a/download.lst b/download.lst
index 56989a213696..5a6cffd5ae7d 100644
--- a/download.lst
+++ b/download.lst
@@ -327,8 +327,8 @@ GRAPHITE_TARBALL := graphite2-minimal-1.3.14.tgz
# three static lines
# so that git cherry-pick
# will not run into conflicts
-HARFBUZZ_SHA256SUM :=
e5c81b7f6e0b102dfb000cfa424538b8e896ab78a2f4b8a5ec8cae62ab43369e
-HARFBUZZ_TARBALL := harfbuzz-12.1.0.tar.xz
+HARFBUZZ_SHA256SUM :=
ecb603aa426a8b24665718667bda64a84c1504db7454ee4cadbd362eea64e545
+HARFBUZZ_TARBALL := harfbuzz-12.2.0.tar.xz
# three static lines
# so that git cherry-pick
# will not run into conflicts
diff --git
a/external/harfbuzz/0001-Fix-applying-synthetic-slight-to-glyph-origins-5629.patch.1
b/external/harfbuzz/0001-Fix-applying-synthetic-slight-to-glyph-origins-5629.patch.1
deleted file mode 100644
index ea5f5f4def12..000000000000
---
a/external/harfbuzz/0001-Fix-applying-synthetic-slight-to-glyph-origins-5629.patch.1
+++ /dev/null
@@ -1,102 +0,0 @@
-From 6105bad18730fe05916b8b87903333d804ef8b84 Mon Sep 17 00:00:00 2001
-From: Khaled Hosny <[email protected]>
-Date: Wed, 29 Oct 2025 22:59:51 +0300
-Subject: [PATCH] Fix applying synthetic slight to glyph origins (#5629)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-* Fix applying synthetic slight to glyph origins
-
-The hb_font_t::get_glyph_[h/v]_origins() methods were applying all the
-transformations to the first glyph in the buffer. This shows up for
-vertical text only because h_origin callback is usually unset.
-
-Fixes https://github.com/harfbuzz/harfbuzz/issues/5628
-
-* Don’t apply slant to glyph origin
-
-Per discussion in
https://github.com/harfbuzz/harfbuzz/issues/5628#issuecomment-3459345504
-
-* Disable only font functions that fail
----
- src/hb-font.hh | 16 ++++++----------
- test/shape/data/in-house/meson.build | 1 +
- test/shape/data/in-house/tests/synthetic.tests | 3 +++
- 3 files changed, 10 insertions(+), 10 deletions(-)
- create mode 100644 test/shape/data/in-house/tests/synthetic.tests
-
-diff --git a/src/hb-font.hh b/src/hb-font.hh
-index f7f67af3b..d5626661b 100644
---- a/src/hb-font.hh
-+++ b/src/hb-font.hh
-@@ -508,9 +508,7 @@ struct hb_font_t
- hb_position_t y_shift = y_scale < 0 ? -y_strength : y_strength;
- for (unsigned i = 0; i < count; i++)
- {
-- /* Slant */
-- if (slant_xy)
-- *first_x += roundf (*first_y * slant_xy);
-+ /* Slant is ignored as it does not affect glyph origin */
-
- /* Embolden */
- if (!embolden_in_place)
-@@ -518,9 +516,9 @@ struct hb_font_t
- *first_x += x_shift;
- *first_y += y_shift;
- }
-+ first_x = &StructAtOffsetUnaligned<hb_position_t> (first_x, x_stride);
-+ first_y = &StructAtOffsetUnaligned<hb_position_t> (first_y, y_stride);
- }
-- first_x = &StructAtOffsetUnaligned<hb_position_t> (first_x, x_stride);
-- first_y = &StructAtOffsetUnaligned<hb_position_t> (first_y, y_stride);
- }
-
- return ret;
-@@ -548,9 +546,7 @@ struct hb_font_t
- hb_position_t y_shift = y_scale < 0 ? -y_strength : y_strength;
- for (unsigned i = 0; i < count; i++)
- {
-- /* Slant */
-- if (slant_xy)
-- *first_x += roundf (*first_y * slant_xy);
-+ /* Slant is ignored as it does not affect glyph origin */
-
- /* Embolden */
- if (!embolden_in_place)
-@@ -558,9 +554,9 @@ struct hb_font_t
- *first_x += x_shift;
- *first_y += y_shift;
- }
-+ first_x = &StructAtOffsetUnaligned<hb_position_t> (first_x, x_stride);
-+ first_y = &StructAtOffsetUnaligned<hb_position_t> (first_y, y_stride);
- }
-- first_x = &StructAtOffsetUnaligned<hb_position_t> (first_x, x_stride);
-- first_y = &StructAtOffsetUnaligned<hb_position_t> (first_y, y_stride);
- }
-
- return ret;
-diff --git a/test/shape/data/in-house/meson.build
b/test/shape/data/in-house/meson.build
-index 0da9c1279..a3c87d752 100644
---- a/test/shape/data/in-house/meson.build
-+++ b/test/shape/data/in-house/meson.build
-@@ -64,6 +64,7 @@ in_house_tests = [
- 'simple.tests',
- 'sinhala.tests',
- 'spaces.tests',
-+ 'synthetic.tests',
- 'tibetan-contractions-1.tests',
- 'tibetan-contractions-2.tests',
- 'tibetan-vowels.tests',
-diff --git a/test/shape/data/in-house/tests/synthetic.tests
b/test/shape/data/in-house/tests/synthetic.tests
-new file mode 100644
-index 000000000..4b11a6a33
---- /dev/null
-+++ b/test/shape/data/in-house/tests/synthetic.tests
-@@ -0,0 +1,3 @@
-+@font-funcs-=coretext,ft,directwrite # TODO investigate why these font funcs
fail
-+../fonts/NotoSans-VF.abc.ttf;--font-slant=0.5
--direction=ttb;U+0061,U+0062,U+0063;[gid1=0@-280,-948+0,-1362|gid2=1@-307,-1056+0,-1362|gid3=2@-240,-949+0,-1362]
-+../fonts/NotoSans-VF.abc.ttf;--font-bold=0.1
--direction=ttb;U+0061,U+0062,U+0063;[gid1=0@-430,-1148+0,-1362|gid2=1@-457,-1256+0,-1362|gid3=2@-390,-1149+0,-1362]
---
-2.39.5
-
diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index 2999c2d8c3fe..b3b63944d0dc 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -17,7 +17,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
$(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
external/harfbuzz/harfbuzz_visibility.patch.1 \
-
external/harfbuzz/0001-Fix-applying-synthetic-slight-to-glyph-origins-5629.patch.1
\
))
# meson will replace python3 from shebang in build commands with the
commit dcb108323e866fa9cafda685f0de9eb4adb21665
Author: Mike Kaganski <[email protected]>
AuthorDate: Sun Nov 2 13:28:36 2025 +0500
Commit: Adolfo Jayme Barrientos <[email protected]>
CommitDate: Wed Nov 5 19:58:53 2025 +0100
tdf#169158: Call FormatObjsAtFrame again, when at-page fly needs that
Formatting a cell with non-default vertical alignment is done in two
steps. In the end of the first step, SwContentNotify::ImplDestroy
detects the difference of size/position of the table content, and the
non-default vertical alignment, and invalidates the cell and its page.
Then the next formatting would correct the size/position mismatch; it
obviously relies on the second pass of formatting.
In SwLayAction::InternalAction, the formatting loop did a single call
to SwObjectFormatter::FormatObjsAtFrame, which formatted at-page fly
objects, and then an inner loop which formatted the rest of the page
content. In that inner loop, it performed validation of all flags,
then called FormatContent, and checked the validity. That meant, that
any invalidation that could happen in at-page objects formatting time
would be lost. Then, there was nothing to indicate that the at-page
objects could need a second formatting attempt; the outer loop could
only run once, even when the at-page formatting needed another run.
This change introduces a dedicated flag for at-page fly invalid state.
It is checked in SwLayAction::InternalAction in a new loop, to make
sure that SwObjectFormatter::FormatObjsAtFrame is repeated as needed.
Change-Id: Id6f4fef10cc031af95c38f0074178405027c513d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193298
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <[email protected]>
(cherry picked from commit 15c89cf1b72a7556af238d9b0a7d34017c6ec3ee)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193325
Reviewed-by: Adolfo Jayme Barrientos <[email protected]>
diff --git
a/sw/qa/extras/layout/data/cell-vertical-align-middle-in-fly-at-page.fodt
b/sw/qa/extras/layout/data/cell-vertical-align-middle-in-fly-at-page.fodt
new file mode 100644
index 000000000000..e4be99c21a8b
--- /dev/null
+++ b/sw/qa/extras/layout/data/cell-vertical-align-middle-in-fly-at-page.fodt
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:styles>
+ <style:style style:name="Frame" style:family="graphic"/>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="Table1.1" style:family="table-row">
+ <style:table-row-properties style:min-row-height="3cm"/>
+ </style:style>
+ <style:style style:name="Table1.A1" style:family="table-cell">
+ <style:table-cell-properties style:vertical-align="middle" fo:padding="1mm"
fo:border="0.06pt solid #000000"/>
+ </style:style>
+ <style:style style:name="fr1" style:family="graphic"
style:parent-style-name="Frame">
+ <style:graphic-properties style:vertical-pos="from-top"
style:vertical-rel="page" style:horizontal-pos="from-left"
style:horizontal-rel="page" fo:padding="0" fo:border="none"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:body>
+ <office:text>
+ <draw:frame draw:style-name="fr1" draw:name="Frame1"
text:anchor-type="page" text:anchor-page-number="1" svg:x="3cm" svg:y="3cm"
svg:width="5cm" svg:height="3cm">
+ <draw:text-box>
+ <table:table table:name="Table1">
+ <table:table-column/>
+ <table:table-row table:style-name="Table1.1">
+ <table:table-cell table:style-name="Table1.A1"
office:value-type="string">
+ <text:p>foo</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table>
+ </draw:text-box>
+ </draw:frame>
+ <text:p/>
+ </office:text>
+ </office:body>
+</office:document>
\ No newline at end of file
diff --git a/sw/qa/extras/layout/layout5.cxx b/sw/qa/extras/layout/layout5.cxx
index 59f8ff78b28a..89b6fe9f07e1 100644
--- a/sw/qa/extras/layout/layout5.cxx
+++ b/sw/qa/extras/layout/layout5.cxx
@@ -2130,6 +2130,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf164718)
CPPUNIT_ASSERT_LESS(sal_Int32(4000), height);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf169158)
+{
+ // A table with vertical-align="middle" in a fly anchored at page:
+ createSwDoc("cell-vertical-align-middle-in-fly-at-page.fodt");
+ auto pXmlDoc = parseLayoutDump(); // Intentionally no
Scheduler::ProcessEventsToIdle
+
+ // The problem was, that layout didn't reformat objects at page, when the
non-default
+ // alignment invalidated cells in tables in at-page fly in
SwContentNotify::ImplDestroy.
+
+ // Check that the text in the cell is aligned correctly:
+ assertXPath(pXmlDoc, "//page", 1);
+ assertXPath(pXmlDoc, "//page/anchored/fly/tab/row/cell/infos/bounds",
"top", u"1985");
+ // Without the fix, this would fail with
+ // - Expected: 2698
+ // - Actual : 2043
+ assertXPath(pXmlDoc, "//page/anchored/fly/tab/row/cell/txt/infos/bounds",
"top", u"2698");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 3f4967a65e62..aa2af7e0ae4c 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -81,6 +81,8 @@ class SW_DLLPUBLIC SwPageFrame final: public
SwFootnoteBossFrame
bool m_bInvalidAutoCmplWrds :1; // Update auto complete word list
bool m_bInvalidWordCount :1;
bool m_bHasGrid :1; // Grid for Asian layout
+ mutable bool m_bInAtPageFlyFormatting : 1 = false;
+ mutable bool m_bInvalidAtPageFly : 1 = false; // Disambiguate at-page
invalidation
static const sal_Int8 snShadowPxWidth;
@@ -229,6 +231,7 @@ public:
inline void ValidateSmartTags() const;
inline void ValidateAutoCompleteWords() const;
inline void ValidateWordCount() const;
+ void ValidateAtPageFly() const { m_bInvalidAtPageFly = false; }
inline bool IsInvalid() const;
inline bool IsInvalidFly() const;
bool IsRightShadowNeeded() const;
@@ -242,6 +245,9 @@ public:
bool IsInvalidSmartTags() const { return m_bInvalidSmartTags; }
bool IsInvalidAutoCompleteWords() const { return m_bInvalidAutoCmplWrds; }
bool IsInvalidWordCount() const { return m_bInvalidWordCount; }
+ bool IsInvalidAtPageFly() const { return m_bInvalidAtPageFly; }
+ bool IsInAtPageFlyFormatting() const { return m_bInAtPageFlyFormatting; }
+ void SetInAtPageFlyFormatting(bool val) const { m_bInAtPageFlyFormatting =
val; }
/** SwPageFrame::GetDrawBackgroundColor
@@ -373,6 +379,8 @@ inline const SwContentFrame
*SwPageFrame::FindLastBodyContent() const
inline void SwPageFrame::InvalidateFlyLayout() const
{
const_cast<SwPageFrame*>(this)->m_bInvalidFlyLayout = true;
+ if (m_bInAtPageFlyFormatting)
+ m_bInvalidAtPageFly = true;
}
inline void SwPageFrame::InvalidateFlyContent() const
{
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 8fb5d154ac12..ad59d390d86d 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -570,12 +570,18 @@ void SwLayAction::InternalAction(OutputDevice*
pRenderContext)
if (!bTakeShortcut)
{
+ bool bAtPageObjectsAreInvalid = false;
while ( !IsInterrupt() && !IsNextCycle() &&
- ((pPage->GetSortedObjs() && pPage->IsInvalidFly()) ||
pPage->IsInvalid()) )
+ ((pPage->GetSortedObjs() && pPage->IsInvalidFly()) ||
pPage->IsInvalid() || bAtPageObjectsAreInvalid))
{
unlockPositionOfObjects( pPage );
- SwObjectFormatter::FormatObjsAtFrame( *pPage, *pPage, this );
+ pPage->ValidateAtPageFly();
+ pPage->SetInAtPageFlyFormatting(true);
+ SwObjectFormatter::FormatObjsAtFrame(*pPage, *pPage, this);
+ pPage->SetInAtPageFlyFormatting(false);
+ bAtPageObjectsAreInvalid = pPage->IsInvalidAtPageFly();
+
if ( !pPage->GetSortedObjs() )
{
// If there are no (more) Flys, the flags are superfluous.