sw/inc/IDocumentSettingAccess.hxx             |    1 
 sw/qa/extras/layout/data/tdf164803.fodt       |  115 --------------------------
 sw/qa/extras/layout/layout5.cxx               |    9 --
 sw/source/core/doc/DocumentSettingManager.cxx |    2 
 sw/source/core/inc/fntcache.hxx               |    6 -
 sw/source/core/inc/swfont.hxx                 |   17 +--
 sw/source/core/text/inftxt.cxx                |   13 --
 sw/source/core/text/inftxt.hxx                |    2 
 sw/source/core/text/porlay.cxx                |    5 -
 sw/source/core/txtnode/fntcache.cxx           |   15 +--
 sw/source/core/txtnode/swfont.cxx             |    5 -
 sw/source/filter/ww8/ww8par.cxx               |    2 
 12 files changed, 20 insertions(+), 172 deletions(-)

New commits:
commit e5a7140c32a243782e21172a1ff9998720a063c3
Author:     Jonathan Clark <jonat...@libreoffice.org>
AuthorDate: Mon Jan 27 07:56:22 2025 -0700
Commit:     Jonathan Clark <jonat...@libreoffice.org>
CommitDate: Mon Jan 27 18:53:38 2025 +0100

    tdf#164803 sw: Revert use ext leading for grid spacing on DOC import
    
    Removes an incorrect fix for tdf#129808, which was introducing
    unintended document layout issues.
    
    This reverts commit 43fc662520e5488cbeadd6eb60a24374a837dca4
    Author: Jonathan Clark <jonat...@libreoffice.org>
    Date:   Thu Jan 23 09:04:10 2025 -0700
    
        tdf#164803 sw: Fix SwTextSizeInfo applying grid metrics without grid
    
    and commit 2155684c819dcdc52968c59276046fb0cad83561
    Author: Jonathan Clark <jonat...@libreoffice.org>
    Date:   Thu Sep 19 22:05:08 2024 -0600
    
        tdf#129808 sw: Use ext leading for text grid spacing on DOC import
    
    Change-Id: I356dc045aaf0b60a3b7fcd6e43fd98ccccc25ec6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180796
    Reviewed-by: Jonathan Clark <jonat...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index 9c053e845441..9a22fac5e847 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -139,7 +139,6 @@ enum class DocumentSettingId
     PAINT_HELL_OVER_HEADER_FOOTER,
     // tdf#155229 calculate minimum row height including horizontal border 
width
     MIN_ROW_HEIGHT_INCL_BORDER,
-    // tdf#129808 MS Word always includes ext leading for text grid line height
     MS_WORD_COMP_GRID_METRICS,
     // tdf#161233 pictures with wrap polygon should not be clipped
     NO_CLIPPING_WITH_WRAP_POLYGON,
diff --git a/sw/qa/extras/layout/data/tdf164803.fodt 
b/sw/qa/extras/layout/data/tdf164803.fodt
deleted file mode 100644
index 7a4ef38d8d1b..000000000000
--- a/sw/qa/extras/layout/data/tdf164803.fodt
+++ /dev/null
@@ -1,115 +0,0 @@
-<?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.4" office:mimetype="application/vnd.oasis.opendocument.text">
- 
<office:meta><meta:creation-date>2025-01-23T08:44:13.366544373</meta:creation-date><meta:generator>LibreOfficeDev/25.8.0.0.alpha0$Linux_X86_64
 
LibreOffice_project/b811b283c254fb48d8991576dfee0bae3dc322dd</meta:generator><dc:date>2025-01-23T08:58:37.879339983</dc:date><meta:editing-duration>PT5M3S</meta:editing-duration><meta:editing-cycles>7</meta:editing-cycles><meta:document-statistic
 meta:table-count="0" meta:image-count="0" meta:object-count="0" 
