sw/inc/tblafmt.hxx                     |    3 --
 sw/source/core/doc/tblafmt.cxx         |   39 ---------------------------------
 sw/source/core/unocore/unostyle.cxx    |    5 ----
 xmloff/source/table/XMLTableExport.cxx |    2 -
 4 files changed, 2 insertions(+), 47 deletions(-)

New commits:
commit f6c642672d8461c65f735d403a4e55e5487504a2
Author:     Heiko Tietze <[email protected]>
AuthorDate: Wed Feb 18 09:16:13 2026 +0100
Commit:     Karthik Godha <[email protected]>
CommitDate: Wed Feb 18 11:05:27 2026 +0100

    Revert "tdf#170771: Export only edited table styles"
    
    This reverts commit 6fc9264fd967a51a91de401ba871d2642e57f9df.
    
    Reason for revert: PythonTest_sw_python fails
    
    Change-Id: Id15fca158e6395d9960bb272ab131f81419dfdfc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199596
    Reviewed-by: Mike Kaganski <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index a4540b1f1ba2..069a8f65c8c5 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -59,7 +59,6 @@ public:
 
     /// Comparing based of boxes backgrounds.
     bool operator==(const SwBoxAutoFormat& rRight) const;
-    bool IsSameAs(const SwBoxAutoFormat& rBox) const;
 
     const SvxFrameDirectionItem& GetTextOrientation() const { return 
*m_aTextOrientation; }
     const SwFormatVertOrient& GetVerticalAlignment() const { return 
*m_aVerticalAlignment; }
@@ -146,8 +145,6 @@ public:
                        SvNumberFormatter const*);
     void FillToItemSet(size_t nIndex, SfxItemSet& rItemSet, SvNumberFormatter* 
pNFormatr) const;
 
-    bool NeedsExport();
-
     /// These methods returns what style (row or column) is applied first on 
given Cell
     bool FirstRowEndColumnIsRow();
     bool FirstRowStartColumnIsRow();
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 0fcc2e27453c..5005421b7236 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -209,29 +209,6 @@ bool SwBoxAutoFormat::operator==(const SwBoxAutoFormat& 
rRight) const
     return GetBackground().GetColor() == rRight.GetBackground().GetColor();
 }
 
-bool SwBoxAutoFormat::IsSameAs(const SwBoxAutoFormat& rRight) const
-{
-    if (GetFont() == rRight.GetFont() && GetHeight() == rRight.GetHeight()
-        && GetWeight() == rRight.GetWeight() && GetPosture() == 
rRight.GetPosture() &&
-
-        GetCJKFont() == rRight.GetCJKFont() && GetCJKHeight() == 
rRight.GetCJKHeight()
-        && GetCJKWeight() == rRight.GetCJKWeight() && GetCJKPosture() == 
rRight.GetCJKPosture() &&
-
-        GetCTLFont() == rRight.GetCTLFont() && GetCTLHeight() == 
rRight.GetCTLHeight()
-        && GetCTLWeight() == rRight.GetCTLWeight() && GetCTLPosture() == 
rRight.GetCTLPosture() &&
-
-        GetUnderline() == rRight.GetUnderline() && GetColor() == 
rRight.GetColor()
-        && GetAdjust() == rRight.GetAdjust() && GetVerJustify() == 
rRight.GetVerJustify() &&
-
-        GetBackground() == rRight.GetBackground() &&
-
-        GetBox() == rRight.GetBox())
-    {
-        return true;
-    }
-    return false;
-}
-
 void SwBoxAutoFormat::SetXObject(rtl::Reference<SwXTextCellStyle> const& 
xObject)
 {
     m_xAutoFormatUnoObject = xObject.get();
@@ -584,22 +561,6 @@ void SwTableAutoFormat::FillToItemSet(size_t nIndex, 
SfxItemSet& rItemSet,
     }
 }
 
-bool SwTableAutoFormat::NeedsExport()
-{
-    const SwTableAutoFormat* rDefaultStyle
-        = SwModule::get()->GetAutoFormatTable().FindAutoFormat(GetName());
-
-    if (!rDefaultStyle || rDefaultStyle->GetParent() != GetParent())
-        return true;
-
-    for (size_t i = 0; i < ELEMENT_COUNT; i++)
-    {
-        if (!m_aBoxAutoFormat[i]->IsSameAs(*rDefaultStyle->GetField(i)))
-            return true;
-    }
-    return false;
-}
-
 bool SwTableAutoFormat::FirstRowEndColumnIsRow()
 {
     if (*GetField(FIRST_ROW) != GetDefaultBoxFormat()
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index c543a20cdf35..4aa6b2f8c0c9 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -4565,9 +4565,6 @@ sal_Bool SAL_CALL SwXTextTableStyle::isInUse()
     if (!m_bPhysical)
         return false;
 
-    if (m_pTableAutoFormat->NeedsExport())
-        return true;
-
     for (const SwTableFormat* pFormat : 
*m_pDocShell->GetDoc()->GetTableFrameFormats())
     {
         if(pFormat->IsUsed())
@@ -4937,7 +4934,7 @@ sal_Bool SAL_CALL SwXTextCellStyle::isInUse()
     if (!xStyle.is())
         return false;
 
-    return xStyle->isInUse();
+    return true;
 }
 
 OUString SAL_CALL SwXTextCellStyle::getParentStyle() { return m_sParentName; }
diff --git a/xmloff/source/table/XMLTableExport.cxx 
b/xmloff/source/table/XMLTableExport.cxx
index 455319dfcdf7..c22e68db1609 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -608,7 +608,7 @@ void XMLTableExport::exportTableTemplates()
             {
             }
 
-            if (!xTableStyle->isInUse() && !bPhysical)
+            if (!xTableStyle->isInUse() && !bPhysical && !mbWriter)
                 continue;
 
             const TableStyleElement* pElements;

Reply via email to