android/source/AndroidManifest.xml                                    |    1 
 android/source/src/java/org/libreoffice/ui/FileUtilities.java         |    1 
 android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |    1 
 bin/attachment_mimetypes.py                                           |    1 
 bin/generate-bash-completion.py                                       |    2 
 canvas/source/vcl/canvashelper.cxx                                    |   25 -
 filter/source/config/fragments/types/draw_Visio_Document.xcu          |    2 
 sc/source/ui/view/output2.cxx                                         |    4 
 scp2/source/draw/registryitem_draw.scp                                |    1 
 sw/qa/extras/layout/data/tdf161810.fodt                               |  204 
++++++++++
 sw/qa/extras/layout/layout3.cxx                                       |   35 +
 sw/qa/extras/ooxmlexport/ooxmlexport12.cxx                            |    6 
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx                             |    4 
 sw/qa/extras/ww8export/ww8export3.cxx                                 |   12 
 sw/source/core/layout/paintfrm.cxx                                    |    4 
 sw/source/core/text/itradj.cxx                                        |   11 
 sw/source/uibase/docvw/PostItMgr.cxx                                  |    4 
 vcl/inc/osx/vclnsapp.h                                                |    3 
 vcl/osx/salframeview.mm                                               |   10 
 vcl/osx/vclnsapp.mm                                                   |    5 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx                     |   13 
 writerfilter/source/dmapper/StyleSheetTable.cxx                       |   20 
 writerperfect/qa/unit/data/draw/libvisio/pass/Visio2013drawing.vsdx   |binary
 writerperfect/qa/unit/data/draw/libvisio/pass/Visio2013template.vstx  |binary
 24 files changed, 297 insertions(+), 72 deletions(-)

New commits:
commit 643871896fc64932536505f38b25cd505c8d5eb7
Author:     Michael Stahl <[email protected]>
AuthorDate: Wed Oct 2 18:51:44 2024 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Oct 13 15:23:58 2024 +0200

    tdf#163032 sw: fix painting of row frame with rowspan > 1 cell
    
    Super non intuitive representation of a rowspan > 1 cell split across
    pages is that the follow frame will be in a row that's 0 height, but its
    own height extends to the bottom of the following merged rows.
    
    (regression from commit 13495926390ba54fbcd45ec00fbe613b1f2b734b)
    
    Change-Id: I0e32477613ceb5b6dbcc590bf70e0b5fc62a5d0a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174399
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit d5fcc8ea25e416a4d2bea5e0f92c0e403997d845)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174336
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index d7d110de57e5..d677c87d382f 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3703,8 +3703,8 @@ SwShortCut::SwShortCut( const SwFrame& rFrame, const 
SwRect& rRect )
 
 void SwLayoutFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect 
