summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2023-12-05 13:28:36 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-12-21 16:02:48 +0100
commitb6c4dd27acdd08fa63f8d75dd09212828e28844f (patch)
treeab9e2721f1c226e2a27108f160333ba4c9d682f2 /sw
parentb67f116db12bd2afc6b93ad20eee0696c342f695 (diff)
tdf#158044 writerfilter: handle toggle properties in import/export
DOCX has some odd properties (bold, italic, shadowed, hidden ...), which switch on/off if they are applied multiple times, e.g. with paragraph and character styles. To fix that, a hard attribute has to switch off the attribute in that occasion on import and on export a hard attribute switches it on in Word. Includes partial fix for tdf#154370. Change-Id: Ie4c317cf9b7d02efd89b9d6a9996143585d7e937 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160343 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> (cherry picked from commit 9e127010a86b3521c803ac86c0b5f58dc8e2966b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161018
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/tdf158044.odtbin0 -> 14032 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport20.cxx34
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/tdf154370.docxbin0 -> 6333 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport2.cxx77
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx152
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx2
6 files changed, 240 insertions, 25 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf158044.odt b/sw/qa/extras/ooxmlexport/data/tdf158044.odt
new file mode 100755
index 000000000000..ca17b6625674
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf158044.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
index 263e769297d7..4a4e6e087b68 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
@@ -988,6 +988,40 @@ CPPUNIT_TEST_FIXTURE(Test, testSvgExtensionsSupport)
assertXPath(pXmlDocContent, aPath + "/a:extLst/a:ext/asvg:svgBlip"_ostr, "embed"_ostr, "rId3");
}
+CPPUNIT_TEST_FIXTURE(Test, testtdf158044)
+{
+ loadAndSave("tdf158044.odt");
+ // write hard attributes to prevent multiple toggle attributes from vanishing
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr[1]/w:rStyle[1]"_ostr, "val"_ostr,
+ "BoldItalicCapsEmbossedStrike");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr[1]/w:b[1]"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr[1]/w:bCs[1]"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr[1]/w:i[1]"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr[1]/w:iCs[1]"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr[1]/w:strike[1]"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:rPr[1]/w:emboss[1]"_ostr);
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr[1]/w:rStyle[1]"_ostr, "val"_ostr,
+ "SmallcapsImprint");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr[1]/w:imprint[1]"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[4]/w:rPr[1]/w:smallCaps[1]"_ostr);
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[2]/w:rPr[1]/w:rStyle[1]"_ostr, "val"_ostr,
+ "AllCaps");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:r[2]/w:rPr[1]/w:caps[1]"_ostr);
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:r[2]/w:rPr[1]/w:rStyle[1]"_ostr, "val"_ostr,
+ "Hidden");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[6]/w:r[2]/w:rPr[1]/w:vanish[1]"_ostr);
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r[4]/w:rPr[1]/w:rStyle[1]"_ostr, "val"_ostr,
+ "OutlineShadow");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r[4]/w:rPr[1]/w:outline[1]"_ostr);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r[4]/w:rPr[1]/w:shadow[1]"_ostr);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlimport/data/tdf154370.docx b/sw/qa/extras/ooxmlimport/data/tdf154370.docx
new file mode 100755
index 000000000000..ba72724593b2
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf154370.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 553fbebbc6e3..0c29484d765e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -1188,6 +1188,83 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf141969)
CPPUNIT_ASSERT_EQUAL(8.0f, getProperty<float>(xRun, "CharHeight"));
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf154370)
+{
+ // Import a file with pargraph and character styles containing toggle properties applied to the end of
+ // the paragraphs. Should result in hard attributes resetting the properties
+ createSwDoc("tdf154370.docx");
+ {
+ auto xPara(getParagraph(2));
+ auto xRun = getRun(xPara, 2);
+
+ OUString rangeText = xRun->getString();
+ CPPUNIT_ASSERT_EQUAL(OUString("CharStyle BoldItalicCapsEmbossedStrike"), rangeText);
+
+ const uno::Reference<beans::XPropertyState> xRangePropState(xRun, uno::UNO_QUERY_THROW);
+ beans::PropertyState ePropertyState = xRangePropState->getPropertyState("CharWeight");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+
+ ePropertyState = xRangePropState->getPropertyState("CharWeightComplex");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+
+ ePropertyState = xRangePropState->getPropertyState("CharWeightAsian");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+
+ ePropertyState = xRangePropState->getPropertyState("CharPosture");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+
+ ePropertyState = xRangePropState->getPropertyState("CharPostureAsian");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+
+ ePropertyState = xRangePropState->getPropertyState("CharCaseMap");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+
+ ePropertyState = xRangePropState->getPropertyState("CharRelief");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+
+ ePropertyState = xRangePropState->getPropertyState("CharStrikeout");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+ }
+ {
+ auto xPara(getParagraph(3));
+ auto xRun = getRun(xPara, 2);
+
+ OUString rangeText = xRun->getString();
+ CPPUNIT_ASSERT_EQUAL(OUString("CharStyle SmallcapsImprint"), rangeText);
+
+ const uno::Reference<beans::XPropertyState> xRangePropState(xRun, uno::UNO_QUERY_THROW);
+ beans::PropertyState ePropertyState = xRangePropState->getPropertyState("CharCaseMap");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+
+ ePropertyState = xRangePropState->getPropertyState("CharRelief");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+ }
+ {
+ auto xPara(getParagraph(5));
+ auto xRun = getRun(xPara, 2);
+
+ OUString rangeText = xRun->getString();
+ CPPUNIT_ASSERT_EQUAL(OUString("CharStyle Hidden"), rangeText);
+
+ const uno::Reference<beans::XPropertyState> xRangePropState(xRun, uno::UNO_QUERY_THROW);
+ beans::PropertyState ePropertyState = xRangePropState->getPropertyState("CharHidden");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+ }
+ {
+ auto xPara(getParagraph(7));
+ auto xRun = getRun(xPara, 2);
+
+ OUString rangeText = xRun->getString();
+ CPPUNIT_ASSERT_EQUAL(OUString("OutlineShadow"), rangeText);
+
+ const uno::Reference<beans::XPropertyState> xRangePropState(xRun, uno::UNO_QUERY_THROW);
+ beans::PropertyState ePropertyState = xRangePropState->getPropertyState("CharContoured");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+
+ ePropertyState = xRangePropState->getPropertyState("CharShadowed");
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+ }
+}
// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 74e53d2fec0b..c70c78121b8b 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -33,12 +33,18 @@
#include <editeng/svxfont.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/brushitem.hxx>
+#include <editeng/charhiddenitem.hxx>
+#include <editeng/charreliefitem.hxx>
+#include <editeng/contouritem.hxx>
+#include <editeng/crossedoutitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/keepitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/formatbreakitem.hxx>
#include <editeng/frmdiritem.hxx>
+#include <editeng/postitem.hxx>
+#include <editeng/shdditem.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/wghtitem.hxx>
#include <svl/grabbagitem.hxx>
@@ -77,11 +83,14 @@
#include <txtatr.hxx>
#include <cellatr.hxx>
#include <fmtrowsplt.hxx>
+#include <com/sun/star/awt/FontRelief.hpp>
+#include <com/sun/star/awt/FontStrikeout.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/i18n/BreakIterator.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/text/RubyPosition.hpp>
+#include <com/sun/star/style/CaseMap.hpp>
#include <oox/export/vmlexport.hxx>
#include <sal/log.hxx>
#include <comphelper/propertysequence.hxx>
@@ -479,9 +488,9 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool bWriteCombChars)
ClearOverridesFromSet( *pCharFormatItem, aExportSet );
// check toggle properties in DOCX output
+ if (pCharFormatItem)
{
- SvxWeightItem aBoldProperty(WEIGHT_BOLD, RES_CHRATR_WEIGHT);
- handleToggleProperty(aExportSet, pCharFormatItem, RES_CHRATR_WEIGHT, &aBoldProperty);
+ handleToggleProperty(aExportSet, *pCharFormatItem);
}
// tdf#113790: AutoFormat style overwrites char style, so remove all
@@ -558,29 +567,82 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool bWriteCombChars)
// i.e., the effective value to be applied to the content shall be true if its effective value is true for
// an odd number of levels of the style hierarchy.
//
-// To prevent such logic inside output, it is required to write inline w:b token on content level.
-void SwWW8AttrIter::handleToggleProperty(SfxItemSet& rExportSet, const SwFormatCharFormat* pCharFormatItem,
- sal_uInt16 nWhich, const SfxPoolItem* pValue)
-{
- if (rExportSet.HasItem(nWhich) || !pValue)
+// To prevent such logic inside output, it is required to write inline attribute tokens on content level.
+void SwWW8AttrIter::handleToggleProperty(SfxItemSet& rExportSet, const SwFormatCharFormat& rCharFormatItem)
+{
+ if (rExportSet.HasItem(RES_CHRATR_WEIGHT) || rExportSet.HasItem(RES_CHRATR_POSTURE) ||
+ rExportSet.HasItem(RES_CHRATR_CTL_WEIGHT) || rExportSet.HasItem(RES_CHRATR_CTL_POSTURE) ||
+ rExportSet.HasItem(RES_CHRATR_CONTOUR) || rExportSet.HasItem(RES_CHRATR_CASEMAP) ||
+ rExportSet.HasItem(RES_CHRATR_RELIEF) || rExportSet.HasItem(RES_CHRATR_SHADOWED) ||
+ rExportSet.HasItem(RES_CHRATR_CROSSEDOUT) || rExportSet.HasItem(RES_CHRATR_HIDDEN))
return;
- bool hasPropertyInCharStyle = false;
- bool hasPropertyInParaStyle = false;
+ SvxWeightItem aBoldProperty(WEIGHT_BOLD, RES_CHRATR_WEIGHT);
+ SvxPostureItem aPostureProperty(ITALIC_NORMAL, RES_CHRATR_POSTURE);
+ SvxContourItem aContouredProperty(true, RES_CHRATR_CONTOUR);
+ SvxCaseMapItem aCaseMapCapsProperty(SvxCaseMap::Uppercase, RES_CHRATR_CASEMAP);
+ SvxCaseMapItem aCaseMapSmallProperty(SvxCaseMap::SmallCaps, RES_CHRATR_CASEMAP);
+ SvxCharReliefItem aEmbossedProperty(FontRelief::Embossed, RES_CHRATR_RELIEF);
+ SvxCharReliefItem aImprintProperty(FontRelief::Engraved, RES_CHRATR_RELIEF);
+ SvxShadowedItem aShadowedProperty(true, RES_CHRATR_SHADOWED);
+ SvxCrossedOutItem aStrikeoutProperty(STRIKEOUT_SINGLE, RES_CHRATR_CROSSEDOUT);
+ SvxCharHiddenItem aHiddenProperty(true, RES_CHRATR_HIDDEN);
- // get bold flag from specified character style
- if (pCharFormatItem)
+ bool hasWeightPropertyInCharStyle = false;
+ bool hasWeightComplexPropertyInCharStyle = false;
+ bool hasPosturePropertyInCharStyle = false;
+ bool hasPostureComplexPropertyInCharStyle = false;
+ bool bHasCapsPropertyInCharStyle = false;
+ bool bHasSmallCapsPropertyInCharStyle = false;
+ bool bHasEmbossedPropertyInCharStyle = false;
+ bool bHasImprintPropertyInCharStyle = false;
+ bool hasContouredPropertyInCharStyle = false;
+ bool hasShadowedPropertyInCharStyle = false;
+ bool hasStrikeoutPropertyInCharStyle = false;
+ bool hasHiddenPropertyInCharStyle = false;
+
+
+ // get attribute flags from specified character style
+ if (const SwCharFormat* pCharFormat = rCharFormatItem.GetCharFormat())
{
- if (const SwCharFormat* pCharFormat = pCharFormatItem->GetCharFormat())
+ if (const SfxPoolItem* pWeightItem = pCharFormat->GetAttrSet().GetItem(RES_CHRATR_WEIGHT))
+ hasWeightPropertyInCharStyle = (*pWeightItem == aBoldProperty);
+
+ if (const SfxPoolItem* pWeightComplexItem = pCharFormat->GetAttrSet().GetItem(RES_CHRATR_CTL_WEIGHT))
+ hasWeightComplexPropertyInCharStyle = (*pWeightComplexItem == aBoldProperty);
+
+ if (const SfxPoolItem* pPostureItem = pCharFormat->GetAttrSet().GetItem(RES_CHRATR_POSTURE))
+ hasPosturePropertyInCharStyle = (*pPostureItem == aPostureProperty);
+
+ if (const SfxPoolItem* pPostureComplexItem = pCharFormat->GetAttrSet().GetItem(RES_CHRATR_CTL_POSTURE))
+ hasPostureComplexPropertyInCharStyle = (*pPostureComplexItem == aPostureProperty);
+
+ if (const SfxPoolItem* pContouredItem = pCharFormat->GetAttrSet().GetItem(RES_CHRATR_CONTOUR))
+ hasContouredPropertyInCharStyle = (*pContouredItem == aContouredProperty);
+
+ if (const SfxPoolItem* pShadowedItem = pCharFormat->GetAttrSet().GetItem(RES_CHRATR_SHADOWED))
+ hasShadowedPropertyInCharStyle = (*pShadowedItem == aShadowedProperty);
+
+ if (const SfxPoolItem* pStrikeoutItem = pCharFormat->GetAttrSet().GetItem(RES_CHRATR_CROSSEDOUT))
+ hasStrikeoutPropertyInCharStyle = (*pStrikeoutItem == aStrikeoutProperty);
+
+ if (const SfxPoolItem* pHiddenItem = pCharFormat->GetAttrSet().GetItem(RES_CHRATR_HIDDEN))
+ hasHiddenPropertyInCharStyle = (*pHiddenItem == aHiddenProperty);
+
+ if (const SfxPoolItem* pCaseMapItem = pCharFormat->GetAttrSet().GetItem(RES_CHRATR_CASEMAP))
{
- if (const SfxPoolItem* pItem = pCharFormat->GetAttrSet().GetItem(nWhich))
- {
- hasPropertyInCharStyle = (*pItem == *pValue);
- }
+ bHasCapsPropertyInCharStyle = (*pCaseMapItem == aCaseMapCapsProperty);
+ bHasSmallCapsPropertyInCharStyle = (*pCaseMapItem == aCaseMapSmallProperty);
+ }
+
+ if (const SfxPoolItem* pReliefItem = pCharFormat->GetAttrSet().GetItem(RES_CHRATR_RELIEF))
+ {
+ bHasEmbossedPropertyInCharStyle = (*pReliefItem == aEmbossedProperty);
+ bHasImprintPropertyInCharStyle = (*pReliefItem == aImprintProperty);
}
}
- // get bold flag from specified paragraph style
+ // get attribute flags from specified paragraph style and apply properties if they are set in character and paragraph style
{
SwTextFormatColl& rTextColl = static_cast<SwTextFormatColl&>( m_rNode.GetAnyFormatColl() );
sal_uInt16 nStyle = m_rExport.m_pStyles->GetSlot( &rTextColl );
@@ -588,17 +650,59 @@ void SwWW8AttrIter::handleToggleProperty(SfxItemSet& rExportSet, const SwFormatC
const SwFormat* pFormat = m_rExport.m_pStyles->GetSwFormat(nStyle);
if (pFormat)
{
- if (const SfxPoolItem* pItem = pFormat->GetAttrSet().GetItem(nWhich))
+ const SfxPoolItem* pItem;
+ if (hasWeightPropertyInCharStyle && (pItem = pFormat->GetAttrSet().GetItem(RES_CHRATR_WEIGHT)) &&
+ (*pItem == aBoldProperty))
+ rExportSet.Put(aBoldProperty);
+
+ if (hasWeightComplexPropertyInCharStyle && (pItem = pFormat->GetAttrSet().GetItem(RES_CHRATR_CTL_WEIGHT)) &&
+ *pItem == aBoldProperty)
+ {
+ rExportSet.Put(aBoldProperty, RES_CHRATR_CTL_WEIGHT);
+ }
+
+ if (hasPosturePropertyInCharStyle && (pItem = pFormat->GetAttrSet().GetItem(RES_CHRATR_POSTURE)) &&
+ *pItem == aPostureProperty)
+ rExportSet.Put(aPostureProperty);
+
+ if (hasPostureComplexPropertyInCharStyle && (pItem = pFormat->GetAttrSet().GetItem(RES_CHRATR_CTL_POSTURE)) &&
+ *pItem == aPostureProperty)
{
- hasPropertyInParaStyle = (*pItem == *pValue);
+ rExportSet.Put(aPostureProperty, RES_CHRATR_CTL_POSTURE);
+ }
+
+ if (hasContouredPropertyInCharStyle && (pItem = pFormat->GetAttrSet().GetItem(RES_CHRATR_CONTOUR)) && *pItem == aContouredProperty)
+ rExportSet.Put(aContouredProperty);
+
+ if (hasShadowedPropertyInCharStyle && (pItem = pFormat->GetAttrSet().GetItem(RES_CHRATR_SHADOWED)) &&
+ *pItem == aShadowedProperty)
+ rExportSet.Put(aShadowedProperty);
+
+ if (hasStrikeoutPropertyInCharStyle && (pItem = pFormat->GetAttrSet().GetItem(RES_CHRATR_CROSSEDOUT)) &&
+ *pItem == aStrikeoutProperty)
+ rExportSet.Put(aStrikeoutProperty);
+
+ if (hasHiddenPropertyInCharStyle && (pItem = pFormat->GetAttrSet().GetItem(RES_CHRATR_HIDDEN)) &&
+ (*pItem == aHiddenProperty))
+ rExportSet.Put(aHiddenProperty);
+
+ if ((bHasCapsPropertyInCharStyle||bHasSmallCapsPropertyInCharStyle) && (pItem = pFormat->GetAttrSet().GetItem(RES_CHRATR_CASEMAP)))
+ {
+ if (bHasCapsPropertyInCharStyle && *pItem == aCaseMapCapsProperty)
+ rExportSet.Put(aCaseMapCapsProperty);
+ else if (bHasSmallCapsPropertyInCharStyle && *pItem == aCaseMapSmallProperty)
+ rExportSet.Put(aCaseMapSmallProperty);
+ }
+
+ if ((bHasEmbossedPropertyInCharStyle||bHasImprintPropertyInCharStyle) && (pItem = pFormat->GetAttrSet().GetItem(RES_CHRATR_RELIEF)))
+ {
+ if (bHasEmbossedPropertyInCharStyle && *pItem == aEmbossedProperty)
+ rExportSet.Put(aEmbossedProperty);
+ else if (bHasImprintPropertyInCharStyle && *pItem == aImprintProperty)
+ rExportSet.Put(aImprintProperty);
}
}
- }
- // add inline property
- if (hasPropertyInCharStyle && hasPropertyInParaStyle)
- {
- rExportSet.Put(*pValue);
}
}
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 04737fb21410..fcc39c44aab4 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1551,7 +1551,7 @@ private:
SwWW8AttrIter(const SwWW8AttrIter&) = delete;
SwWW8AttrIter& operator=(const SwWW8AttrIter&) = delete;
- void handleToggleProperty(SfxItemSet& rExportSet, const SwFormatCharFormat* pCharFormatItem, sal_uInt16 nWhich, const SfxPoolItem* pValue);
+ void handleToggleProperty(SfxItemSet& rExportSet, const SwFormatCharFormat& rCharFormatItem);
public:
SwWW8AttrIter( MSWordExportBase& rWr, const SwTextNode& rNd );