drawinglayer/source/processor2d/cairopixelprocessor2d.cxx | 4 editeng/source/editeng/impedit2.cxx | 2 external/python3/ExternalPackage_python3.mk | 7 framework/inc/services/layoutmanager.hxx | 1 framework/source/layoutmanager/layoutmanager.cxx | 30 +++ sc/source/ui/view/preview.cxx | 2 sd/source/core/drawdoc2.cxx | 5 solenv/bin/assemble-flatpak-appdata.sh | 12 - sw/qa/core/layout/calcmove.cxx | 6 sw/qa/extras/layout/data/merge_hidden_redline_lineheight.rtf | 56 +++++++ sw/qa/extras/layout/layout2.cxx | 68 ++++++++ sw/qa/extras/ooxmlexport/data/tdf165047_consolidatedTopMargin.docx |binary sw/qa/extras/ooxmlexport/data/tdf165047_contextualSpacingTopMargin.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport22.cxx | 37 ++++ sw/source/core/layout/flowfrm.cxx | 46 +++++ sw/source/core/text/itratr.cxx | 77 ++++++---- sw/source/core/text/itratr.hxx | 1 sw/source/uibase/uiview/pview.cxx | 4 vcl/osx/salframeview.mm | 15 + 19 files changed, 327 insertions(+), 46 deletions(-)
New commits: commit 3ab1ee4c4c8476b249b37cb40c5131bf0e8cb7cf Author: Stephan Bergmann <[email protected]> AuthorDate: Wed Apr 2 10:12:51 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:50 2025 +0200 Fill in the flatpak appdata screenshot captions ...that had been left empty when they had been introduced in <https://git.libreoffice.org/dev-tools/+/f96d7afbf282e5621697aca84177e42fe2cc2255%5E!> "Adapt org.libreoffice.LibreOffice.appdata.xml". (This should avoid the warning "appstream-screenshot-missing-caption: One or more screenshots are missing captions in the Metainfo file" from `flatpak run --command=flatpak-builder-lint org.flatpak.Builder repo repo`, see <https://docs.flathub.org/docs/for-app-authors/submission#run-the-linter>.) Change-Id: Ib1f3a629cbb19229408f8d476a37385678a607d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183634 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> (cherry picked from commit ff3c48c213332e2bb617de4cda6ebc4994906f92) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183654 Reviewed-by: Michael Stahl <[email protected]> diff --git a/solenv/bin/assemble-flatpak-appdata.sh b/solenv/bin/assemble-flatpak-appdata.sh index 7d99671945c5..874f23e1fc27 100755 --- a/solenv/bin/assemble-flatpak-appdata.sh +++ b/solenv/bin/assemble-flatpak-appdata.sh @@ -51,23 +51,23 @@ cat <<\EOF >"${1?}"org.libreoffice.LibreOffice.appdata.xml <screenshots> <screenshot type="default"> <image>https://hub.libreoffice.org/screenshots/writer-01.png</image> - <caption><!-- Describe this screenshot in less than ~10 words --></caption> + <caption>Sample Writer document</caption> </screenshot> <screenshot> <image>https://hub.libreoffice.org/screenshots/calc-02.png</image> - <caption><!-- Describe this screenshot in less than ~10 words --></caption> + <caption>Sample Calc document</caption> </screenshot> <screenshot> <image>https://hub.libreoffice.org/screenshots/impress-01.png</image> - <caption><!-- Describe this screenshot in less than ~10 words --></caption> + <caption>Sample Impress document</caption> </screenshot> <screenshot> <image>https://hub.libreoffice.org/screenshots/draw-02.png</image> - <caption><!-- Describe this screenshot in less than ~10 words --></caption> + <caption>Sample Draw document</caption> </screenshot> <screenshot> <image>https://hub.libreoffice.org/screenshots/base-02.png</image> - <caption><!-- Describe this screenshot in less than ~10 words --></caption> + <caption>Sample Base document</caption> </screenshot> </screenshots> <developer_name>The Document Foundation</developer_name> commit 09d99778fa297da66bc56477835f80fa20493e97 Author: Armin Le Grand (Collabora) <[email protected]> AuthorDate: Thu Mar 27 21:35:40 2025 +0100 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:50 2025 +0200 Need to take over BColorModifierStack for *all* content renderings Change-Id: Iac558c8b653349a86966869bd96dca265a8fb223 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183419 Reviewed-by: Armin Le Grand <[email protected]> Tested-by: Jenkins (cherry picked from commit 5528fb79ec1e143b0aea7bbb0685ad7a6cff2696) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183554 Reviewed-by: Michael Stahl <[email protected]> diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx index dc6c637e9330..4264d188e38b 100644 --- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx @@ -1948,6 +1948,10 @@ void CairoPixelProcessor2D::processUnifiedTransparencePrimitive2D( cairo_surface_t* pContent(cairo_surface_create_similar( pTarget, cairo_surface_get_content(pTarget), fContainedWidth, fContainedHeight)); CairoPixelProcessor2D aContent(aViewInformation2D, pContent); + + // take over evtl. used ColorModifierStack for content + aContent.setBColorModifierStack(getBColorModifierStack()); + aContent.process(rTransCandidate.getChildren()); // paint temporary surface to target with fixed transparence commit 9453ea45673f14b9daf84c8dd1b6102486f226d0 Author: Stephan Bergmann <[email protected]> AuthorDate: Wed Apr 2 10:17:33 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:50 2025 +0200 Drop .desktop suffix from flatpak appdata id ...that had been like that (for reasons that escape me now) ever since <https://git.libreoffice.org/dev-tools/+/cb6ca493be62b59aa16c7ec6a051e594a1d92f18%5E!> "Create a single-app LibreOffice.flatpak", but which causes an error "appstream-id-mismatch-flatpak-id: The ID tag: org.libreoffice.LibreOffice.desktop in Metainfo does not match the FLATPAK_ID: org.libreoffice.LibreOffice" from `flatpak run --command=flatpak-builder-lint org.flatpak.Builder repo repo` (see <https://docs.flathub.org/docs/for-app-authors/submission#run-the-linter>) Change-Id: I0823020e6de20930b1ef8d5205fcf49ac2319a92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183633 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> (cherry picked from commit c36f2356511d36c3d5c8cf6ffbdad308c9c4120b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183657 Reviewed-by: Michael Stahl <[email protected]> diff --git a/solenv/bin/assemble-flatpak-appdata.sh b/solenv/bin/assemble-flatpak-appdata.sh index 84b5f5399299..7d99671945c5 100755 --- a/solenv/bin/assemble-flatpak-appdata.sh +++ b/solenv/bin/assemble-flatpak-appdata.sh @@ -25,7 +25,7 @@ set -e cat <<\EOF >"${1?}"org.libreoffice.LibreOffice.appdata.xml <?xml version="1.0" encoding="UTF-8"?> <component type="desktop"> - <id>org.libreoffice.LibreOffice.desktop</id> + <id>org.libreoffice.LibreOffice</id> <metadata_license>CC0-1.0</metadata_license> <project_license>MPL-2.0</project_license> <name>LibreOffice</name> commit 8651dbcbc7ab827948a9658c1e08643a7e86b914 Author: Justin Luth <[email protected]> AuthorDate: Wed Apr 2 14:58:45 2025 -0400 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:50 2025 +0200 tdf#165047 sw mso-compat layout: always honour contextualSpacing This improves 25.8 commit ae7900dd42a65aaf60df6b21b9ad511496b209d9 tdf#164095 sw: fix missing top margin on paragraph after changing page style which was backported to 24.8.5. The problem is that you can't just simply apply the top margin. Even though it may be across a page break, or even in a different section, the fact that the previous paragraph is the same style means that we simply don't add any upper spacing to this paragraph. make CppunitTest_sw_ooxmlexport22 \ CPPUNIT_TEST_NAME=testTdf165047_contextualSpacingTopMargin Change-Id: I12712e5421e20ea0757c59029c6890bff9d81b94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183643 Reviewed-by: Justin Luth <[email protected]> Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183650 Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/data/tdf165047_contextualSpacingTopMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf165047_contextualSpacingTopMargin.docx new file mode 100644 index 000000000000..f6710de3e4a1 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf165047_contextualSpacingTopMargin.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx index 0f49a25b01c4..0a45f8be813d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx @@ -73,6 +73,25 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165047_consolidatedTopMargin) CPPUNIT_ASSERT_EQUAL(static_cast<SwTwips>(200), nParaTopMargin); } +CPPUNIT_TEST_FIXTURE(Test, testTdf165047_contextualSpacingTopMargin) +{ + // Given a two page document with a section page break + // which is preceded by a paragraph with a lot of lower spacing + // and followed by a paragraph with a lot of upper spacing, + // but that paragraph says "don't add space between identical paragraph styles... + loadAndSave("tdf165047_contextualSpacingTopMargin.docx"); + + // the upper spacing is ignored since the paragraph styles are the same + CPPUNIT_ASSERT_EQUAL(2, getPages()); + + // When laying out that document: + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // The effective top margin (after the page break) must be 0 + SwTwips nParaTopMargin + = getXPath(pXmlDoc, "/root/page[2]/body/section/infos/prtBounds", "top").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast<SwTwips>(0), nParaTopMargin); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 1a82925021ac..a2c83b864ae6 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1502,13 +1502,14 @@ const SwFrame* SwFlowFrame::GetPrevFrameForUpperSpaceCalc_( const SwFrame* _pPro // This should be renamed to something like lcl_UseULSpacing /// Compare styles attached to these text frames. -static bool lcl_IdenticalStyles(const SwFrame* pPrevFrame, const SwFrame* pFrame) +static bool lcl_IdenticalStyles(const SwFrame* pPrevFrame, const SwFrame* pFrame, + bool bAllowAcrossSections = false) { if (!pFrame || !pFrame->IsTextFrame()) return false; // Identical styles only applies if "the paragraphs belong to the same content area". - if (pPrevFrame && pPrevFrame->FindSctFrame() != pFrame->FindSctFrame()) + if (!bAllowAcrossSections && pPrevFrame && pPrevFrame->FindSctFrame() != pFrame->FindSctFrame()) return false; SwTextFormatColl *pPrevFormatColl = nullptr; @@ -1558,6 +1559,14 @@ static void lcl_PartiallyCollapseUpper(const SwFrame& rFrame, SwTwips& rUpper) if (!pPrevPara || pPrevPara->IsInTab()) return; + // MSO skips space between same-style paragraphs even at a sectionPageBreak. + const bool bContextualSpacing = pTextFrame->GetAttrSet()->GetULSpace().GetContext(); + const bool bIdenticalStyles + = bContextualSpacing + && lcl_IdenticalStyles(pPrevPara, pTextFrame, /*AllowAcrossSections*/ true); + if (bIdenticalStyles) + rUpper = 0; + else { // MSO is also hyper-consistent about consolidating // the lower-space from the previous paragraph commit 7d753bae7eabf772e4e3225063fa96b43a044ba7 Author: Justin Luth <[email protected]> AuthorDate: Wed Apr 2 13:14:16 2025 -0400 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:41 2025 +0200 tdf#165047 sw mso-compat layout: always consolidate top margin This improves 25.8 commit ae7900dd42a65aaf60df6b21b9ad511496b209d9 tdf#164095 sw: fix missing top margin on paragraph after changing page style which was backported to 24.8.5. The problem is that you can't just simply apply the top margin. Even though it may be across a page break, or even in a different section, the already-applied, previous paragraph's bottom margin needs to be "removed" from this paragraph's top margin. make CppunitTest_sw_ooxmlexport22 \ CPPUNIT_TEST_NAME=testTdf165047_consolidatedTopMargin Change-Id: I1ca5a6173cc5ae5a06adaf38a3292f556a81a48d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183619 Tested-by: Jenkins Reviewed-by: Justin Luth <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183649 Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx index 893d3fd89915..3606c70eb73e 100644 --- a/sw/qa/core/layout/calcmove.cxx +++ b/sw/qa/core/layout/calcmove.cxx @@ -96,10 +96,10 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginPageStyleChange) sal_Int32 nParaTopMargin = getXPath(pXmlDoc, "/root/page[3]/body/txt/infos/prtBounds", "top").toInt32(); // Without the accompanying fix in place, this test would have failed with: - // - Expected: 2000 + // - Expected: 1840 // - Actual : 0 - // i.e. the top margin was ignored, which is incorrect. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2000), nParaTopMargin); + // i.e. the top margin (minus the previous bottom margin) was ignored, which is incorrect. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1840), nParaTopMargin); } CPPUNIT_TEST_FIXTURE(Test, testHideWhitespaceGrowingLastPage) diff --git a/sw/qa/extras/ooxmlexport/data/tdf165047_consolidatedTopMargin.docx b/sw/qa/extras/ooxmlexport/data/tdf165047_consolidatedTopMargin.docx new file mode 100644 index 000000000000..7a44a2d14f5f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf165047_consolidatedTopMargin.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx index 997ccec46071..0f49a25b01c4 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport22.cxx @@ -55,6 +55,24 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165933_noDelTextOnMove) assertXPath(pXmlDoc, "//w:moveFrom/w:r/w:delText", 0); } +CPPUNIT_TEST_FIXTURE(Test, testTdf165047_consolidatedTopMargin) +{ + // Given a two page document with a section page break + // which is preceded by a paragraph with a lot of lower spacing + // and followed by a paragraph with even more upper spacing... + loadAndSave("tdf165047_consolidatedTopMargin.docx"); + + // the upper spacing is mostly "absorbed" by the preceding lower spacing, and is barely noticed + CPPUNIT_ASSERT_EQUAL(2, getPages()); + + // When laying out that document: + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + // the effective top margin should be 60pt - 50pt = 10pt (0.36cm) after the page break + SwTwips nParaTopMargin + = getXPath(pXmlDoc, "/root/page[2]/body/section/infos/prtBounds", "top").toInt32(); + CPPUNIT_ASSERT_EQUAL(static_cast<SwTwips>(200), nParaTopMargin); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index a60e51962541..1a82925021ac 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1536,6 +1536,37 @@ static bool lcl_getContextualSpacing(const SwFrame* pPrevFrame) return bRet; } +/// Implement top-of-the-page layout anomalies needed to match MS Word +static void lcl_PartiallyCollapseUpper(const SwFrame& rFrame, SwTwips& rUpper) +{ + const SwTextFrame* pTextFrame = rFrame.DynCastTextFrame(); + if (!pTextFrame || !rFrame.IsInDocBody() || rFrame.IsInTab() || rFrame.IsInFly()) + return; + + // re-used existing compat values to identify whether MSO-compatible layout is needed + const IDocumentSettingAccess& rIDSA = pTextFrame->GetDoc().getIDocumentSettingAccess(); + const bool bCompat15 = rIDSA.get(DocumentSettingId::TAB_OVER_SPACING); // MSO 2013+ + const bool bCompat14 = rIDSA.get(DocumentSettingId::TAB_OVER_MARGIN); // <= MSO 2010 + if (!bCompat15 && !bCompat14) + return; + + const SwContentFrame* pPrevPara = pTextFrame->FindPrevCnt(); + while (pPrevPara && pPrevPara->IsHiddenNow()) + pPrevPara = pPrevPara->FindPrevCnt(); + + // Anything related to tables is skipped simply to avoid potential disaster + if (!pPrevPara || pPrevPara->IsInTab()) + return; + + { + // MSO is also hyper-consistent about consolidating + // the lower-space from the previous paragraph + // with the upper spacing of this paragraph + const SwTwips nPrevLowerSpace + = pPrevPara->GetAttrSet()->GetULSpace().GetLower(); + rUpper = std::max<SwTwips>(rUpper - nPrevLowerSpace, 0); + } +} SwTwips SwFlowFrame::CalcUpperSpace( const SwBorderAttrs *pAttrs, const SwFrame* pPr, @@ -1709,6 +1740,8 @@ SwTwips SwFlowFrame::CalcUpperSpace( const SwBorderAttrs *pAttrs, { nUpper = 0; } + else + lcl_PartiallyCollapseUpper(*pOwn, nUpper); // possibly modifies nUpper } } commit 4c04e4b59dade899ebe4c18399d188ea2d791a0f Author: Heiko Tietze <[email protected]> AuthorDate: Mon Mar 31 14:23:10 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:00 2025 +0200 Resolves tdf#101142 - Always use the real background for print preview while in dark mode the workspace area is dark, that is only for display purposes and the document isn't actually set to a dark background. The print preview previously used that theme/display color. Now it uses the actual color to match what you'd get in a PDF-export or when printing to paper. Change-Id: Ib60ca1c5de5eb17008cc5ddc04ae4fccfe373b29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183541 Tested-by: Jenkins Reviewed-by: Heiko Tietze <[email protected]> (cherry picked from commit f597c3a6eaa6b45f43b127b9b042442516ddc202) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183581 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 4a96b4c61d6f..80f61b44d2ce 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -383,7 +383,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) pPrintFunc->SetManualZoom(nZoom); pPrintFunc->SetDateTime(aDateTime); pPrintFunc->SetClearFlag(true); - pPrintFunc->SetUseStyleColor( officecfg::Office::Common::Accessibility::IsForPagePreviews::get() ); + pPrintFunc->SetUseStyleColor(false); // tdf#101142 print preview should use a white background pPrintFunc->SetDrawView( pDrawView.get() ); diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 9811b027f586..77a6229bd1aa 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1109,6 +1109,10 @@ void SwPagePreview::Init() bool bIsModified = pESh != nullptr && pESh->IsModified(); SwViewOption aOpt( *pPrefs ); + // tdf#101142 print preview should use a white background + SwViewColors aColors( aOpt.GetColorConfig() ); + aColors.m_aDocColor = COL_WHITE; + aOpt.SetColorConfig( aColors ); aOpt.SetPagePreview(true); aOpt.SetTab( false ); aOpt.SetBlank( false ); commit b30b3bb232fcf1bc0ae6d479e78f8d31b7f0a0a4 Author: Michael Stahl <[email protected]> AuthorDate: Wed Apr 2 13:58:07 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:00 2025 +0200 sw: use same line height as Word for paragraphs empty due to hidden text If paragraphs are merged by hidden paragraph end markers, and all of the text in the paragraphs is hidden by character formatting, then Word will use the formatting of the end marker of the last paragraph to calculate the line height; Writer would use the formatting at the position where the last portion of hidden text ends, which may be in an earlier paragraph. Change-Id: I1e8c5676d7330c383521755c736828fdc42e4217 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183622 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins (cherry picked from commit e8cbd4f14a3086e0f148f0b39f32f7101c25b012) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183629 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/sw/qa/extras/layout/data/merge_hidden_redline_lineheight.rtf b/sw/qa/extras/layout/data/merge_hidden_redline_lineheight.rtf new file mode 100644 index 000000000000..ea6698fa15d2 --- /dev/null +++ b/sw/qa/extras/layout/data/merge_hidden_redline_lineheight.rtf @@ -0,0 +1,56 @@ +{ tf1deflang1025nsinsicpg1252\uc1deff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang2057\deflangfe1028 hemelang2057 hemelangfe1028 hemelangcs1025 +{onttbl{1bidi swisscharset0prq2{\*\panose 020b0604020202020204}Arial{\* alt Arial};} +{dbminor31505bidi nilcharset136prq2{\*\panose 02010601000101010101}PMingLiU{\*alt Arial Unicode MS};} +{himinor31506bidi swisscharset0prq2{\*\panose 020f0502020204030204}Calibri;}{biminor31507bidi swisscharset0 prq2{\*\panose 020b0604020202020204}Arial{\*alt Arial};} +} +{\*\defchp s22\lochf31506\hichf31506\dbchf31505 }{\*\defpap \ql \li0 i0\sa160\sl259\slmult1\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 } oqfpromote {\stylesheet{ +\ql \li0 i0\sa160\sl259\slmult1\widctlpar\wrapdefaultspalphaspnum aautodjustright in0\lin0\itap0 tlchcs1 f31507fs22lang1025 \ltrchcs0 s22\lang2057\langfe1028\loch31506\hichf31506\dbchf31505+\snext0 \sqformat \spriority0 Normal;}{\*+ s11 srowd rftsWidthB3 rpaddl108 rpaddr108 rpaddfl3 rpaddft3 rpaddfb3 rpaddfr3 blind0 blindtype3 svertalt sbrdrt sbrdrl sbrdrb sbrdrr sbrdrdgl sbrdrdgr sbrdrh sbrdrv \ql \li0 i0\sa160\sl259\slmult1 +\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 tlchcs1 f31507fs22lang1025 \ltrchcs0 s22\lang2057\langfe1028\loch 31506\hichf31506\dbchf31505+Normal Table;}} + +\paperw11906\paperh16838\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrltnbjenddoc rackmoves0 rackformatting1\donotembedsysfont1 elyonvml0\donotembedlingdata0\grfdocevents0 alidatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1 oxlattoyen +xpshrtn oultrlspc\dntblnsbdb ospaceforul ormshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1 +\jexpandiewkind1iewscale75\pgbrdrhead\pgbrdrfoot\splytwnine tnlytwnine\htmautsp olnhtadjtbl\useltbalnlntblind\lytcalctblwd\lyttblrtgr\lnbrkrule obrkwrptbl\snaptogridincellllowfieldendsel\wrppunct +sianbrkrule ewtblstyruls ogrowautofit\usenormstyforlist oindnmbrtselnbrelev ocxsptable\indrlsweleven oafcnsttblfelev\utinl\hwelev\spltpgpar otcvasp otbrkcnstfrctbl otvatxbx\krnprsnet+{\*\wgrffmtfilter 2450} ofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\headery708 ootery708+\pnucltr\pnqc\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnqc\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnqc\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (} +{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}} +{\*\pnseclvl9\pnlcrm\pnqc\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0 i0\sa160\sl259\slmult1\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 tlchcs1 f31507fs22lang1025 \ltrchcs0 + s22\lang2057\langfe1028\lochf31506\hichf31506\dbchf31505+\hichf31506\dbchf31505\loch 31506 hidden}{ tlchcs1 f31507 \ltrchcs0 \hichf31506\dbchf31505\loch31506 }{ tlchcs1 f31507 \ltrchcs0 \hichf31506\dbchf31505\loch31506 24/11}{ tlchcs1 f31507 +\ltrchcs0 +\par }{ tlchcs1 f31507 \ltrchcs0 s48 +\par }{ tlchcs1 f31507 \ltrchcs0 +\par }\pard \ltrpar\ql \li0 i0\sa160\sl259\slmult1\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0{ tlchcs1 f31507 \ltrchcs0 \hichf31506\dbchf31505\loch31506 2 empty hidden +\hichf31506\dbchf31505\loch31506 1\hichf31506\dbchf31505\loch31506 1\hichf31506\dbchf31505\loch31506 /24 +\par }\pard \ltrpar\ql \li0 i0\sa160\sl259\slmult1\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 { tlchcs1 f31507 \ltrchcs0 +\par }{ tlchcs1 f31507 \ltrchcs0 s48 +\par }\pard \ltrpar\ql \li0 i0\sa160\sl259\slmult1\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0{ tlchcs1 f31507 \ltrchcs0 \hichf31506\dbchf31505\loch31506 3 +\hichf31506\dbchf31505\loch31506 \hichf31506\dbchf31505\loch31506 nonempty\hichf31506\dbchf31505\loch31506 24\hichf31506\dbchf31505\loch 31506 hidden \hichf31506\dbchf31505\loch31506 11 +\hichf31506\dbchf31505\loch31506 /\hichf31506\dbchf31505\loch31506 11 +\par }\pard \ltrpar\ql \li0 i0\sa160\sl259\slmult1\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 { tlchcs1 f31507 \ltrchcs0 s48\hichf31506\dbchf31505\loch 31506 foo}{ tlchcs1 +f31507 \ltrchcs0 +\par }{ tlchcs1 f31507 \ltrchcs0 +\par \hichf31506\dbchf31505\loch31506 4 nonempty 24 hidden 24/11 +\par }{ tlchcs1 f31507 \ltrchcs0 s48\hichf31506\dbchf31505\loch31506 foo +\par }{ tlchcs1 f31507 \ltrchcs0 +\par \hichf31506\dbchf31505\loch31506 5\hichf31506\dbchf31505\loch31506 nonempty\hichf31506\dbchf31505\loch31506 24\hichf31506\dbchf31505\loch 31506 hidden \hichf31506\dbchf31505\loch31506 11/24 +\par }{ tlchcs1 f31507 \ltrchcs0 +\par }{ tlchcs1 f31507 \ltrchcs0 s48\hichf31506\dbchf31505\loch31506 foo}{ tlchcs1 f31507 \ltrchcs0 s48 +\par }{ tlchcs1 f31507 \ltrchcs0 \hichf31506\dbchf31505\loch31506 6\hichf31506\dbchf31505\loch31506 \hichf31506\dbchf31505\loch31506 nonempty \hichf31506\dbchf31505\loch31506 24 +\hichf31506\dbchf31505\loch31506 hidden \hichf31506\dbchf31505\loch31506 11/11 +\par }{ tlchcs1 f31507 \ltrchcs0 +\par }{ tlchcs1 f31507 \ltrchcs0 s48\hichf31506\dbchf31505\loch31506 foo}{ tlchcs1 f31507 \ltrchcs0 +\par }{ tlchcs1 f31507 \ltrchcs0 \hichf31506\dbchf31505\loch31506 7}{ tlchcs1 f31507 \ltrchcs0 \hichf31506\dbchf31505\loch31506 empty delete 24/11}{ tlchcs1 f31507 \ltrchcs0 + +\par }{ tlchcs1 f31507 \ltrchcs0 \deleteds48 evauthdel1 evdttmdel1205079000 +\par }{ tlchcs1 f31507 \ltrchcs0 +\par \hichf31506\dbchf31505\loch31506 8 empty delete 11/24 +\par }{ tlchcs1 f31507 \ltrchcs0 \deleted evauthdel1 evdttmdel1205079000 +\par }{ tlchcs1 f31507 \ltrchcs0 s48 +\par }{ tlchcs1 f31507 \ltrchcs0 +\par } +} diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 9b0401f42aa9..d7fcbb7b5625 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -802,6 +802,74 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHiddenParaBreaks) assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/SwParaPortion/SwLineLayout", "portion", u"End"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHiddenParaLineHeight) +{ + createSwDoc("merge_hidden_redline_lineheight.rtf"); + + SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); + SwViewOption aViewOptions(*pWrtShell->GetViewOptions()); + aViewOptions.SetShowHiddenChar(true); + aViewOptions.SetViewMetaChars(true); + pWrtShell->ApplyViewOptions(aViewOptions); + + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", u"269"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[12]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[13]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[14]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[15]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[16]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[17]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[18]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[19]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[20]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[21]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[22]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[23]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[24]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[25]/infos/bounds", "height", u"475"); + } + + aViewOptions.SetShowHiddenChar(false); + pWrtShell->ApplyViewOptions(aViewOptions); + dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {}); + + { + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/infos/bounds", "height", u"269"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/infos/bounds", "height", u"475"); + // 4: this was using wrong node's character properties (height 767) + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[12]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[13]/infos/bounds", "height", u"475"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[14]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[15]/infos/bounds", "height", u"450"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[16]/infos/bounds", "height", u"767"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[17]/infos/bounds", "height", u"475"); + } +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHiddenParaProps) { createSwDoc("merge_hidden_redline.docx"); diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index bccc7377072d..aa3fd8353b0d 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -157,9 +157,7 @@ SwTextAttr *SwAttrIter::GetAttr(TextFrameIndex const nPosition) const bool SwAttrIter::SeekAndChgAttrIter(TextFrameIndex const nNewPos, OutputDevice* pOut) { - std::pair<SwTextNode const*, sal_Int32> const pos( m_pMergedPara - ? sw::MapViewToModel(*m_pMergedPara, nNewPos) - : std::make_pair(m_pTextNode, sal_Int32(nNewPos))); + std::pair<SwTextNode const*, sal_Int32> const pos{SeekNewPos(nNewPos, nullptr)}; bool bChg = m_nStartIndex && pos.first == m_pTextNode && pos.second == m_nPosition ? m_pFont->IsFntChg() : Seek( nNewPos ); @@ -332,12 +330,61 @@ void SwAttrIter::SeekToEnd() } } +std::pair<SwTextNode const*, sal_Int32> +SwAttrIter::SeekNewPos(TextFrameIndex const nNewPos, bool *const o_pIsToEnd) +{ + std::pair<SwTextNode const*, sal_Int32> newPos{ m_pMergedPara + ? sw::MapViewToModel(*m_pMergedPara, nNewPos) + : std::make_pair(m_pTextNode, sal_Int32(nNewPos))}; + + bool isToEnd{false}; + if (m_pMergedPara) + { + if (m_pMergedPara->extents.empty()) + { + isToEnd = true; + assert(m_pMergedPara->pLastNode == newPos.first); + } + else + { + auto const& rLast{m_pMergedPara->extents.back()}; + isToEnd = rLast.pNode == newPos.first && rLast.nEnd == newPos.second; + // for text formatting: use *last* node if all text is hidden + if (isToEnd + && m_pMergedPara->pLastNode != newPos.first // implies there is hidden text + && m_pViewShell->GetLayout()->GetParagraphBreakMode() == sw::ParagraphBreakMode::Hidden + && m_pTextNode->GetDoc().getIDocumentSettingAccess().get( + DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH)) + { + TextFrameIndex nHiddenStart(COMPLETE_STRING); + TextFrameIndex nHiddenEnd(0); + m_pScriptInfo->GetBoundsOfHiddenRange(TextFrameIndex(0), nHiddenStart, nHiddenEnd); + if (TextFrameIndex(0) == nHiddenStart + && TextFrameIndex(m_pMergedPara->mergedText.getLength()) <= nHiddenEnd) + { + newPos.first = m_pMergedPara->pLastNode; + newPos.second = m_pMergedPara->pLastNode->Len(); + } + } + } + } + else + { + isToEnd = newPos.second == m_pTextNode->Len(); + } + if (o_pIsToEnd) + { + *o_pIsToEnd = isToEnd; + } + + return newPos; +} + bool SwAttrIter::Seek(TextFrameIndex const nNewPos) { // note: nNewPos isn't necessarily an index returned from GetNextAttr - std::pair<SwTextNode const*, sal_Int32> const newPos( m_pMergedPara - ? sw::MapViewToModel(*m_pMergedPara, nNewPos) - : std::make_pair(m_pTextNode, sal_Int32(nNewPos))); + bool isToEnd{false}; + std::pair<SwTextNode const*, sal_Int32> const newPos{SeekNewPos(nNewPos, &isToEnd)}; if ( m_pRedline && m_pRedline->ExtOn() ) m_pRedline->LeaveExtend(*m_pFont, newPos.first->GetIndex(), newPos.second); @@ -426,24 +473,6 @@ bool SwAttrIter::Seek(TextFrameIndex const nNewPos) } } - bool isToEnd{false}; - if (m_pMergedPara) - { - if (!m_pMergedPara->extents.empty()) - { - auto const& rLast{m_pMergedPara->extents.back()}; - isToEnd = rLast.pNode == newPos.first && rLast.nEnd == newPos.second; - } - else - { - isToEnd = true; - } - } - else - { - isToEnd = newPos.second == m_pTextNode->Len(); - } - if (m_pTextNode->GetpSwpHints()) { if (m_pMergedPara) diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx index d61d112404eb..2e2b01d68492 100644 --- a/sw/source/core/text/itratr.hxx +++ b/sw/source/core/text/itratr.hxx @@ -61,6 +61,7 @@ private: const SwTextNode* m_pTextNode; sw::MergedPara const* m_pMergedPara; + std::pair<SwTextNode const*, sal_Int32> SeekNewPos(TextFrameIndex nNewPos, bool * o_pIsToEnd); void SeekFwd(sal_Int32 nOldPos, sal_Int32 nNewPos); void SeekToEnd(); void SetFnt( SwFont* pNew ) { m_pFont = pNew; } commit 5745850dbdb604ce270484ec9fbcb0e19f70bf1e Author: Noel Grandin <[email protected]> AuthorDate: Tue Apr 1 11:25:07 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:00 2025 +0200 tdf#165473 PPTX hyperlinks to other slides do not work regression from commit c638ae429e500cee147b621ed30d9fed392edd0a Author: Noel Grandin <[email protected]> Date: Fri Oct 18 16:21:10 2024 +0200 don't use iterateItemSurrogates for EE_FEATURE_FIELD Change-Id: Ibf7a89cb30dd11591152a7e052e4d11ea4bf9407 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183578 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins (cherry picked from commit 719f17554e2e73563cd90593c3f7f6b0eea84f17) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183583 Reviewed-by: Michael Stahl <[email protected]> diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index ed91f4034046..5f8ab487f9e4 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -306,11 +306,6 @@ static void UpdatePageRelativeURLs(SdrObject& rObj, const std::function<void(con if (!pOutlinerParagraphObject) return; EditTextObject& aEdit = const_cast<EditTextObject&>(pOutlinerParagraphObject->GetTextObject()); - if (!aEdit.IsFieldObject()) - return; - const SvxFieldItem* pFieldItem = aEdit.GetField(); - if (!pFieldItem) - return; aEdit.GetFieldUpdater().UpdatePageRelativeURLs(rItemCallback); }; commit a262a69a8f0ccfe1621d6529d5510fad987a40f6 Author: Noel Grandin <[email protected]> AuthorDate: Fri Mar 28 14:41:32 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:00 2025 +0200 tdf#165811 calc mouse select sometimes off by one char regression from commit 11b15571475414ef853e21a6c96afa2ac81f848f Author: Noel Grandin <[email protected]> Date: Wed Oct 30 09:51:26 2024 +0200 convert KernArray from sal_Int32 to double Change-Id: I9266693fa8d449c3369b65c31fbb4a3d3182777f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183452 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins (cherry picked from commit 0afe740800a5a2a4bc2041fa602b11dc31a4a4e1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183476 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 9214e79ded13..5b8abb8f2461 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -4108,7 +4108,7 @@ sal_Int32 ImpEditEngine::GetChar(ParaPortion const& rParaPortion, EditLine const // they belong to the same character, we can not use this position as an index. // Skip all 0-positions, cheaper than using XBreakIterator: tools::Long nX = rLine.GetCharPosArray()[nTmpCurIndex + x]; - while(x < nMax && rLine.GetCharPosArray()[nTmpCurIndex + x] == nX) + while(x < nMax && static_cast<tools::Long>(rLine.GetCharPosArray()[nTmpCurIndex + x]) == nX) ++x; } nOffset = x; commit 6ef66e63c30048bf76636fd4c0f7f5bef4559c91 Author: Patrick Luby <[email protected]> AuthorDate: Sat Mar 29 19:50:22 2025 -0400 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:00 2025 +0200 Related: tdf#161623 disable menubar visibility if no key window If a window is in LibreOffice's internal full screen mode and not in native full screen mode and then the user switches to a different application and back using the Command-Tab keys. the menubar and Dock would unexpectedly appear. It appears that the key window will still be nil in this case, so only enable menubar visibility if the key window is not nil. Change-Id: I1ad9aefe8183908044042efc2ec67df3bae252dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183500 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> Reviewed-by: Patrick Luby <[email protected]> Tested-by: Jenkins diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index cf1b6f4448f8..3e50105f178d 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -286,10 +286,19 @@ static void updateMenuBarVisibility( const AquaSalFrame *pFrame ) const NSWindow *pParentWindow = [NSApp keyWindow]; while( pParentWindow && pParentWindow != pFrame->getNSWindow() ) pParentWindow = [pParentWindow parentWindow]; - if( pParentWindow == pFrame->getNSWindow() ) - [NSMenu setMenuBarVisible: NO]; - else + + // Related: tdf#161623 disable menubar visibility if no key window + // If a window is in LibreOffice's internal full screen mode + // and not in native full screen mode and then the user switches + // to a different application and back using the Command-Tab keys. + // the menubar and Dock would unexpectedly appear. + // It appears that the key window will still be nil in this + // case, so only enable menubar visibility if the key window + // is not nil. + if( pParentWindow && pParentWindow != pFrame->getNSWindow() ) [NSMenu setMenuBarVisible: YES]; + else + [NSMenu setMenuBarVisible: NO]; } else { commit c34f37802a974cdf3bf551c0921d72dd4cafd190 Author: Patrick Luby <[email protected]> AuthorDate: Sun Mar 30 09:58:09 2025 -0400 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:00 2025 +0200 Related: tdf#161623 don't set the menubar to null on macOS When a window enters LibreOffice's internal full screen mode, the vcl code will hide the macOS menubar. However, if the window is also in native full screen mode, macOS will force the menubar to be visible. While the vcl code already partially handles this case by disabling all menu items when in LibreOffice's internal full screen mode, the problem is that any submenus that were not displayed before setting the menubar to null will show all menu items with no title. A simple way to reproduce this bug is to open a new Writer or Calc document and do the following: - Switch the window to LibreOffice's internal full screen mode by manually selecting the View > Full Screen menu item (the bug does not occur if its key shortcut is pressed) - Switch the window to native full screen mode - Click on the menubar and note that many of the submenus are displayed with menu items, but none of the menu items have a title So, we need to keep the menubar visible and rely on the vcl code to disable all menu items. Change-Id: I97fc63a8cd028c029a71899090185bc09d4aa492 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183508 Reviewed-by: Patrick Luby <[email protected]> Tested-by: Jenkins (cherry picked from commit 159be5c95178088c02ad863a3ad6f0a01b3ecc7f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183509 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx index 3b0b57e39132..699885e64c7a 100644 --- a/framework/inc/services/layoutmanager.hxx +++ b/framework/inc/services/layoutmanager.hxx @@ -265,6 +265,7 @@ namespace framework Timer m_aAsyncLayoutTimer; comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; // container for ALL Listener rtl::Reference< ToolbarLayoutManager > m_xToolbarManager; + bool m_bInSetCurrentUIVisibility; friend class detail::InfoHelperBuilder; }; diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 9f41150543d9..b1ee39ed51bb 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -110,6 +110,7 @@ LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) : , m_xPersistentWindowStateSupplier( ui::theWindowStateConfiguration::get( xContext ) ) , m_aAsyncLayoutTimer( "framework::LayoutManager m_aAsyncLayoutTimer" ) , m_aListenerContainer( m_aMutex ) + , m_bInSetCurrentUIVisibility( false ) { // Initialize statusbar member m_aStatusBarElement.m_aType = "statusbar"; @@ -783,6 +784,32 @@ void LayoutManager::implts_updateUIElementsVisibleState( bool bSetVisible ) { pSysWindow->SetMenuBar(pMenuBar); } +#ifdef MACOSX + // Related: tdf#161623 don't set the menubar to null on macOS + // When a window enters LibreOffice's internal full screen mode, + // the vcl code will hide the macOS menubar. However, if the + // window is also in native full screen mode, macOS will force + // the menubar to be visible. + // While the vcl code already partially handles this case by + // disabling all menu items when in LibreOffice's internal full + // screen mode, the problem is that any submenus that were not + // displayed before setting the menubar to null will show all + // menu items with no title. + // A simple way to reproduce this bug is to open a new Writer + // or Calc document and do the following: + // - Switch the window to LibreOffice's internal full screen + // mode by manually selecting the View > Full Screen menu + // item (the bug does not occur if its key shortcut is + // pressed) + // - Switch the window to native full screen mode + // - Click on the menubar and note that many of the submenus + // are displayed with menu items, but none of the menu items + // have a title + // So, we need to keep the menubar visible and rely on the vcl + // code to disable all menu items. + else if ( m_bInSetCurrentUIVisibility ) + pSysWindow->SetMenuBar(pMenuBar); +#endif else pSysWindow->SetMenuBar( nullptr ); } @@ -819,7 +846,10 @@ void LayoutManager::implts_setCurrentUIVisibility( bool bShow ) m_aStatusBarElement.m_bMasterHide = false; } + bool bOldInSetCurrentUIVisibility = m_bInSetCurrentUIVisibility; + m_bInSetCurrentUIVisibility = true; implts_updateUIElementsVisibleState( bShow ); + m_bInSetCurrentUIVisibility = bOldInSetCurrentUIVisibility; } void LayoutManager::implts_destroyStatusBar() commit f26ba21ec61d76729ff6a298198fc6e837a37abb Author: Xisco Fauli <[email protected]> AuthorDate: Thu Mar 27 10:25:59 2025 +0100 Commit: Andras Timar <[email protected]> CommitDate: Mon Apr 7 10:03:00 2025 +0200 related tdf#162786, tdf#159988: fix arm64 for linux Change-Id: Ia2670b3827880f4aba642390e68ffcc77dc63740 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183371 Reviewed-by: Guillaume Paquereau <[email protected]> Reviewed-by: Xisco Fauli <[email protected]> Tested-by: Jenkins (cherry picked from commit 315febd7ead36519b627bb3d8980b32f393c6062) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183471 Reviewed-by: Michael Stahl <[email protected]> diff --git a/external/python3/ExternalPackage_python3.mk b/external/python3/ExternalPackage_python3.mk index 9b2cf68cd6a8..64f8eb90b573 100644 --- a/external/python3/ExternalPackage_python3.mk +++ b/external/python3/ExternalPackage_python3.mk @@ -58,7 +58,12 @@ $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$( # Obviously this list should not contain stuff with external dependencies # that may not be available on baseline systems. -python3_EXTENSION_MODULE_SUFFIX=cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d)-x86_64-linux-gnu +ifeq ($(CPUNAME),AARCH64) +SOABI=-aarch64-linux-gnu +else +SOABI=-x86_64-linux-gnu +endif +python3_EXTENSION_MODULE_SUFFIX=cpython-$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)$(if $(ENABLE_DBGUTIL),d)$(SOABI) python3_EXTENSION_MODULES= \ LO_lib/array.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_asyncio.$(python3_EXTENSION_MODULE_SUFFIX).so \