const& rRect, SwPrintData const*const) const
 {
-    if (!getFramePrintArea().HasArea())
-    {
+    if (!getFramePrintArea().HasArea() && !IsRowFrame())
+    {   // tdf#163032 row frame may contain rowspan>1 cell that must be painted
         return; // do not paint hidden frame
     }
 
commit 52f1ef792c9a8a3bfa97d30c3298e58ff321e659
Author:     László Németh <[email protected]>
AuthorDate: Mon Sep 16 13:36:41 2024 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Oct 13 15:23:58 2024 +0200

    tdf#161810 sw smart justify: fix overhanging lines containing tabs
    
    Length of tabulator portions wasn't taken into account
    during calculating overhanging lines, resulting missing
    space shrinking.
    
    Regression from commit 17eaebee279772b6062ae3448012133897fc71bb
    "tdf#119908 sw smart justify: fix justification by shrinking".
    
    Change-Id: I34bb007940b91e861b24413e76c910ee62aed158
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173451
    Reviewed-by: László Németh <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 857dd6000c877f2c6d8bb73806a8557fa0baea73)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173486
    Reviewed-by: Xisco Fauli <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173649

diff --git a/sw/qa/extras/layout/data/tdf161810.fodt 
b/sw/qa/extras/layout/data/tdf161810.fodt
new file mode 100644
index 000000000000..5233d8c68335
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf161810.fodt
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:c
 alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext: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:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:
 meta:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:settings>
+  <config:config-item-set config:name="ooo:view-settings">
+   <config:config-item config:name="ViewAreaTop" 
config:type="long">0</config:config-item>
+   <config:config-item config:name="ViewAreaLeft" 
config:type="long">0</config:config-item>
+   <config:config-item config:name="ViewAreaWidth" 
config:type="long">27481</config:config-item>
+   <config:config-item config:name="ViewAreaHeight" 
config:type="long">16293</config:config-item>
+   <config:config-item config:name="ShowRedlineChanges" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="InBrowseMode" 
config:type="boolean">false</config:config-item>
+   <config:config-item-map-indexed config:name="Views">
+    <config:config-item-map-entry>
+     <config:config-item config:name="ViewId" 
config:type="string">view2</config:config-item>
+     <config:config-item config:name="ViewLeft" 
config:type="long">5039</config:config-item>
+     <config:config-item config:name="ViewTop" 
config:type="long">2300</config:config-item>
+     <config:config-item config:name="VisibleLeft" 
config:type="long">0</config:config-item>
+     <config:config-item config:name="VisibleTop" 
config:type="long">0</config:config-item>
+     <config:config-item config:name="VisibleRight" 
config:type="long">27480</config:config-item>
+     <config:config-item config:name="VisibleBottom" 
config:type="long">16291</config:config-item>
+     <config:config-item config:name="ZoomType" 
config:type="short">0</config:config-item>
+     <config:config-item config:name="ViewLayoutColumns" 
config:type="short">1</config:config-item>
+     <config:config-item config:name="ViewLayoutBookMode" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="ZoomFactor" 
config:type="short">140</config:config-item>
+     <config:config-item config:name="IsSelectedFrame" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="KeepRatio" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="AnchoredTextOverflowLegacy" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="LegacySingleLineFontwork" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="ConnectorUseSnapRect" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="IgnoreBreakAfterMultilineField" 
config:type="boolean">false</config:config-item>
+    </config:config-item-map-entry>
+   </config:config-item-map-indexed>
+  </config:config-item-set>
+  <config:config-item-set config:name="ooo:configuration-settings">
+   <config:config-item config:name="PrintProspectRTL" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintPageBackground" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintDrawings" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintFaxName" config:type="string"/>
+   <config:config-item config:name="PrintReversed" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintAnnotationMode" 
config:type="short">0</config:config-item>
+   <config:config-item config:name="PrintHiddenText" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintEmptyPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PaintHellOverHeaderFooter" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintGraphics" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="NoNumberingShowFollowBy" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="HyphenateURLs" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ImagePreferredDPI" 
config:type="int">0</config:config-item>
+   <config:config-item config:name="FootnoteInColumnToPageEnd" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="GutterAtTop" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ContinuousEndnotes" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="FrameAutowidthWithMorePara" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="SubtractFlysAnchoredAtFlys" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="SurroundTextWrapSmall" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintControls" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TreatSingleColumnBreakAsPageBreak" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TabOverSpacing" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AutoFirstLineIndentDisregardLineSpace" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TabOverMargin" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedComplexScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="EmbedAsianScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintTextPlaceholder" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ApplyTextAttrToEmptyLineAtEndOfParagraph" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedSystemFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="DisableOffPagePositioning" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="BackgroundParaOverDrawings" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TabOverflow" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AllowPrintJobCancel" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddVerticalFrameOffsets" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ProtectBookmarks" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddFrameOffsets" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintBlackFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TableRowKeep" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ApplyParagraphMarkFormatToNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrinterIndependentLayout" 
config:type="string">high-resolution</config:config-item>
+   <config:config-item config:name="JustifyLinesWithShrinking" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="RsidRoot" 
config:type="int">2040775</config:config-item>
+   <config:config-item config:name="PrintProspect" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CollapseEmptyCellPara" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintPaperFromSetup" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CurrentDatabaseCommand" 
config:type="string"/>
+   <config:config-item config:name="CurrentDatabaseDataSource" 
config:type="string"/>
+   <config:config-item config:name="SaveThumbnail" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="EmbeddedDatabaseName" 
config:type="string"/>
+   <config:config-item config:name="UnbreakableNumberings" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="SaveGlobalDocumentLinks" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordCompTrailingBlanks" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintTables" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintLeftPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddParaTableSpacing" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrinterPaperFromSetup" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CurrentDatabaseCommandType" 
config:type="int">0</config:config-item>
+   <config:config-item config:name="ChartAutoUpdate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="OutlineLevelYieldsNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseOldNumbering" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddParaSpacingToTableCells" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="FieldAutoUpdate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PropLineSpacingShrinksFirstLine" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TabAtLeftIndentForParagraphsInList" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintRightPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="DoNotCaptureDrawObjsOnPage" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="LoadReadonly" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="HeaderSpacingBelowLastPara" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="SaveVersionOnClose" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ClippedPictures" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MathBaselineAlignment" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AlignTabStopPosition" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="UseFormerLineSpacing" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrinterName" config:type="string"/>
+   <config:config-item config:name="AddParaLineSpacingToTableCells" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="IsKernAsianPunctuation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="DoNotJustifyLinesWithManualBreak" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="CharacterCompressionType" 
config:type="short">0</config:config-item>
+   <config:config-item config:name="IsLabelDocument" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedLatinScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
+   <config:config-item config:name="UseVariableWidthNBSP" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedOnlyUsedFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ApplyUserData" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddParaTableSpacingAtStart" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="InvertBorderSpacing" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ProtectFields" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddExternalLeading" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="LinkUpdateMode" 
config:type="short">1</config:config-item>
+   <config:config-item config:name="UseFormerObjectPositioning" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="UnxForceZeroExtLeading" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="UseFormerTextWrapping" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ConsiderTextWrapOnObjPos" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="StylesNoDefault" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="IgnoreFirstLineIndentInNumbering" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="NoGapAfterNoteNumber" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmptyDbFieldHidesPara" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="DoNotResetParaAttrsForNumFont" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="DropCapPunctuation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseOldPrinterMetrics" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="RedlineProtectionKey" 
config:type="base64Binary"/>
+   <config:config-item config:name="TabsRelativeToIndent" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="Rsid" 
config:type="int">2157109</config:config-item>
+   <config:config-item config:name="UpdateFromTemplate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ProtectForm" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordCompMinLineHeightByFly" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="SmallCapsPercentage66" 
config:type="boolean">true</config:config-item>
+  </config:config-item-set>
+ </office:settings>
+ <office:font-face-decls>
+  <style:font-face style:name="Liberation Sans" 
svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" 
style:font-pitch="variable"/>
+  <style:font-face style:name="Liberation Serif" 
svg:font-family="&apos;Liberation Serif&apos;" 
style:font-family-generic="roman" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+  <style:default-style style:family="graphic">
+   <style:graphic-properties svg:stroke-color="#3465a4" 
draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" 
draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" 
draw:start-line-spacing-vertical="0.283cm" 
draw:end-line-spacing-horizontal="0.283cm" 
draw:end-line-spacing-vertical="0.283cm" style:writing-mode="lr-tb" 
style:flow-with-text="false"/>
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" 
style:line-break="strict" loext:tab-stop-distance="0cm" 
style:font-independent-line-spacing="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties style:use-window-font-color="true" 
loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" 
fo:language="hu" fo:country="HU" style:letter-kerning="true"/>
+  </style:default-style>
+  <style:default-style style:family="paragraph">
+   <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" 
fo:hyphenation-keep="auto" loext:hyphenation-keep-type="column" 
style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" 
style:line-break="strict" style:tab-stop-distance="1.251cm" 
style:writing-mode="page"/>
+   <style:text-properties style:use-window-font-color="true" 
loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" 
fo:language="hu" fo:country="HU" style:letter-kerning="true" 
fo:hyphenate="false" fo:hyphenation-remain-char-count="2" 
fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false" 
loext:hyphenation-no-last-word="false" loext:hyphenation-word-char-count="5" 
loext:hyphenation-zone="no-limit"/>
+  </style:default-style>
+  <style:default-style style:family="table">
+   <style:table-properties table:border-model="collapsing"/>
+  </style:default-style>
+  <style:default-style style:family="table-row">
+   <style:table-row-properties fo:keep-together="auto"/>
+  </style:default-style>
+  <style:style style:name="Standard" style:family="paragraph" 
style:class="text">
+   <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" 
style:contextual-spacing="false" fo:text-align="justify" 
style:justify-single-word="false"/>
+   <style:text-properties style:font-name="Liberation Sans" 
fo:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" 
style:font-pitch="variable" fo:font-size="14pt" fo:language="la" 
fo:country="VA"/>
+  </style:style>
+  <style:style style:name="Text_20_body" style:display-name="Text body" 
style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+   <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.247cm" 
style:contextual-spacing="false" fo:line-height="115%"/>
+  </style:style>
+ </office:styles>
+ <office:automatic-styles>
+  <style:style style:name="P1" style:family="paragraph" 
style:parent-style-name="Standard">
+   <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" 
fo:hyphenation-keep="auto" loext:hyphenation-keep-type="column"/>
+   <style:text-properties fo:hyphenate="false" 
fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" 
loext:hyphenation-no-caps="false" loext:hyphenation-no-last-word="false" 
loext:hyphenation-word-char-count="5" loext:hyphenation-zone="no-limit" 
loext:hyphenation-compound-remain-char-count="2"/>
+  </style:style>
+  <style:style style:name="T1" style:family="text">
+   <style:text-properties officeooo:rsid="001f23c7"/>
+  </style:style>
+  <style:page-layout style:name="pm1">
+   <style:page-layout-properties fo:page-width="21.001cm" 
fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" 
fo:margin-top="1.799cm" fo:margin-bottom="1.799cm" fo:margin-left="1.799cm" 
fo:margin-right="1.799cm" style:writing-mode="lr-tb" 
style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" 
style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" 
style:layout-grid-mode="none" style:layout-grid-ruby-below="false" 
style:layout-grid-print="false" style:layout-grid-display="false" 
style:footnote-max-height="0cm" loext:margin-gutter="0cm">
+    <style:footnote-sep style:width="0.018cm" 
style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" 
style:line-style="solid" style:adjustment="left" style:rel-width="25%" 
style:color="#000000"/>
+   </style:page-layout-properties>
+   <style:header-style/>
+   <style:footer-style/>
+  </style:page-layout>
+  <style:style style:name="dp1" style:family="drawing-page">
+   <style:drawing-page-properties draw:background-size="full"/>
+  </style:style>
+ </office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Standard" style:page-layout-name="pm1" 
draw:style-name="dp1"/>
+ </office:master-styles>
+ <office:body>
+  <office:text>
+   <text:p text:style-name="P1"><text:tab/>Quis pretium semper. Proin luctus 
orci ac neque venenatis, quis com mo do dolors.</text:p>
+  </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx
index cb1ea6cc5614..d0c4c414ff05 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -13,6 +13,7 @@
 #include <com/sun/star/text/WrapTextMode.hpp>
 #include <com/sun/star/text/XTextSectionsSupplier.hpp>
 #include <vcl/event.hxx>
+#include <vcl/metaact.hxx>
 #include <vcl/scheduler.hxx>
 #include <editeng/fontitem.hxx>
 #include <editeng/fhgtitem.hxx>
@@ -389,6 +390,40 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf162725)
     assertXPath(pXmlDoc, 
"/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwGluePortion"_ostr);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf161810)
+{
+    createSwDoc("tdf161810.fodt");
+    // Ensure that all text portions are calculated before testing.
+    SwDoc* pDoc = getSwDoc();
+    SwDocShell* pShell = pDoc->GetDocShell();
+
+    // Dump the rendering of the first page as an XML file.
+    std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+    MetafileXmlDump dumper;
+
+    xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+    CPPUNIT_ASSERT(pXmlDoc);
+
+    // Find the first text array action
+    for (size_t nAction = 0; nAction < xMetaFile->GetActionSize(); nAction++)
+    {
+        auto pAction = xMetaFile->GetAction(nAction);
+        if (pAction->GetType() == MetaActionType::TEXTARRAY)
+        {
+            auto pTextArrayAction = static_cast<MetaTextArrayAction*>(pAction);
+            auto pDXArray = pTextArrayAction->GetDXArray();
+
+            // There should be 73 chars on the first line
+            CPPUNIT_ASSERT_EQUAL(size_t(73), pDXArray.size());
+
+            // Assert we are using the expected position for the last char
+            // This was 9369, now 9165, according to the fixed space shrinking
+            CPPUNIT_ASSERT_LESS(sal_Int32(9300), pDXArray[72]);
+            break;
+        }
+    }
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf106234)
 {
     createSwDoc("tdf106234.fodt");
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 0d84cd661644..4e2650d2f494 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -58,10 +58,9 @@ void SwTextAdjuster::FormatBlock( )
         const SwLinePortion *pPos = m_pCurr->GetNextPortion();
         while( pPos && bSkip )
         {
-            if( !pPos->InGlueGrp() &&
-                // don't calculate with the terminating space,
+            if( // don't calculate with the terminating space,
                 // otherwise it would result justified line mistakenly
-                ( pPos->GetNextPortion() || !pPos->IsHolePortion() ) )
+                pPos->GetNextPortion() || !pPos->IsHolePortion() )
             {
                 nBreakWidth += pPos->Width();
             }
@@ -321,6 +320,8 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
 
     while( pPos )
     {
+        nBreakWidth += pPos->Width();
+
         if ( ( bDoNotJustifyLinesWithManualBreak || bDoNotJustifyTab ) &&
              pPos->IsBreakPortion() && !IsLastBlock() )
         {
@@ -435,10 +436,6 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
             else
                 ++nGluePortion;
         }
-        else
-        {
-            nBreakWidth += pPos->Width();
-        }
         GetInfo().SetIdx( GetInfo().GetIdx() + pPos->GetLen() );
         if ( pPos == pStopAt )
         {
commit 31c4cf23f4599b21148ef3dc7bdb0d73f254a3bf
Author:     Justin Luth <[email protected]>
AuthorDate: Wed Sep 11 14:07:39 2024 -0400
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Oct 13 15:23:58 2024 +0200

    related tdf#162884 writerfilter: map to built-in Internet link, etc.
    
    This partial revert fixes a 24.2.4 regression from
    commit 72ea1005b987159a6a59f9379e63321e0b0dd44f
    Author: Michael Stahl on Mon May 6 15:58:36 2024 +0200
        tdf#160402 writerfilter: extend StyleMap with all Word styles
    
    By using the English localization name,
    the style was imported, used, and exported as English
    instead of being mapped to the built-in style
    whose name depends on the UI language in use.
    So, revert back to using the internal version of the style names.
    
    For English -> Dutch, that means that
    Internet Link -> (MS Word's) Hyperlink -> Internetkoppeling
    instead of remaining as the English "Internet Link"
    
    For non-English UIs, the Internet Link character style
    was duplicating on each file save (or perhaps each language switch).
    
    I didn't notice the endless duplication for the other styles,
    because they aren't used very much,
    and are only written if used.
    At worst, each localized versions was written once.
    
    Change-Id: Icf58d7d716ac40f05f170c31787d8a8a9942868e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173230
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174280
    Reviewed-by: Michael Stahl <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174351
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index a91723b4f6d5..c801d0477fe5 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -687,8 +687,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112352_nextPageColumns, 
"tdf112352_nextPageColum
 CPPUNIT_TEST_FIXTURE(Test, testTdf109310_endnoteStyleForMSO)
 {
     loadAndSave("tdf109310_endnoteStyleForMSO.docx");
-    xmlDocUniquePtr pXmlDoc = parseExport("word/endnotes.xml");
-    // Check w:rStyle element has w:val attribute - note that w: is not 
specified for attribute
+    xmlDocUniquePtr pXmlDoc = parseExport(u"word/endnotes.xml"_ustr);
+    // It is important that EndnoteCharacters exists, and is not duplicated on 
each round-trip
     assertXPath(pXmlDoc, 
"/w:endnotes/w:endnote[@w:id='2']/w:p/w:r[1]/w:rPr/w:rStyle"_ostr, "val"_ostr,
                 u"EndnoteCharacters"_ustr);
 }
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 4477a390b29b..5c1b0706d27f 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1580,8 +1580,6 @@ StyleSheetTable::ConvertStyleName(const OUString& rWWName)
     // These are from the w:latentStyles in the styles.xml of a Word 15.0 DOCX,
     // plus some pre-existing additions and variants.
     static const std::map< OUString, OUString> StyleNameMap {
-//        FIXME: testFdo77716, testTdf129575_docDefault etc. fail with correct 
mapping
-//        { "Normal", "Default Paragraph Style" }, // RES_POOLCOLL_STANDARD
         { "Normal", "Standard" }, // RES_POOLCOLL_STANDARD
         { "heading 1", "Heading 1" }, // RES_POOLCOLL_HEADLINE1
         { "heading 2", "Heading 2" }, // RES_POOLCOLL_HEADLINE2
@@ -1669,8 +1667,8 @@ StyleSheetTable::ConvertStyleName(const OUString& rWWName)
         { "Footnote Reference", "Footnote Symbol" }, // RES_POOLCHR_FOOTNOTE; 
tdf#82173 tdf#162884
         { "Annotation Reference", "" },
         { "annotation reference", "" },
-        { "Line Number", "Line Numbering" }, // RES_POOLCHR_LINENUM
-        { "line number", "Line Numbering" }, // RES_POOLCHR_LINENUM
+        { "Line Number", "Line numbering" }, // RES_POOLCHR_LINENUM
+        { "line number", "Line numbering" }, // RES_POOLCHR_LINENUM
         { "Page Number", "Page Number" }, // RES_POOLCHR_PAGENO
         { "page number", "Page Number" }, // RES_POOLCHR_PAGENO
         { "PageNumber", "Page Number" }, // RES_POOLCHR_PAGENO
@@ -1703,13 +1701,11 @@ StyleSheetTable::ConvertStyleName(const OUString& 
rWWName)
         { "Signature", "Signature" }, // RES_POOLCOLL_SIGNATURE
         { "Default Paragraph Font", "" },
         { "DefaultParagraphFont", "" },
-//        FIXME: testTdf118947_tableStyle fails with correct mapping
-//        { "Body Text", "Body Text" }, // RES_POOLCOLL_TEXT
         { "Body Text", "Text body" }, // RES_POOLCOLL_TEXT
-        { "BodyText", "Body Text" }, // RES_POOLCOLL_TEXT
+        { "BodyText", "Text body" }, // RES_POOLCOLL_TEXT
         { "BodyTextIndentItalic", "" },
-        { "Body Text Indent", "Body Text, Indented" }, // 
RES_POOLCOLL_TEXT_MOVE
-        { "BodyTextIndent", "Body Text, Indented" }, // RES_POOLCOLL_TEXT_MOVE
+        { "Body Text Indent", "Text body indent" }, // RES_POOLCOLL_TEXT_MOVE
+        { "BodyTextIndent", "Text body indent" }, // RES_POOLCOLL_TEXT_MOVE
         { "BodyTextIndent2", "" },
         { "List Continue", "List 1 Cont." }, // RES_POOLCOLL_BULLET_NONUM1
         { "List Continue 2", "List 2 Cont." }, // RES_POOLCOLL_BULLET_NONUM2
@@ -1718,9 +1714,9 @@ StyleSheetTable::ConvertStyleName(const OUString& rWWName)
         { "List Continue 5", "List 5 Cont." }, // RES_POOLCOLL_BULLET_NONUM5
         { "Message Header", "" },
         { "Subtitle", "Subtitle" }, // RES_POOLCOLL_DOC_SUBTITLE
-        { "Salutation", "Complimentary Close" }, // RES_POOLCOLL_GREETING
+        { "Salutation", "Salutation" }, // RES_POOLCOLL_GREETING
         { "Date", "" },
-        { "Body Text First Indent", "First Line Indent" }, // 
RES_POOLCOLL_TEXT_IDENT
+        { "Body Text First Indent", "First line indent" }, // 
RES_POOLCOLL_TEXT_IDENT
         { "Body Text First Indent 2", "" },
         { "Note Heading", "" },
         { "Body Text 2", "" },
@@ -1728,7 +1724,7 @@ StyleSheetTable::ConvertStyleName(const OUString& rWWName)
         { "Body Text Indent 2", "" },
         { "Body Text Indent 3", "" },
         { "Block Text", "" },
-        { "Hyperlink", "Internet Link" }, // RES_POOLCHR_INET_NORMAL
+        { "Hyperlink", "Internet link" }, // RES_POOLCHR_INET_NORMAL
         { "FollowedHyperlink", "Visited Internet Link" }, // 
RES_POOLCHR_INET_VISIT
         { "Strong", "Strong Emphasis" }, // RES_POOLCHR_HTML_STRONG
         { "Emphasis", "Emphasis" }, // RES_POOLCHR_HTML_EMPHASIS
commit 9eb5896134d5aad648aa61236cd7e7e4dcb85bc7
Author:     Justin Luth <[email protected]>
AuthorDate: Fri Sep 27 17:03:53 2024 -0400
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Oct 13 15:23:58 2024 +0200

    tdf#163154 revert "tdf120224 writerfilter: consume excess bookmark
    
    ... from fields"
    
    The intention of my 6.2 commit 579c0749bef8c980507229439715e72060c1b077
    hack was to avoid importing duplicate LO-exported bookmarks.
    (LO exported the bookmarks inside the field definition,
    while MS normally has the bookmarks outside the field.)
    
    So the impact of this revert should be neglible,
    affecting mainly documents that LO round-tripped before 6.2
    which would just import one more "Copy" of a bookmark.
    
    The reason for doing the revert is also not terribly important.
    For a few odd documents that otherwise wouldn't import a bookmark
    around a field, it will allow the LO navigator a way to quickly
    jump to the field (since Legacy Fields are not included
    in the Navigator's field list).
    
    Note that what I am reverting was a HACK any way.
    It did a pretty good job of only ignoring LO-exported bookmarks,
    since MS Word usually puts the bookmark around the OUTSIDE
    of the field, while LO always puts the bookmark
    inside the field definition (and thus IsOpenField())
    
    make CppunitTest_sw_ww8export3 \
        CPPUNIT_TEST_NAME=testTdf79435_legacyInputFields
    
    make CppunitTest_sw_ooxmlexport12 \
        CPPUNIT_TEST_NAME=testTdf120224_textControlCrossRef
    
    Change-Id: Iefaf1173794c66b2a6f3e5c2143ed594de7efe35
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174081
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>
    (cherry picked from commit 7f84c993d3d2b5f05b18e740fea960901da57f80)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174020
    Reviewed-by: Michael Stahl <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174309

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index c77936a8d66c..aff6a689a9dd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -800,6 +800,10 @@ 
DECLARE_OOXMLEXPORT_TEST(testTdf120224_textControlCrossRef, "tdf120224_textContr
     xRunEnum->nextElement(); //Text
     uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), 
uno::UNO_QUERY);
 
+    CPPUNIT_ASSERT_EQUAL(OUString("Bookmark"),
+                         getProperty<OUString>(xPropertySet, 
"TextPortionType"));
+
+    xPropertySet.set(xRunEnum->nextElement(), uno::UNO_QUERY);
     CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStart"),
                          getProperty<OUString>(xPropertySet, 
"TextPortionType"));
     uno::Reference<container::XNamed> xBookmark(
@@ -819,7 +823,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120224_textControlCrossRef, 
"tdf120224_textContr
     uno::Reference<container::XIndexAccess> 
xBookmarksByIdx(xBookmarksSupplier->getBookmarks(),
                                                             uno::UNO_QUERY);
     // TextFields should not be turned into real bookmarks.
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), 
xBookmarksByIdx->getCount());
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), 
xBookmarksByIdx->getCount());
 
     // The actual name isn't critical, but if it fails, it is worth asking why.
     CPPUNIT_ASSERT_EQUAL(OUString("Text1"), sTextFieldName);
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx 
b/sw/qa/extras/ww8export/ww8export3.cxx
index 66c5ae5c471c..94420cc3c9da 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -416,7 +416,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79435_legacyInputFields)
 {
     loadAndReload("tdf79435_legacyInputFields.docx");
     //using .docx input file to verify cross-format compatibility.
-    uno::Reference<text::XFormField> xFormField = getProperty< 
uno::Reference<text::XFormField> >(getRun(getParagraph(5), 3), "Bookmark");
+    uno::Reference<text::XFormField> xFormField = getProperty< 
uno::Reference<text::XFormField> >(getRun(getParagraph(5), 4), "Bookmark");
     uno::Reference<container::XNameContainer> 
xParameters(xFormField->getParameters());
 
     OUString sTmp;
@@ -440,27 +440,27 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79435_legacyInputFields)
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Max Length", sal_uInt16(10), nMaxLength);
 
     // too bad this is based on character runs - just found try trial and 
error.
-    xFormField = getProperty< uno::Reference<text::XFormField> 
>(getRun(getParagraph(6), 2), "Bookmark");
+    xFormField = getProperty< uno::Reference<text::XFormField> 
>(getRun(getParagraph(6), 3), "Bookmark");
     xParameters.set(xFormField->getParameters());
     xParameters->getByName("Type") >>= sTmp;
     CPPUNIT_ASSERT_EQUAL(OUString("calculated"), sTmp);
 
-    xFormField = getProperty< uno::Reference<text::XFormField> 
>(getRun(getParagraph(7), 2), "Bookmark");
+    xFormField = getProperty< uno::Reference<text::XFormField> 
>(getRun(getParagraph(7), 3), "Bookmark");
     xParameters.set(xFormField->getParameters());
     xParameters->getByName("Type") >>= sTmp;
     CPPUNIT_ASSERT_EQUAL(OUString("currentDate"), sTmp);
 
-    xFormField = getProperty< uno::Reference<text::XFormField> 
>(getRun(getParagraph(7), 7), "Bookmark");
+    xFormField = getProperty< uno::Reference<text::XFormField> 
>(getRun(getParagraph(7), 10), "Bookmark");
     xParameters.set(xFormField->getParameters());
     xParameters->getByName("Type") >>= sTmp;
     CPPUNIT_ASSERT_EQUAL(OUString("currentTime"), sTmp);
 
-    xFormField = getProperty< uno::Reference<text::XFormField> 
>(getRun(getParagraph(8), 2), "Bookmark");
+    xFormField = getProperty< uno::Reference<text::XFormField> 
>(getRun(getParagraph(8), 3), "Bookmark");
     xParameters.set(xFormField->getParameters());
     xParameters->getByName("Type") >>= sTmp;
     CPPUNIT_ASSERT_EQUAL(OUString("number"), sTmp);
 
-    xFormField = getProperty< uno::Reference<text::XFormField> 
>(getRun(getParagraph(8), 7), "Bookmark");
+    xFormField = getProperty< uno::Reference<text::XFormField> 
>(getRun(getParagraph(8), 10), "Bookmark");
     xParameters.set(xFormField->getParameters());
     xParameters->getByName("Type") >>= sTmp;
     CPPUNIT_ASSERT_EQUAL(OUString("date"), sTmp);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 99eb372dce20..e61f8aaea99d 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -8934,19 +8934,6 @@ void DomainMapper_Impl::SetBookmarkName( const OUString& 
rBookmarkName )
     BookmarkMap_t::iterator aBookmarkIter = m_aBookmarkMap.find( 
m_sCurrentBkmkId );
     if( aBookmarkIter != m_aBookmarkMap.end() )
     {
-        // fields are internal bookmarks: consume redundant "normal" bookmark
-        if ( IsOpenField() )
-        {
-            FFDataHandler::Pointer_t  
pFFDataHandler(GetTopFieldContext()->getFFDataHandler());
-            if (pFFDataHandler && pFFDataHandler->getName() == rBookmarkName)
-            {
-                // HACK: At the END marker, StartOrEndBookmark will START
-                // a bookmark which will eventually be abandoned, not created.
-                m_aBookmarkMap.erase(aBookmarkIter);
-                return;
-            }
-        }
-
         if ((m_sCurrentBkmkPrefix == "__RefMoveFrom__"
              || m_sCurrentBkmkPrefix == "__RefMoveTo__")
             && std::find(m_aRedlineMoveIDs.begin(), m_aRedlineMoveIDs.end(), 
rBookmarkName)
commit a6f52bbdc43feb955fe89438933f8f32acffde77
Author:     Julien Nabet <[email protected]>
AuthorDate: Sun Sep 29 22:00:58 2024 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Oct 13 15:17:14 2024 +0200

    tdf#158323: CRASH when switch back from HTML to Normal View...
    
    after edit in HTML code.
    
    bt:
    0  rtl::Reference<SfxStyleSheetPool>::get (this=0xb8) at 
include/rtl/ref.hxx:205
    1  0x00007f4361f3857c in SwDocStyleSheetPool::GetEEStyleSheetPool 
(this=0x0) at sw/inc/docstyle.hxx:236
    2  0x00007f4362dcb8e2 in SwPostItMgr::SwPostItMgr (this=0x558439087f60, 
pView=0x5584387f7e80) at 
/home/julien/lo/libreoffice/sw/source/uibase/docvw/PostItMgr.cxx:229
    3  0x00007f43630e6b14 in SwView::SwView (this=0x5584387f7e80, _rFrame=..., 
pOldSh=0x5584356fa360) at 
/home/julien/lo/libreoffice/sw/source/uibase/uiview/view.cxx:1003
    4  0x00007f43632fee79 in SwWebView::SwWebView (this=0x5584387f7e80, 
_rFrame=..., _pShell=0x5584356fa360) at 
/home/julien/lo/libreoffice/sw/source/uibase/web/wview.cxx:85
    5  0x00007f43632feb51 in SwWebView::CreateInstance (rFrame=..., 
pOldView=0x5584356fa360) at 
/home/julien/lo/libreoffice/sw/source/uibase/web/wview.cxx:67
    6  0x00007f4393710655 in SfxViewFactory::CreateInstance 
(this=0x558434c3a090, rFrame=..., pOldSh=0x5584356fa360) at 
/home/julien/lo/libreoffice/sfx2/source/view/viewfac.cxx:26
    7  0x00007f4393501e31 in SfxBaseModel::createViewController
       (this=0x558431de5a80, i_rViewName="Default", i_rArguments=empty 
uno::Sequence, i_rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 
0x5584360bf520)
       at /home/julien/lo/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:4334
    8  0x00007f4393502a3f in non-virtual thunk to 
SfxBaseModel::createViewController(rtl::OUString const&, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, 
com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) () at 
/home/julien/lo/libreoffice/instdir/program/libsfxlo.so
    9  0x00007f43936b4ce4 in (anonymous 
namespace)::SfxFrameLoader_Impl::impl_createDocumentView
       (i_rModel=uno::Reference to (SwXTextDocument *) 0x558431de5b10, 
i_rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 
0x5584360bf520, i_rViewFactoryArgs=..., i_rViewName="Default")
       at /home/julien/lo/libreoffice/sfx2/source/view/frmload.cxx:577
    10 0x00007f43936b1f6c in (anonymous namespace)::SfxFrameLoader_Impl::load
       (this=0x558436633660, rArgs=uno::Sequence of length 18 = {...}, 
_rTargetFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 
0x5584360bf520)
       at /home/julien/lo/libreoffice/sfx2/source/view/frmload.cxx:759
    11 0x00007f439441ea51 in framework::LoadEnv::impl_loadContent 
(this=0x7ffdd69352c8) at 
/home/julien/lo/libreoffice/framework/source/loadenv/loadenv.cxx:1176
    12 0x00007f439441b7d4 in framework::LoadEnv::start (this=0x7ffdd69352c8) at 
/home/julien/lo/libreoffice/framework/source/loadenv/loadenv.cxx:412
    
    Regression from:
    
https://git.libreoffice.org/core/+/d934aeace6e7049db3959421538ae382cb97b1d1%5E%21
    tdf#103064 sw,editeng: make para styles work inside comments
    
    Change-Id: Ib9a1c9fe779ad14f93de0e1b3645beddb85e511d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174210
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    Reviewed-by: Julien Nabet <[email protected]>
    (cherry picked from commit c6cc724d8805215c7b5ad7b76cd167c6640e8e52)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174018
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit 06bf06c0341147688b8162e17fa70c1dec16885d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174322

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index 4768a62f1339..b964ba685260 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -229,7 +229,9 @@ SwPostItMgr::SwPostItMgr(SwView* pView)
     StartListening(*mpView->GetDocShell());
     // listen to stylesheet pool to update on stylesheet rename,
     // as EditTextObject references styles by name.
-    
StartListening(*static_cast<SwDocStyleSheetPool*>(mpView->GetDocShell()->GetStyleSheetPool())->GetEEStyleSheetPool());
+    SfxStyleSheetBasePool* pStyleSheetPool = 
mpView->GetDocShell()->GetStyleSheetPool();
+    if (pStyleSheetPool)
+        
StartListening(*static_cast<SwDocStyleSheetPool*>(pStyleSheetPool)->GetEEStyleSheetPool());
     if (!mvPostItFields.empty())
     {
         mbWaitingForCalcRects = true;
commit 8bff1d6e15ffed0782a2e31e0aca3ac9a0239dc7
Author:     Patrick Luby <[email protected]>
AuthorDate: Fri Feb 23 17:45:19 2024 -0500
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Oct 13 15:17:14 2024 +0200

    tdf#158124 KEY_DELETE events do not need an ExtTextInput event
    
    When using various Japanese input methods, the last event will be a
    repeating key down event with a single delete character while the
    Backspace key, Delete key, or Fn-Delete keys are pressed. These key
    events are now ignored since setting mbTextInputWantsNonRepeatKeyDown
    to YES for these events will trigger an assert or crash when saving a
    .docx document.
    
    Change-Id: If3762fcf41aa82bf4aa5dc7d1f15c1d282c86f99
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163875
    Tested-by: Jenkins
    Reviewed-by: Patrick Luby <[email protected]>
    (cherry picked from commit ef57aeb9ed190e18ebc034b9a45e190aea3f8f1d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174024
    Reviewed-by: Ilmari Lauhakangas <[email protected]>

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 995eeb574999..dba377899838 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -2062,7 +2062,15 @@ static void updateWinDataInLiveResize(bool bInLiveResize)
     // and then dispatch a SalEvent::EndExtTextInput event.
     NSString *pNewMarkedText = nullptr;
     NSString *pChars = [mpLastEvent characters];
-    bool bNeedsExtTextInput = ( pChars && mbInKeyInput && !mpLastMarkedText && 
mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent 
isARepeat] );
+
+    // tdf#158124 KEY_DELETE events do not need an ExtTextInput event
+    // When using various Japanese input methods, the last event will be a
+    // repeating key down event with a single delete character while the
+    // Backspace key, Delete key, or Fn-Delete keys are pressed. These key
+    // events are now ignored since setting mbTextInputWantsNonRepeatKeyDown
+    // to YES for these events will trigger an assert or crash when saving a
+    // .docx document.
+    bool bNeedsExtTextInput = ( pChars && mbInKeyInput && !mpLastMarkedText && 
mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent 
isARepeat] && ImplMapKeyCode( [mpLastEvent keyCode] ) != KEY_DELETE );
     if ( bNeedsExtTextInput )
     {
         // tdf#154708 Preserve selection for repeating Shift-arrow on Japanese 
keyboard
commit 218810884ae77fe8735da0474ca114181e2bab60
Author:     Bartosz Kosiorek <[email protected]>
AuthorDate: Thu Sep 26 20:37:17 2024 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Oct 13 15:17:14 2024 +0200

    tdf#163170 Add support for MS Visio Template format with .vstx extension
    
    libvisio is already supporting .vstx template format.
    With this patch the LibreOffice is recognizing such file types,
    and successfully opening it.
    
    More information about format:
    
https://learn.microsoft.com/en-us/office/client-developer/visio/introduction-to-the-visio-file-formatvsdx
    
    Change-Id: Ibee01288cdb2cd6a0ac3f371a22604d7bb5b471c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173997
    Tested-by: Jenkins
    Reviewed-by: Bartosz Kosiorek <[email protected]>
    (cherry picked from commit 529dfc741a4ad6735937adaf10acdd567da4f84c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174012
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/android/source/AndroidManifest.xml 
b/android/source/AndroidManifest.xml
index 0a11a1d3654b..46c11b4e87ba 100644
--- a/android/source/AndroidManifest.xml
+++ b/android/source/AndroidManifest.xml
@@ -61,6 +61,7 @@
                 <data android:mimeType="application/vnd.ms-powerpoint" />
                 <data android:mimeType="application/vnd.ms-excel"/>
                 <data android:mimeType="application/vnd.visio" />
+                <data android:mimeType="application/vnd.visio2013" />
                 <data android:mimeType="application/vnd.visio.xml" />
                 <data android:mimeType="application/x-mspublisher" />
 
diff --git a/android/source/src/java/org/libreoffice/ui/FileUtilities.java 
b/android/source/src/java/org/libreoffice/ui/FileUtilities.java
index 7fc8c3c84eb1..f7fa856217fc 100644
--- a/android/source/src/java/org/libreoffice/ui/FileUtilities.java
+++ b/android/source/src/java/org/libreoffice/ui/FileUtilities.java
@@ -70,6 +70,7 @@ public class FileUtilities {
         mExtnMap.put(".dot",  DOC);
         mExtnMap.put(".pot",  IMPRESS);
         mExtnMap.put(".xlt",  CALC);
+        mExtnMap.put(".vstx", DRAWING);
 
         // OOXML
         mExtnMap.put(".docx", DOC);
diff --git 
a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java 
b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index bc5203d9c6eb..1b3bc7e75e4a 100644
--- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -99,6 +99,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity 
implements Settings
             "application/vnd.ms-powerpoint",
             "application/vnd.ms-excel",
             "application/vnd.visio",
+            "application/vnd.visio2013",
             "application/vnd.visio.xml",
             "application/x-mspublisher",
             
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
diff --git a/bin/attachment_mimetypes.py b/bin/attachment_mimetypes.py
index ede5fcb39fb9..40eebb8297d5 100644
--- a/bin/attachment_mimetypes.py
+++ b/bin/attachment_mimetypes.py
@@ -61,6 +61,7 @@ mimetypes = {
     'application/vnd.visio': 'vsd',
     'application/visio.drawing': 'vsd',
     'application/vnd.visio2013': 'vsdx',
+    'application/vnd.visio2013': 'vstx',
     'application/vnd.visio.xml': 'vdx',
     'application/x-mspublisher': 'pub',
 #WPS Office
diff --git a/bin/generate-bash-completion.py b/bin/generate-bash-completion.py
index 1c0377b97387..c7366df4674e 100755
--- a/bin/generate-bash-completion.py
+++ b/bin/generate-bash-completion.py
@@ -27,7 +27,7 @@ DRAWDOCS = ["sxd", "std", "dxf", "emf", "eps", "met", "pct", 
"sgf", "sgv", "sda"
             "sdd", "vor", "svm", "wmf", "bmp", "gif", "jpg", "jpeg", "jfif", 
"fif",
             "jpe", "pcd", "pcx", "pgm", "png", "ppm", "psd", "ras", "tga", 
"tif",
             "tiff", "xbm", "xpm", "odg", "otg", "fodg", "odc", "odi", "sds",
-            "wpg", "svg", "vdx", "vsd", "vsdm", "vsdx", "pdf"]
+            "wpg", "svg", "vdx", "vsd", "vsdm", "vsdx", "vstx", "pdf"]
 
 IMPRESSDOCS = ["sxi", "sti", "ppt", "pps", "pot", "sxd", "sda", "sdd", "sdp",
                "vor", "cgm", "odp", "otp", "fodp", "ppsm", "ppsx", "pptm", 
"pptx",
diff --git a/filter/source/config/fragments/types/draw_Visio_Document.xcu 
b/filter/source/config/fragments/types/draw_Visio_Document.xcu
index b6c6992a389c..d43dc8c81dc4 100644
--- a/filter/source/config/fragments/types/draw_Visio_Document.xcu
+++ b/filter/source/config/fragments/types/draw_Visio_Document.xcu
@@ -18,7 +18,7 @@
         <node oor:name="draw_Visio_Document" oor:op="replace" >
             <prop 
oor:name="DetectService"><value>com.sun.star.comp.Draw.VisioImportFilter</value></prop>
             <prop oor:name="URLPattern"/>
-            <prop oor:name="Extensions"><value>vdx vsd vsdm vsdx</value></prop>
+            <prop oor:name="Extensions"><value>vdx vsd vsdm vsdx 
vstx</value></prop>
             <prop 
oor:name="MediaType"><value>application/vnd.visio</value></prop>
             <prop oor:name="Preferred"><value>true</value></prop>
             <prop oor:name="PreferredFilter"><value>Visio 
Document</value></prop>
diff --git a/scp2/source/draw/registryitem_draw.scp 
b/scp2/source/draw/registryitem_draw.scp
index 99bc96399805..f2012686579c 100644
--- a/scp2/source/draw/registryitem_draw.scp
+++ b/scp2/source/draw/registryitem_draw.scp
@@ -1059,6 +1059,7 @@ CONDITIONAL_REGISTER_DOC_EXTENSION( Vsd,  
gid_Module_Prg_Draw_MSO_Reg, vsd,  VSD
 CONDITIONAL_REGISTER_DOC_EXTENSION( Vdx,  gid_Module_Prg_Draw_MSO_Reg, vdx,  
VDX,  MS_VISIO_DOCUMENT, 5, sdraw.exe, open, Draw )
 CONDITIONAL_REGISTER_DOC_EXTENSION( Vsdm,  gid_Module_Prg_Draw_MSO_Reg, vsdm,  
VSDM,  MS_VISIO_DOCUMENT, 5, sdraw.exe, open, Draw )
 CONDITIONAL_REGISTER_DOC_EXTENSION( Vsdx,  gid_Module_Prg_Draw_MSO_Reg, vsdx,  
VSDX,  MS_VISIO_DOCUMENT, 5, sdraw.exe, open, Draw )
+CONDITIONAL_REGISTER_DOC_EXTENSION( Vstx,  gid_Module_Prg_Draw_MSO_Reg, vstx,  
VSTX,  MS_VISIO_DOCUMENT, 5, sdraw.exe, open, Draw )
 CONDITIONAL_REGISTER_DOC_EXTENSION( Pub,  gid_Module_Prg_Draw_MSO_Reg, pub,  
PUB,  MS_PUBLISHER_DOCUMENT, 5, sdraw.exe, open, Draw )
 CONDITIONAL_REGISTER_DOCTEMPLATE_EXTENSION( Vst,  gid_Module_Prg_Draw_MSO_Reg, 
vst,  VST,  MS_VISIO_TEMPLATE, 6, sdraw.exe, new, Draw )
 
diff --git 
a/writerperfect/qa/unit/data/draw/libvisio/pass/Visio2013drawing.vsdx 
b/writerperfect/qa/unit/data/draw/libvisio/pass/Visio2013drawing.vsdx
new file mode 100644
index 000000000000..bc6fa2cb7b0b
Binary files /dev/null and 
b/writerperfect/qa/unit/data/draw/libvisio/pass/Visio2013drawing.vsdx differ
diff --git 
a/writerperfect/qa/unit/data/draw/libvisio/pass/Visio2013template.vstx 
b/writerperfect/qa/unit/data/draw/libvisio/pass/Visio2013template.vstx
new file mode 100644
index 000000000000..ff0e121958d2
Binary files /dev/null and 
b/writerperfect/qa/unit/data/draw/libvisio/pass/Visio2013template.vstx differ
commit 50c7e5a2189577ef1de8ec60fc38e0a447c6c1a5
Author:     Mike Kaganski <[email protected]>
AuthorDate: Wed Sep 25 15:52:44 2024 +0500
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Oct 13 15:17:14 2024 +0200

    tdf#163145: revert commit 6f224a17dbf635319503a81ce4038b1ae2ad6de0
    
    I can't reproduce the problem from tdf#136933 anymore (using kf5
    and qt5), while it's reproducible using v.7.0 bibisect repo with
    qt5. I conclude, that the problem got resolved in the meanwhile.
    So it seems to make sense to just revert the problematic commit.
    The incorrect line drawing still may need to be fixed eventually.
    
    There seem to be no way to test SlideImpl::getCurrentSlideBitmap,
    which eventually calls CanvasHelper::strokePolyPolygon. So this
    change has no unit test, unfortunately.
    
    Change-Id: I1d82b6f734a4f69d93c9d61732f55ef8158cfbe6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173933
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    (cherry picked from commit 12e08b3cba0e75f1bd3a42f30e4830d723b24ece)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173910
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/canvas/source/vcl/canvashelper.cxx 
b/canvas/source/vcl/canvashelper.cxx
index 1e47b02c84fc..897986dcfadf 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -315,31 +315,12 @@ namespace vclcanvas
             ::basegfx::B2DPolyPolygon aPolyPoly(
                 
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon) );
 
-            std::vector<double> aDashArray;
-            if( strokeAttributes.DashArray.hasElements() )
-                aDashArray = ::comphelper::sequenceToContainer< 
std::vector<double> >(strokeAttributes.DashArray);
-
-            // First try to draw directly using VCL.
-            bool directFailed = false;
-            setupOutDevState( viewState, renderState, LINE_COLOR );
-            for( sal_uInt32 i=0; i<aPolyPoly.count(); ++i )
-            {
-                if( !mpOutDevProvider->getOutDev().DrawPolyLineDirect( 
aMatrix, aPolyPoly.getB2DPolygon(i),
-                    strokeAttributes.StrokeWidth, 0, !aDashArray.empty() ? 
&aDashArray : nullptr,
-                    b2DJoineFromJoin(strokeAttributes.JoinType), 
unoCapeFromCap(strokeAttributes.StartCapType)))
-                {
-                    directFailed = true;
-                    break;
-                }
-            }
-            if(!directFailed)
-                return uno::Reference< rendering::XCachedPrimitive >(nullptr);
-
-            // Do it all manually.
-
             // apply dashing, if any
             if( strokeAttributes.DashArray.hasElements() )
             {
+                const std::vector<double>& aDashArray(
+                    ::comphelper::sequenceToContainer< std::vector<double> 
>(strokeAttributes.DashArray) );
+
                 ::basegfx::B2DPolyPolygon aDashedPolyPoly;
 
                 for( sal_uInt32 i=0; i<aPolyPoly.count(); ++i )
commit 390888297f97d1582ac47de1dd92c7c370d49cdb
Author:     Patrick Luby <[email protected]>
AuthorDate: Tue Sep 24 15:50:04 2024 -0400
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Oct 13 15:17:14 2024 +0200

    tdf#163135 eliminate native "secure coding" warning
    
    Starting in macOS Sonoma, a warning is printed at launch that complains
    that -[NSApplicationDelegate applicationSupportsSecureRestorableState:]
    is not implemented so implement that selector.
    
    Change-Id: Idfb62c271af5256270361efdd458f2ef9ea4c40b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173882
    Tested-by: Jenkins
    Reviewed-by: Patrick Luby <[email protected]>
    (cherry picked from commit 2fc1034de4fd23d810593533b70ff674b0ccd706)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173799
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/vcl/inc/osx/vclnsapp.h b/vcl/inc/osx/vclnsapp.h
index e3329f554c7e..21a71a01d23e 100644
--- a/vcl/inc/osx/vclnsapp.h
+++ b/vcl/inc/osx/vclnsapp.h
@@ -34,7 +34,7 @@ class AquaSalFrame;
 @end
 
 // our very own application
-@interface VCL_NSApplication : NSApplication
+@interface VCL_NSApplication : NSApplication <NSApplicationDelegate>
 {
 }
 -(void)applicationDidFinishLaunching:(NSNotification*)pNotification;
@@ -62,6 +62,7 @@ class AquaSalFrame;
 -(void)applicationWillResignActive: (NSNotification *)pNotification;
 #endif
 -(BOOL)applicationShouldHandleReopen: (NSApplication*)pApp hasVisibleWindows: 
(BOOL)bWinVisible;
+-(BOOL)applicationSupportsSecureRestorableState: (NSApplication *)pApp;
 -(void)setDockIconClickHandler: (NSObject*)pHandler;
 @end
 
diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index cd60cb0b0cec..ff5a1931a3d2 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -443,6 +443,11 @@
     return YES;
 }
 
+- (BOOL)applicationSupportsSecureRestorableState: (NSApplication *)pApp
+{
+    return YES;
+}
+
 -(void)setDockIconClickHandler: (NSObject*)pHandler
 {
     GetSalData()->mpDockIconClickHandler = pHandler;
commit 0c0589684525d970e4257b5cab2c2072a772f054
Author:     Mike Kaganski <[email protected]>
AuthorDate: Tue Sep 24 16:41:21 2024 +0500
Commit:     Andras Timar <[email protected]>
CommitDate: Sun Oct 13 15:17:14 2024 +0200

    tdf#163091: check rParam.mnX before passing it to RowInfo::cellInfo
    
    When moving to the left, the RowInfo may have e.g. cells 21 to 41,
    and rParam.mnX may be 15, which is outside of the RowInfo data.
    
    It seems that in this case, when we handle the data outside of
    the visible area, setting clip marks may be safely skipped anyway.
    
    Change-Id: I2f507dc166468c44e34645bc34c827456f1ab1ec
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173857
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    (cherry picked from commit 8b23abac4929bbb15a52afb083259cd2d24b4995)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173803
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 859eae2800dc..34236246e515 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -3077,8 +3077,8 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
             }
         }
 
-
-        if ( rParam.mbCellIsValue && ( aAreaParam.mbLeftClip || 
aAreaParam.mbRightClip ) )
+        if (rParam.mnX >= nX1 && rParam.mbCellIsValue
+            && (aAreaParam.mbLeftClip || aAreaParam.mbRightClip))
         {
             SetEngineTextAndGetWidth( rParam, "###", nNeededPixel, ( nLeftM + 
nRightM ) );
             tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;

Reply via email to