meta:page-count="2" meta:paragraph-count="1" meta:word-count="143" 
meta:character-count="285" 
meta:non-whitespace-character-count="143"/></office:meta>
- <office:font-face-decls>
-  <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation 
Serif'" style:font-family-generic="roman" style:font-pitch="variable"/>
-  <style:font-face style:name="Noto Sans1" svg:font-family="'Noto Sans'" 
style:font-family-generic="system" style:font-pitch="variable"/>
-  <style:font-face style:name="Noto Serif CJK SC" svg:font-family="'Noto Serif 
CJK SC'" style:font-family-generic="system" 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.1181in" draw:shadow-offset-y="0.1181in" 
draw:start-line-spacing-horizontal="0.1114in" 
draw:start-line-spacing-vertical="0.1114in" 
draw:end-line-spacing-horizontal="0.1114in" 
draw:end-line-spacing-vertical="0.1114in" 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="0in" 
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="en" fo:country="US" style:letter-kerning="true" 
style:font-name-asian="Noto Serif CJK SC" style:font-size-asian="10.5pt" 
style:language-asian="zh" style:country-asian="CN" 
style:font-name-complex="Noto Sans1" style:font-size-complex="12pt" 
style:language-complex="hi" style:country-complex="IN"/>
-  </style:default-style>
-  <style:default-style style:family="paragraph">
-   <style:paragraph-properties fo:orphans="2" fo:widows="2" 
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="0.4925in" 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="en" fo:country="US" style:letter-kerning="true" 
style:font-name-asian="Noto Serif CJK SC" style:font-size-asian="10.5pt" 
style:language-asian="zh" style:country-asian="CN" 
style:font-name-complex="Noto Sans1" style:font-size-complex="12pt" 
style:language-complex="hi" style:country-complex="IN" 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"/>
-  <text:outline-style style:name="Outline">
-   <text:outline-level-style text:level="1" loext:num-list-format="%1%" 
style:num-format="">
-    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
-     <style:list-level-label-alignment text:label-followed-by="listtab"/>
-    </style:list-level-properties>
-   </text:outline-level-style>
-   <text:outline-level-style text:level="2" loext:num-list-format="%2%" 
style:num-format="">
-    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
-     <style:list-level-label-alignment text:label-followed-by="listtab"/>
-    </style:list-level-properties>
-   </text:outline-level-style>
-   <text:outline-level-style text:level="3" loext:num-list-format="%3%" 
style:num-format="">
-    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
-     <style:list-level-label-alignment text:label-followed-by="listtab"/>
-    </style:list-level-properties>
-   </text:outline-level-style>
-   <text:outline-level-style text:level="4" loext:num-list-format="%4%" 
style:num-format="">
-    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
-     <style:list-level-label-alignment text:label-followed-by="listtab"/>
-    </style:list-level-properties>
-   </text:outline-level-style>
-   <text:outline-level-style text:level="5" loext:num-list-format="%5%" 
style:num-format="">
-    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
-     <style:list-level-label-alignment text:label-followed-by="listtab"/>
-    </style:list-level-properties>
-   </text:outline-level-style>
-   <text:outline-level-style text:level="6" loext:num-list-format="%6%" 
style:num-format="">
-    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
-     <style:list-level-label-alignment text:label-followed-by="listtab"/>
-    </style:list-level-properties>
-   </text:outline-level-style>
-   <text:outline-level-style text:level="7" loext:num-list-format="%7%" 
style:num-format="">
-    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
-     <style:list-level-label-alignment text:label-followed-by="listtab"/>
-    </style:list-level-properties>
-   </text:outline-level-style>
-   <text:outline-level-style text:level="8" loext:num-list-format="%8%" 
style:num-format="">
-    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
-     <style:list-level-label-alignment text:label-followed-by="listtab"/>
-    </style:list-level-properties>
-   </text:outline-level-style>
-   <text:outline-level-style text:level="9" loext:num-list-format="%9%" 
style:num-format="">
-    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
-     <style:list-level-label-alignment text:label-followed-by="listtab"/>
-    </style:list-level-properties>
-   </text:outline-level-style>
-   <text:outline-level-style text:level="10" loext:num-list-format="%10%" 
style:num-format="">
-    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
-     <style:list-level-label-alignment text:label-followed-by="listtab"/>
-    </style:list-level-properties>
-   </text:outline-level-style>
-  </text:outline-style>
-  <text:notes-configuration text:note-class="footnote" style:num-format="1" 
text:start-value="0" text:footnotes-position="page" 
text:start-numbering-at="document"/>
-  <text:notes-configuration text:note-class="endnote" style:num-format="i" 
text:start-value="0"/>
-  <text:linenumbering-configuration text:number-lines="false" 
text:offset="0.1965in" style:num-format="1" text:number-position="left" 
text:increment="5"/>
-  </office:styles>
- <office:automatic-styles>
-  <style:style style:name="P1" style:family="paragraph" 
style:parent-style-name="Standard">
-   <style:paragraph-properties style:snap-to-layout-grid="true" 
style:writing-mode="lr-tb"/>
-   <style:text-properties fo:font-size="50pt" style:font-size-asian="50pt" 
style:font-size-complex="50pt"/>
-  </style:style>
-  <style:page-layout style:name="pm1">
-   <style:page-layout-properties fo:page-width="8.2681in" 
fo:page-height="11.6929in" style:num-format="1" 
style:print-orientation="portrait" fo:margin-top="0.7874in" 
fo:margin-bottom="0.7874in" fo:margin-left="0.7874in" 
fo:margin-right="0.7874in" style:writing-mode="lr-tb" 
style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" 
style:layout-grid-base-height="0.278in" style:layout-grid-ruby-height="0.139in" 
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="0in" loext:margin-gutter="0in">
-    <style:footnote-sep style:width="0.0071in" 
style:distance-before-sep="0.0398in" style:distance-after-sep="0.0398in" 
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:use-soft-page-breaks="true">
-   <text:sequence-decls>
-    <text:sequence-decl text:display-outline-level="0" 
text:name="Illustration"/>
-    <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
-    <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
-    <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
-    <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
-   </text:sequence-decls>
-   <text:p text:style-name="P1">A A A A A A A A A A A A A A A A A A A A A A A 
A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A 
A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A 
A A A A A A A A A A A A A A A A A A <text:soft-page-break/>A A A A A A A A A A 
A A A A A A A A A A A A</text:p>
-  </office:text>
- </office:body>
-</office:document>
\ No newline at end of file
diff --git a/sw/qa/extras/layout/layout5.cxx b/sw/qa/extras/layout/layout5.cxx
index 23fd651ece39..1ad056f4b2a7 100644
--- a/sw/qa/extras/layout/layout5.cxx
+++ b/sw/qa/extras/layout/layout5.cxx
@@ -1397,15 +1397,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testFoMargin)
     CPPUNIT_ASSERT_LESS(sal_Int32(13400), nPage2Height);
 }
 
-CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf164803)
-{
-    createSwDoc("tdf164803.fodt");
-    xmlDocUniquePtr pXmlDoc = parseLayoutDump();
-
-    // Without the fix, this will be 2
-    assertXPath(pXmlDoc, "//page", 2);
-}
-
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index 2f9d4f840d90..1ac6e3e15332 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -277,7 +277,6 @@ bool sw::DocumentSettingManager::get(/*[in]*/ 
DocumentSettingId id) const
         case DocumentSettingId::USE_VARIABLE_WIDTH_NBSP: return 
mbUseVariableWidthNBSP;
         case DocumentSettingId::PAINT_HELL_OVER_HEADER_FOOTER: return 
mbPaintHellOverHeaderFooter;
         case DocumentSettingId::MIN_ROW_HEIGHT_INCL_BORDER: return 
mbMinRowHeightInclBorder;
-        // tdf#129808
         case DocumentSettingId::MS_WORD_COMP_GRID_METRICS: return 
mbMsWordCompGridMetrics;
         case DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON: return 
mbNoClippingWithWrapPolygon;
         default:
@@ -605,7 +604,6 @@ void sw::DocumentSettingManager::set(/*[in]*/ 
DocumentSettingId id, /*[in]*/ boo
         case DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND:
             mbFootnoteInColumnToPageEnd = value;
             break;
-        // tdf#129808
         case DocumentSettingId::MS_WORD_COMP_GRID_METRICS:
             mbMsWordCompGridMetrics = value;
             break;
diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx
index 6505de2c7b8e..bea6663e1420 100644
--- a/sw/source/core/inc/fntcache.hxx
+++ b/sw/source/core/inc/fntcache.hxx
@@ -97,10 +97,8 @@ public:
     sal_uInt16 GetExternalLeading() const  { return m_nExtLeading; }
 
     sal_uInt16 GetFontAscent( const SwViewShell *pSh, const OutputDevice& rOut 
);
-    sal_uInt16 GetFontHeight(const SwViewShell* pSh, const OutputDevice& rOut,
-                             bool bIsCJKGridContext = false);
-    sal_uInt16 GetFontLeading(const SwViewShell* pSh, const OutputDevice& rOut,
-                              bool bIsCJKGridContext = false);
+    sal_uInt16 GetFontHeight( const SwViewShell *pSh, const OutputDevice& rOut 
);
+    sal_uInt16 GetFontLeading( const SwViewShell *pSh, const OutputDevice& 
rOut );
     sal_uInt16 GetFontHangingBaseline( const SwViewShell *pSh, const 
OutputDevice& rOut );
 
     void GuessLeading( const SwViewShell& rSh, const FontMetric& rMet );
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 87f6492754ac..cea189f86cd3 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -74,8 +74,7 @@ class SwSubFont final : public SvxFont
     bool ChgFnt( SwViewShell const *pSh, OutputDevice& rOut );
     bool IsSymbol( SwViewShell const *pSh );
     sal_uInt16 GetAscent( SwViewShell const *pSh, const OutputDevice& rOut );
-    sal_uInt16 GetHeight(SwViewShell const* pSh, const OutputDevice& rOut,
-                         bool bIsCJKGridContext = false);
+    sal_uInt16 GetHeight( SwViewShell const *pSh, const OutputDevice& rOut );
     sal_uInt16 GetHangingBaseline( SwViewShell const *pSh, const OutputDevice& 
rOut );
     Size GetTextSize_( SwDrawTextInfo& rInf );
     Size GetCapitalSize( SwDrawTextInfo& rInf );
@@ -334,16 +333,10 @@ public:
     short CheckKerning()
         { return m_aSub[m_nActual].CheckKerning(); }
 
-    sal_uInt16 GetAscent(SwViewShell const* pSh, const OutputDevice& rOut)
-    {
-        return m_aSub[m_nActual].GetAscent(pSh, rOut);
-    }
-
-    sal_uInt16 GetHeight(SwViewShell const* pSh, const OutputDevice& rOut,
-                         bool bIsCJKGridContext = false)
-    {
-        return m_aSub[m_nActual].GetHeight(pSh, rOut, bIsCJKGridContext);
-    }
+    sal_uInt16 GetAscent( SwViewShell const *pSh, const OutputDevice& rOut )
+        { return m_aSub[m_nActual].GetAscent( pSh, rOut ); }
+    sal_uInt16 GetHeight( SwViewShell const *pSh, const OutputDevice& rOut )
+        { return m_aSub[m_nActual].GetHeight( pSh, rOut ); }
 
     sal_uInt16 GetHangingBaseline( SwViewShell const *pSh, const OutputDevice& 
rOut )
         { return m_nActual == SwFontScript::CTL ? 
m_aSub[m_nActual].GetHangingBaseline( pSh, rOut ) : 0; }
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 8e6d121e4000..37fdee6a346f 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -51,7 +51,6 @@
 #include <IDocumentDeviceAccess.hxx>
 #include <IDocumentMarkAccess.hxx>
 #include <paratr.hxx>
-#include <pagefrm.hxx>
 #include <sectfrm.hxx>
 #include <rootfrm.hxx>
 #include "inftxt.hxx"
@@ -68,7 +67,6 @@
 #include <EnhancedPDFExportHelper.hxx>
 #include <docsh.hxx>
 #include <strings.hrc>
-#include <tgrditem.hxx>
 #include <o3tl/deleter.hxx>
 #include <vcl/gdimtf.hxx>
 #include <vcl/virdev.hxx>
@@ -325,15 +323,8 @@ void SwTextSizeInfo::CtorInitTextSizeInfo( OutputDevice* 
pRenderContext, SwTextF
     // TODO: Unwind
     m_bURLNotify = pNoteURL && !m_bOnWin;
 
-    // tdf#164803 Snap-to-grid applies only if the grid is enabled
-    bool bGridEnabled = false;
-    if (SwTextGridItem const* pGrid = GetGridItem(m_pFrame->FindPageFrame()); 
pGrid)
-    {
-        bGridEnabled = (pGrid->GetGridType() != SwTextGrid::NONE);
-    }
-
-    
SetSnapToGrid(m_pFrame->GetTextNodeForParaProps()->GetSwAttrSet().GetParaGrid().GetValue()
-                  && m_pFrame->IsInDocBody() && bGridEnabled);
+    SetSnapToGrid( 
m_pFrame->GetTextNodeForParaProps()->GetSwAttrSet().GetParaGrid().GetValue() &&
+                   m_pFrame->IsInDocBody() );
 
     m_pFnt = nullptr;
     m_pUnderFnt = nullptr;
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 4a3bf7a1c514..e0f8dc10297c 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -765,7 +765,7 @@ inline sal_uInt16 SwTextSizeInfo::GetAscent() const
 inline sal_uInt16 SwTextSizeInfo::GetTextHeight() const
 {
     assert(GetOut());
-    return const_cast<SwFont*>(GetFont())->GetHeight(m_pVsh, *GetOut(), 
SnapToGrid());
+    return const_cast<SwFont*>(GetFont())->GetHeight( m_pVsh, *GetOut() );
 }
 
 inline sal_uInt16 SwTextSizeInfo::GetHangingBaseline() const
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index b414fae04c6b..40b45ae691f5 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -446,7 +446,8 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, 
SwTextFormatInfo &rInf )
                                     nPosHeight += nTmp - nPosAscent;
                                     nPosAscent = nTmp;
                                 }
