sw/qa/extras/ww8export/data/tdf90408.doc  |binary
 sw/qa/extras/ww8export/data/tdf90408B.doc |binary
 sw/qa/extras/ww8export/ww8export4.cxx     |   26 ++++++++++++++++++++++++++
 sw/source/filter/ww8/ww8par5.cxx          |   26 --------------------------
 4 files changed, 26 insertions(+), 26 deletions(-)

New commits:
commit 02c56a8d3ea86f28ffbdd645f83d1d4de2b56bea
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Sat May 20 13:04:17 2023 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Sat May 20 21:34:24 2023 +0200

    tdf#90408 Revert #i79169# save/apply attributes of macrobutton text
    
    This reverts ancient commit a79a0101f114e0fcac40503220c5d34750124367.
    
    I'm not sure what problem it was trying to solve,
    but it doesn't seem necessary now.
    At least, I took my unit test and set some different
    font sizes to them, and they correctly got those attributes.
    
    This was the original file that needed to be fixed:
    make CppunitTest_sw_ww8export4 CPPUNIT_TEST_NAME=testTdf90408
    
    This is for the current bug report:
    make CppunitTest_sw_ww8export4 CPPUNIT_TEST_NAME=testTdf90408B
    
    Change-Id: I09fb3bd12d645318f1024ac78a9b3154a1fcd078
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152025
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/qa/extras/ww8export/data/tdf90408.doc 
b/sw/qa/extras/ww8export/data/tdf90408.doc
new file mode 100644
index 000000000000..2335e73ea290
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf90408.doc differ
diff --git a/sw/qa/extras/ww8export/data/tdf90408B.doc 
b/sw/qa/extras/ww8export/data/tdf90408B.doc
new file mode 100644
index 000000000000..d0e0df59a6b9
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf90408B.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx 
b/sw/qa/extras/ww8export/ww8export4.cxx
index b620a0672958..414d183ed6b0 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -15,6 +15,7 @@
 #include <com/sun/star/graphic/XGraphic.hpp>
 #include <com/sun/star/text/TextContentAnchorType.hpp>
 #include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
 
 #include <comphelper/sequenceashashmap.hxx>
 #include <o3tl/string_view.hxx>
@@ -75,6 +76,31 @@ DECLARE_WW8EXPORT_TEST(testTdf141649_conditionalText, 
"tdf141649_conditionalText
     getParagraph(1, "trueResult");
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf90408, "tdf90408.doc")
+{
+    uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1), 1), 
uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("checkbox is 16pt", 16.f, 
getProperty<float>(xRun, "CharHeight"));
+    xRun.set(getRun(getParagraph(1), 2, "unchecked"), uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("text is 12pt", 12.f, 
getProperty<float>(xRun, "CharHeight"));
+}
+
+DECLARE_WW8EXPORT_TEST(testTdf90408B, "tdf90408B.doc")
+{
+    uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> 
xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+    uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), 
uno::UNO_QUERY);
+
+    uno::Reference<container::XEnumerationAccess> 
xParaEnumAccess(xCell->getText(), uno::UNO_QUERY);
+    uno::Reference<container::XEnumeration> xParaEnum = 
xParaEnumAccess->createEnumeration();
+    uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), 
uno::UNO_QUERY);
+
+    uno::Reference<beans::XPropertySet> xRun(getRun(xPara, 1), 
uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("checkbox is 28pt", 28.f, 
getProperty<float>(xRun, "CharHeight"));
+    xRun.set(getRun(xPara, 2, u" Κατάψυξη,  "), uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("text is 10pt", 10.f, 
getProperty<float>(xRun, "CharHeight"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index ddaad0e3f741..a5f1d6892fbb 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2360,8 +2360,6 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, 
OUString& rStr)
     bool bBracket  = false;
     WW8ReadFieldParams aReadParam( rStr );
 
-    sal_Int32 nOffset = 0;
-
     for (;;)
     {
         const sal_Int32 nRet = aReadParam.SkipToNextToken();
@@ -2374,8 +2372,6 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, 
OUString& rStr)
                 aName = aReadParam.GetResult();
             else if( aVText.isEmpty() || bBracket )
             {
-                nOffset = aReadParam.GetTokenSttPtr() + 1;
-
                 if( bBracket )
                     aVText += " ";
                 aVText += aReadParam.GetResult();
@@ -2403,19 +2399,7 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, 
OUString& rStr)
                     m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( 
SwFieldIds::Macro )), aName, aVText );
 
     if( !bApplyWingdings )
-    {
-
         m_rDoc.getIDocumentContentOperations().InsertPoolItem( *m_pPaM, 
SwFormatField( aField ) );
-        WW8_CP nOldCp = m_xPlcxMan->Where();
-        WW8_CP nCp = nOldCp + nOffset;
-
-        SwPaM aPaM(*m_pPaM, m_pPaM);
-        aPaM.SetMark();
-        aPaM.Move(fnMoveBackward);
-        aPaM.Exchange();
-
-        m_pPostProcessAttrsInfo.reset(new WW8PostProcessAttrsInfo(nCp, nCp, 
aPaM));
-    }
     else
     {
         //set Wingdings font
@@ -2446,16 +2430,6 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, 
OUString& rStr)
     return eF_ResT::OK;
 }
 
-WW8PostProcessAttrsInfo::WW8PostProcessAttrsInfo(WW8_CP nCpStart, WW8_CP 
nCpEnd,
-                                                 SwPaM & rPaM)
-    : mbCopy(false)
-    , mnCpStart(nCpStart)
-    , mnCpEnd(nCpEnd)
-    , mPaM(*rPaM.GetMark(), *rPaM.GetPoint())
-    , mItemSet(rPaM.GetDoc().GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, 
RES_PARATR_END - 1>)
-{
-}
-
 bool CanUseRemoteLink(const OUString &rGrfName)
 {
     bool bUseRemote = false;

Reply via email to