diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2020-09-11 10:00:08 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2020-09-11 10:00:08 +0200 |
commit | 97ebce2051a374be5e5dd908d40c69b21e12f61b (patch) | |
tree | 352125c6b5f547980347972a2b59d10779dc9886 /sw/source/filter | |
parent | 1d8c0009f61ee716c6b51e397bc6bdf954273573 (diff) | |
parent | 60e0c6fd03ac26df00877efea65537828e43583c (diff) |
Merge branch 'libreoffice-6-4'
into distro/lhm/libreoffice-6-4+backports
Change-Id: Ib3030257fb7c4eec5b910c0b49332be0dd8fa854
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/basflt/shellio.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/html/htmlflywriter.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/fields.hxx | 107 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 27 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8num.cxx | 30 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 166 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexte.hxx | 6 |
14 files changed, 148 insertions, 230 deletions
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index cba064de3e09..47657980602f 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -897,6 +897,7 @@ ErrCode SwWriter::Write( WriterRef const & rxWriter, const OUString* pRealFileNa if ( xDoc.is() ) { + pTempCursor.reset(); xDoc.clear(); bWriteAll = false; } diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 61a255d633a3..c5c57f9ed5e5 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -1830,7 +1830,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF aMM100Size = OutputDevice::LogicToLogic( rSize.GetSize(), MapMode( MapUnit::MapTwip ), MapMode( MapUnit::Map100thMM )); - OUString aFilterName("JPG"); + OUString aFilterName(""); if (rHTMLWrt.mbReqIF) { diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index ebf96d3fda24..5dbb02ce9eb5 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2649,6 +2649,10 @@ void DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) // write footnotes/endnotes if we have any FootnoteEndnoteReference(); + // merge the properties _before_ the run text (strictly speaking, just + // after the start of the run) + m_pSerializer->mergeTopMarks(Tag_StartRunProperties, sax_fastparser::MergeMarks::PREPEND); + WritePostponedGraphic(); WritePostponedDiagram(); @@ -2661,10 +2665,6 @@ void DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) WritePostponedOLE(); WritePostponedActiveXControl(true); - - // merge the properties _before_ the run text (strictly speaking, just - // after the start of the run) - m_pSerializer->mergeTopMarks(Tag_StartRunProperties, sax_fastparser::MergeMarks::PREPEND); } void DocxAttributeOutput::GetSdtEndBefore(const SdrObject* pSdrObj) @@ -5710,7 +5710,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const ww8::Frame &rFrame, const P break; } - m_pSerializer->mergeTopMarks(Tag_OutputFlyFrame, sax_fastparser::MergeMarks::POSTPONE); + m_pSerializer->mergeTopMarks(Tag_OutputFlyFrame); } void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj) diff --git a/sw/source/filter/ww8/fields.hxx b/sw/source/filter/ww8/fields.hxx index 8e24ca11d37b..9f3b0aafa252 100644 --- a/sw/source/filter/ww8/fields.hxx +++ b/sw/source/filter/ww8/fields.hxx @@ -21,113 +21,10 @@ #ifndef INCLUDED_SW_SOURCE_FILTER_WW8_FIELDS_HXX #define INCLUDED_SW_SOURCE_FILTER_WW8_FIELDS_HXX +#include <filter/msfilter/ww8fields.hxx> + namespace ww { - enum eField - { - eNONE = 0, - eUNKNOWN = 1, - ePOSSIBLEBOOKMARK = 2, - eREF = 3, - eXE = 4, - eFOOTREF = 5, - eSET = 6, - eIF = 7, - eINDEX = 8, - eTC = 9, - eSTYLEREF = 10, - eRD = 11, - eSEQ = 12, - eTOC = 13, - eINFO = 14, - eTITLE = 15, - eSUBJECT = 16, - eAUTHOR = 17, - eKEYWORDS = 18, - eCOMMENTS = 19, - eLASTSAVEDBY = 20, - eCREATEDATE = 21, - eSAVEDATE = 22, - ePRINTDATE = 23, - eREVNUM = 24, - eEDITTIME = 25, - eNUMPAGE = 26, - eNUMWORDS = 27, - eNUMCHARS = 28, - eFILENAME = 29, - eTEMPLATE = 30, - eDATE = 31, - eTIME = 32, - ePAGE = 33, - eEquals = 34, - eQUOTE = 35, - eMERGEINC = 36, - ePAGEREF = 37, - eASK = 38, - eFILLIN = 39, - eMERGEDATA = 40, - eNEXT = 41, - eNEXTIF = 42, - eSKIPIF = 43, - eMERGEREC = 44, - eDDEREF = 45, - eDDEAUTOREF = 46, - eGLOSSREF = 47, - ePRINT = 48, - eEQ = 49, - eGOTOBUTTON = 50, - eMACROBUTTON = 51, - eAUTONUMOUT = 52, - eAUTONUMLGL = 53, - eAUTONUM = 54, - eINCLUDETIFF = 55, - eLINK = 56, - eSYMBOL = 57, - eEMBED = 58, - eMERGEFIELD = 59, - eUSERNAME = 60, - eUSERINITIALS = 61, - eUSERADDRESS = 62, - eBARCODE = 63, - eDOCVARIABLE = 64, - eSECTION = 65, - eSECTIONPAGES = 66, - eINCLUDEPICTURE = 67, - eINCLUDETEXT = 68, - eFILESIZE = 69, - eFORMTEXT = 70, - eFORMCHECKBOX = 71, - eNOTEREF = 72, - eTOA = 73, - eTA = 74, - eMERGESEQ = 75, - eMACRO = 76, - ePRIVATE = 77, - eDATABASE = 78, - eAUTOTEXT = 79, - eCOMPARE = 80, - ePLUGIN = 81, - eSUBSCRIBER = 82, - eFORMDROPDOWN = 83, - eADVANCE = 84, - eDOCPROPERTY = 85, - eUNKNOWN2 = 86, - eCONTROL = 87, - eHYPERLINK = 88, - eAUTOTEXTLIST = 89, - eLISTNUM = 90, - eHTMLCONTROL = 91, - eBIDIOUTLINE = 92, - eADDRESSBLOCK = 93, - eGREETINGLINE = 94, - eSHAPE = 95, - // NOTE: values > 95 / 0x5F do not correspond to documented WW8 fields - // and thus need special handling in WW8Export::OutputField()! - eBIBLIOGRPAHY=96, - eCITATION = 97, - eFORMDATE = 98, - }; - /** Find the English Field Name from a winword index See OpenOffice.org issue 12831 diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index f7dc3e2207d2..74783f3e7110 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2165,7 +2165,29 @@ bool MSWordExportBase::NeedSectionBreak( const SwNode& rNd ) const bool MSWordExportBase::NeedTextNodeSplit( const SwTextNode& rNd, SwSoftPageBreakList& pList ) const { - rNd.fillSoftPageBreakList( pList ); + SwSoftPageBreakList tmp; + rNd.fillSoftPageBreakList(tmp); + // hack: move the break behind any field marks; currently we can't hide the + // field mark instruction so the layout position is quite meaningless + IDocumentMarkAccess const& rIDMA(*rNd.GetDoc()->getIDocumentMarkAccess()); + sal_Int32 pos(-1); + for (auto const& it : tmp) + { + if (pos < it) // previous one might have skipped over it + { + pos = it; + while (auto const*const pMark = rIDMA.getFieldmarkFor(SwPosition(const_cast<SwTextNode&>(rNd), pos))) + { + if (pMark->GetMarkEnd().nNode != rNd) + { + pos = rNd.Len(); // skip everything + break; + } + pos = pMark->GetMarkEnd().nContent.GetIndex(); // no +1, it's behind the char + } + pList.insert(pos); + } + } pList.insert(0); pList.insert( rNd.GetText().getLength() ); return pList.size() > 2 && NeedSectionBreak( rNd ); @@ -3075,9 +3097,8 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) { aParagraphMarkerProperties.Put(*pSet); bCharFormatOnly = false; - // TODO: still need to check for a RES_TXTATR_CHARFMT hint... } - if (const SwpHints* pTextAttrs = rNode.GetpSwpHints()) + else if (const SwpHints* pTextAttrs = rNode.GetpSwpHints()) { for( size_t i = 0; i < pTextAttrs->Count(); ++i ) { diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index aef96bcd23cb..088f5d445996 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -91,22 +91,19 @@ sal_uInt16 MSWordExportBase::OverrideNumRule( OUString const& rListId, SwNumRule const& rAbstractRule) { - auto const numdef = GetNumberingId(rExistingRule); - auto const absnumdef = rListId == rAbstractRule.GetDefaultListId() + const sal_uInt16 numdef = GetNumberingId(rExistingRule); + + const sal_uInt16 absnumdef = rListId == rAbstractRule.GetDefaultListId() ? GetNumberingId(rAbstractRule) : DuplicateAbsNum(rListId, rAbstractRule); auto const mapping = std::make_pair(numdef, absnumdef); - auto it = m_OverridingNumsR.find(mapping); - if (it == m_OverridingNumsR.end()) - { - it = m_OverridingNumsR.insert(std::make_pair(mapping, m_pUsedNumTable->size())).first; - m_OverridingNums.insert(std::make_pair(m_pUsedNumTable->size(), mapping)); + auto it = m_OverridingNums.insert(std::make_pair(m_pUsedNumTable->size(), mapping)); - m_pUsedNumTable->push_back(nullptr); // dummy, it's unique_ptr... - ++m_nUniqueList; // counter for DuplicateNumRule... - } - return it->second; + m_pUsedNumTable->push_back(nullptr); // dummy, it's unique_ptr... + ++m_nUniqueList; // counter for DuplicateNumRule... + + return it.first->first; } void MSWordExportBase::AddListLevelOverride(sal_uInt16 nListId, @@ -148,17 +145,6 @@ sal_uInt16 MSWordExportBase::GetNumberingId( const SwNumRule& rNumRule ) SwNumRule* p = const_cast<SwNumRule*>(&rNumRule); sal_uInt16 nRet = static_cast<sal_uInt16>(m_pUsedNumTable->GetPos(p)); - // Is this list now duplicated into a new list which we should use - // #i77812# - perform 'deep' search in duplication map - std::map<sal_uInt16,sal_uInt16>::const_iterator aResult = m_aRuleDuplicates.end(); - do { - aResult = m_aRuleDuplicates.find(nRet); - if ( aResult != m_aRuleDuplicates.end() ) - { - nRet = (*aResult).second; - } - } while ( aResult != m_aRuleDuplicates.end() ); - return nRet; } diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 3f64071e2120..9356b87bd86f 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -463,8 +463,6 @@ public: std::unique_ptr<SwNumRuleTable> m_pUsedNumTable; // all used NumRules /// overriding numdef index -> (existing numdef index, abstractnumdef index) std::map<size_t, std::pair<size_t, size_t>> m_OverridingNums; - /// same in reverse - std::map<std::pair<size_t, size_t>, size_t> m_OverridingNumsR; /// list-id -> abstractnumdef index std::map<OUString, size_t> m_Lists; @@ -473,7 +471,6 @@ public: std::map < size_t, std::map<size_t, size_t> > m_ListLevelOverrides; const SwTextNode *m_pTopNodeOfHdFtPage; ///< Top node of host page when in hd/ft - std::map< sal_uInt16, sal_uInt16 > m_aRuleDuplicates; //map to Duplicated numrules std::stack< sal_Int32 > m_aCurrentCharPropStarts; ///< To remember the position in a run. WW8_WrtBookmarks* m_pBkmks; WW8_WrtRedlineAuthor* m_pRedlAuthors; diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 0ccb31c3dbb0..0b2c6527c0ea 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1787,9 +1787,9 @@ void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType, switch (eFieldType) { // map fields that are not supported in WW8 as of Word 2003 - case ww::eBIBLIOGRPAHY: + case ww::eBIBLIOGRAPHY: eFieldType = ww::eQUOTE; - assert(rFieldCmd == FieldString(ww::eBIBLIOGRPAHY)); + assert(rFieldCmd == FieldString(ww::eBIBLIOGRAPHY)); sFieldCmd = FieldString(ww::eQUOTE); break; case ww::eCITATION: @@ -2297,7 +2297,7 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) break; case TOX_AUTHORITIES: - eCode = ww::eBIBLIOGRPAHY; + eCode = ww::eBIBLIOGRAPHY; sStr = FieldString(eCode); break; // case TOX_USER: @@ -2964,7 +2964,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField ) switch (nSubType) { case DS_PAGE: - eField = ww::eNUMPAGE; + eField = ww::eNUMPAGES; break; case DS_WORD: eField = ww::eNUMWORDS; @@ -3576,110 +3576,108 @@ void WW8AttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines ) void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule ) { const SwTextNode* pTextNd = nullptr; - sal_uInt16 nNumId; + if (rNumRule.GetValue().isEmpty()) + { + ParaNumRule_Impl(pTextNd, 0, 0); + return; + } + const SwNumRule* pRule = GetExport().m_pDoc->FindNumRulePtr( + rNumRule.GetValue() ); + if (!pRule) + return; + + sal_uInt16 nNumId = GetExport().GetNumberingId(*pRule) + 1; sal_uInt8 nLvl = 0; - if (!rNumRule.GetValue().isEmpty()) + + if (!GetExport().m_pOutFormatNode) { - const SwNumRule* pRule = GetExport().m_pDoc->FindNumRulePtr( - rNumRule.GetValue() ); - nNumId = pRule ? GetExport().GetNumberingId(*pRule) : USHRT_MAX; - if (USHRT_MAX != nNumId) - { - ++nNumId; - if ( GetExport().m_pOutFormatNode ) - { - if ( dynamic_cast< const SwContentNode *>( GetExport().m_pOutFormatNode ) != nullptr ) - { - pTextNd = static_cast<const SwTextNode*>(GetExport().m_pOutFormatNode); + ParaNumRule_Impl(pTextNd, nLvl, nNumId); + return; + } - if( pTextNd->IsCountedInList()) - { - int nLevel = pTextNd->GetActualListLevel(); + if ( dynamic_cast< const SwContentNode *>( GetExport().m_pOutFormatNode ) != nullptr ) + { + pTextNd = static_cast<const SwTextNode*>(GetExport().m_pOutFormatNode); - if (nLevel < 0) - nLevel = 0; + if( pTextNd->IsCountedInList()) + { + int nLevel = pTextNd->GetActualListLevel(); + + if (nLevel < 0) + nLevel = 0; - if (nLevel >= MAXLEVEL) - nLevel = MAXLEVEL - 1; + if (nLevel >= MAXLEVEL) + nLevel = MAXLEVEL - 1; - nLvl = static_cast< sal_uInt8 >(nLevel); + nLvl = static_cast< sal_uInt8 >(nLevel); - if (GetExport().GetExportFormat() == MSWordExportBase::DOCX) // FIXME + if (GetExport().GetExportFormat() == MSWordExportBase::DOCX) // FIXME + { + // tdf#95848 find the abstract list definition + OUString const listId(pTextNd->GetListId()); + if (!listId.isEmpty() + && (listId != pRule->GetDefaultListId() // default list id uses the 1:1 mapping + || pTextNd->IsListRestart()) // or restarting previous list + ) + { + SwList const*const pList( + GetExport().m_pDoc->getIDocumentListsAccess().getListByName(listId)); + if (pList) + { + SwNumRule const*const pAbstractRule( + GetExport().m_pDoc->FindNumRulePtr( + pList->GetDefaultListStyleName())); + assert(pAbstractRule); + if (pAbstractRule == pRule && !pTextNd->IsListRestart()) { - // tdf#95848 find the abstract list definition - OUString const listId(pTextNd->GetListId()); - if (!listId.isEmpty() - && (listId != pRule->GetDefaultListId() // default list id uses the 1:1 mapping - || pTextNd->IsListRestart()) // or restarting previous list - ) - { - SwList const*const pList( - GetExport().m_pDoc->getIDocumentListsAccess().getListByName(listId)); - if (pList) - { - SwNumRule const*const pAbstractRule( - GetExport().m_pDoc->FindNumRulePtr( - pList->GetDefaultListStyleName())); - assert(pAbstractRule); - if (pAbstractRule == pRule && !pTextNd->IsListRestart()) - { - // different list, but no override - nNumId = GetExport().DuplicateAbsNum(listId, *pAbstractRule); - } - else - { - nNumId = GetExport().OverrideNumRule( - *pRule, listId, *pAbstractRule); + // different list, but no override + nNumId = GetExport().DuplicateAbsNum(listId, *pAbstractRule) + 1; + } + else + { + nNumId = GetExport().OverrideNumRule( + *pRule, listId, *pAbstractRule) + 1; - if (pTextNd->IsListRestart()) - { - // For restarted lists we should also keep value for - // future w:lvlOverride / w:startOverride - GetExport().AddListLevelOverride(nNumId, pTextNd->GetActualListLevel(), - pTextNd->GetActualListStartValue()); - } - } - assert(nNumId != USHRT_MAX); - ++nNumId; - } + if (pTextNd->IsListRestart()) + { + // For restarted lists we should also keep value for + // future w:lvlOverride / w:startOverride + GetExport().AddListLevelOverride(nNumId-1, pTextNd->GetActualListLevel(), + pTextNd->GetActualListStartValue()); } } } - else - { - // #i44815# adjust numbering for numbered paragraphs - // without number (NO_NUMLEVEL). These paragraphs - // will receive a list id 0, which WW interprets as - // 'no number'. - nNumId = 0; - } - } - else if ( dynamic_cast< const SwTextFormatColl *>( GetExport().m_pOutFormatNode ) != nullptr ) - { - const SwTextFormatColl* pC = static_cast<const SwTextFormatColl*>(GetExport().m_pOutFormatNode); - if ( pC && pC->IsAssignedToListLevelOfOutlineStyle() ) - nLvl = static_cast< sal_uInt8 >( pC->GetAssignedOutlineStyleLevel() ); } } } else - nNumId = USHRT_MAX; + { + // #i44815# adjust numbering for numbered paragraphs + // without number (NO_NUMLEVEL). These paragraphs + // will receive a list id 0, which WW interprets as + // 'no number'. + nNumId = 0; + } } - else - nNumId = 0; - - if ( USHRT_MAX != nNumId ) + else if ( dynamic_cast< const SwTextFormatColl *>( GetExport().m_pOutFormatNode ) != nullptr ) { - if ( nLvl >= WW8ListManager::nMaxLevel ) - nLvl = WW8ListManager::nMaxLevel - 1; - - ParaNumRule_Impl( pTextNd, nLvl, nNumId ); + const SwTextFormatColl* pC = static_cast<const SwTextFormatColl*>(GetExport().m_pOutFormatNode); + if ( pC && pC->IsAssignedToListLevelOfOutlineStyle() ) + nLvl = static_cast< sal_uInt8 >( pC->GetAssignedOutlineStyleLevel() ); } + + if ( nLvl >= WW8ListManager::nMaxLevel ) + nLvl = WW8ListManager::nMaxLevel - 1; + + ParaNumRule_Impl( pTextNd, nLvl, nNumId); } void WW8AttributeOutput::ParaNumRule_Impl(const SwTextNode* /*pTextNd*/, sal_Int32 const nLvl, sal_Int32 const nNumId) { + if (USHRT_MAX == nNumId) + return; + // write sprmPIlvl and sprmPIlfo SwWW8Writer::InsUInt16( *m_rWW8Export.pO, NS_sprm::sprmPIlvl ); m_rWW8Export.pO->push_back( ::sal::static_int_cast<sal_uInt8>(nLvl) ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 17d30a0e9236..166df718c720 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1076,7 +1076,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, if( pImpRec->nShapeId ) { - auto pImpRecTmp = pImpRec.get(); + auto nShapeId = pImpRec->nShapeId; + auto nShapeOrder = (static_cast<sal_uLong>(pImpRec->aTextId.nTxBxS) << 16) + + pImpRec->aTextId.nSequence; // Complement Import Record List pImpRec->pObj = pObj; rImportData.insert(std::move(pImpRec)); @@ -1088,9 +1090,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, ( (rObjData.nSpFlags & ShapeFlag::Group) && (rObjData.nCalledByGroup < 2) ) ) - StoreShapeOrder( pImpRecTmp->nShapeId, - ( static_cast<sal_uLong>(pImpRecTmp->aTextId.nTxBxS) << 16 ) - + pImpRecTmp->aTextId.nSequence, pObj ); + { + StoreShapeOrder(nShapeId, nShapeOrder, pObj); + } } else pImpRec.reset(); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 12ce9f9e8db1..f0a12ad3005e 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -615,6 +615,9 @@ void SwWW8ImplReader::SetAnlvStrings(SwNumFormat &rNum, WW8_ANLV const &rAV, return; } sText = OUString(reinterpret_cast<char const *>(pText), nLen, eCharSet); + // ofz#23961 in case of multi-byte input encoding resulting in shorter + // output pad to full length with something semi-arbitrary + comphelper::string::padToLength(sText, nLen, cBulletChar); } else { diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 694782a1e1ed..cbf45b2fbbfa 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -624,7 +624,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() } default: OUString aCode = m_aFieldStack.back().GetBookmarkCode(); - if ( !aCode.isEmpty() ) + if (!aCode.isEmpty() && !aCode.trim().startsWith("SHAPE")) { // Unhandled field with stored code SwPosition aEndPos = *m_pPaM->GetPoint(); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 142d20c8ee98..f64859171dc6 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -605,7 +605,7 @@ const wwSprmSearcher *wwSprmParser::GetWW8SprmSearcher() {0x085D, { 1, L_FIX} }, // "sprmCFItalicBi" ;;; {0x4A5E, { 2, L_FIX} }, {0x485F, { 2, L_FIX} }, // "sprmCLidBi" ;;; - {0x4A60, { 1, L_FIX} }, // "sprmCIcoBi" ;;; + {0x4A60, { 2, L_FIX} }, // "sprmCIcoBi" ;;; {0x4A61, { 2, L_FIX} }, // "sprmCHpsBi" ;;; {0xCA62, { 0, L_VAR} }, // "sprmCDispFieldRMark" chp.fDispFieldRMark, // chp.ibstDispFieldRMark, chp.dttmDispFieldRMark ; diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index bef72a6f5357..80d786d8d884 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -1140,6 +1140,13 @@ void SwXMLExport::ExportTable( const SwTableNode& rTableNd ) } } +void SwXMLTextParagraphExport::exportTableAutoStyles() { + for (const auto* pTableNode : maTableNodes) + { + static_cast<SwXMLExport&>(GetExport()).ExportTableAutoStyles(*pTableNode); + } +} + void SwXMLTextParagraphExport::exportTable( const Reference < XTextContent > & rTextContent, bool bAutoStyles, bool _bProgress ) @@ -1177,7 +1184,7 @@ void SwXMLTextParagraphExport::exportTable( // ALL flags are set at the same time. const bool bExportStyles = bool( GetExport().getExportFlags() & SvXMLExportFlags::STYLES ); if ( bExportStyles || !pFormat->GetDoc()->IsInHeaderFooter( aIdx ) ) - static_cast<SwXMLExport&>(GetExport()).ExportTableAutoStyles( *pTableNd ); + maTableNodes.push_back(pTableNd); } else { diff --git a/sw/source/filter/xml/xmltexte.hxx b/sw/source/filter/xml/xmltexte.hxx index 8da021506c0d..4432e4ce0166 100644 --- a/sw/source/filter/xml/xmltexte.hxx +++ b/sw/source/filter/xml/xmltexte.hxx @@ -28,6 +28,7 @@ class SwXMLExport; class SvXMLAutoStylePoolP; class SwNoTextNode; +class SwTableNode; namespace com { namespace sun { namespace star { namespace style { class XStyle; } } } } @@ -38,6 +39,9 @@ class SwXMLTextParagraphExport : public XMLTextParagraphExport const SvGlobalName aPluginClassId; const SvGlobalName aIFrameClassId; + // Collected autostyles for use in exportTextAutoStyles + std::vector<const SwTableNode*> maTableNodes; + static SwNoTextNode *GetNoTextNode( const css::uno::Reference < css::beans::XPropertySet >& rPropSet ); @@ -52,6 +56,8 @@ protected: const css::uno::Reference< css::text::XTextContent > & rTextContent, bool bAutoStyles, bool bProgress ) override; + virtual void exportTableAutoStyles() override; + public: SwXMLTextParagraphExport( SwXMLExport& rExp, |