-                                nTmp = rInf.GetTextHeight();
+                                nTmp = rInf.GetFont()->GetHeight( 
rInf.GetVsh(),
+                                                                 
*rInf.GetOut() );
                                 if( nTmp > nPosHeight )
                                     nPosHeight = nTmp;
                             }
@@ -551,7 +552,7 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, 
SwTextFormatInfo &rInf )
 
             if( bOnlyPostIts && !( bHasBlankPortion && bHasOnlyBlankPortions ) 
)
             {
-                Height(rInf.GetTextHeight());
+                Height( rInf.GetFont()->GetHeight( rInf.GetVsh(), 
*rInf.GetOut() ) );
                 mnAscent = rInf.GetFont()->GetAscent( rInf.GetVsh(), 
*rInf.GetOut() );
             }
         }
diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index cab1e6102a3f..09ec1f760328 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -304,8 +304,7 @@ sal_uInt16 SwFntObj::GetFontAscent( const SwViewShell *pSh, 
const OutputDevice&
 
 // Returns the height of the Font on the given output device;
 // it may be necessary to create the screen font first.
-sal_uInt16 SwFntObj::GetFontHeight(const SwViewShell* pSh, const OutputDevice& 
rOut,
-                                   bool bIsCJKGridContext)
+sal_uInt16 SwFntObj::GetFontHeight( const SwViewShell* pSh, const 
OutputDevice& rOut )
 {
     sal_uInt16 nRet = 0;
     const OutputDevice& rRefDev = pSh ? pSh->GetRefDev() : rOut;
@@ -314,7 +313,7 @@ sal_uInt16 SwFntObj::GetFontHeight(const SwViewShell* pSh, 
const OutputDevice& r
     {
         CreateScrFont( *pSh, rOut );
         OSL_ENSURE( USHRT_MAX != m_nScrHeight, "nScrHeight is going berzerk" );
-        nRet = m_nScrHeight + GetFontLeading(pSh, rRefDev, bIsCJKGridContext);
+        nRet = m_nScrHeight + GetFontLeading( pSh, rRefDev );
     }
     else
     {
@@ -337,15 +336,14 @@ sal_uInt16 SwFntObj::GetFontHeight(const SwViewShell* 
pSh, const OutputDevice& r
             const_cast<OutputDevice&>(rRefDev).SetFont( aOldFnt );
         }
 
-        nRet = m_nPrtHeight + GetFontLeading(pSh, rRefDev, bIsCJKGridContext);
+        nRet = m_nPrtHeight + GetFontLeading( pSh, rRefDev );
     }
 
     OSL_ENSURE( USHRT_MAX != nRet, "GetFontHeight returned USHRT_MAX" );
     return nRet;
 }
 
-sal_uInt16 SwFntObj::GetFontLeading(const SwViewShell* pSh, const 
OutputDevice& rOut,
-                                    bool bIsCJKGridContext)
+sal_uInt16 SwFntObj::GetFontLeading( const SwViewShell *pSh, const 
OutputDevice& rOut )
 {
     sal_uInt16 nRet = 0;
 
@@ -385,11 +383,8 @@ sal_uInt16 SwFntObj::GetFontLeading(const SwViewShell* 
pSh, const OutputDevice&
         const bool bBrowse = ( pSh->GetWin() &&
                                pSh->GetViewOptions()->getBrowseMode() &&
                               !pSh->GetViewOptions()->IsPrtFormat() );
-        const bool bUseRealLeading
-            = rIDSA.get(DocumentSettingId::ADD_EXT_LEADING)
-              || (bIsCJKGridContext && 
rIDSA.get(DocumentSettingId::MS_WORD_COMP_GRID_METRICS));
 
-        if (!bBrowse && bUseRealLeading)
+        if ( !bBrowse && rIDSA.get(DocumentSettingId::ADD_EXT_LEADING) )
             nRet = m_nExtLeading;
         else
             nRet = m_nGuessedLeading;
diff --git a/sw/source/core/txtnode/swfont.cxx 
b/sw/source/core/txtnode/swfont.cxx
index 905d65d0a8b8..a029c2454ce1 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -983,12 +983,11 @@ sal_uInt16 SwSubFont::GetAscent( SwViewShell const *pSh, 
const OutputDevice& rOu
     return GetEscapement() ? CalcEscAscent( nAscent ) : nAscent;
 }
 
-sal_uInt16 SwSubFont::GetHeight(SwViewShell const* pSh, const OutputDevice& 
rOut,
-                                bool bIsCJKGridContext)
+sal_uInt16 SwSubFont::GetHeight( SwViewShell const *pSh, const OutputDevice& 
rOut )
 {
     SV_STAT( nGetTextSize );
     SwFntAccess aFntAccess( m_nFontCacheId, m_nFontIndex, this, pSh );
-    const sal_uInt16 nHeight = aFntAccess.Get()->GetFontHeight(pSh, rOut, 
bIsCJKGridContext);
+    const sal_uInt16 nHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut );
     if ( GetEscapement() )
     {
         const sal_uInt16 nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut 
);
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index eb8515732370..ee830b3a43bd 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1885,8 +1885,6 @@ void SwWW8ImplReader::ImportDop()
     // tdf#155229 calculate minimum row height including horizontal border 
width
     m_rDoc.getIDocumentSettingAccess().set(
         DocumentSettingId::MIN_ROW_HEIGHT_INCL_BORDER, true);
-    // tdf#129808 use Word-compatible CJK text grid metrics
-    
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::MS_WORD_COMP_GRID_METRICS,
 true);
 
     // Import Default Tabs
     tools::Long nDefTabSiz = m_xWDop->dxaTab;

Reply via email to