diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-10-20 10:29:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-10-20 10:32:28 +0100 |
commit | 625a032f820234b0d55e44b2263c5847993dcc7d (patch) | |
tree | aa2ff26e21360e09faffe01294043bb1d8919752 | |
parent | ffb91342fc667d0f1d4ef43384bfcfc176cab774 (diff) |
Resolves: fdo#41556 restore original CTL font after forcing font
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 7ebd722cead1..2876172ec21b 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2828,6 +2828,7 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const rtl::OUString& rAddS rtl::OUString sChunk(rAddString.copy(nPos, nEnd-nPos)); const sal_uInt16 aIds[] = {RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_FONT}; + const SvxFontItem *pOverriddenItems[] = {NULL, NULL, NULL}; bool aForced[] = {false, false, false}; int nLclIdctHint = 0xFF; @@ -2862,6 +2863,9 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const rtl::OUString& rAddS aForced[i] = aIds[i] != nForceFromFontId && *pSourceFont != *pDestFont; if (aForced[i]) { + pOverriddenItems[i] = + (const SvxFontItem*)pCtrlStck->GetStackAttr(*pPaM->GetPoint(), aIds[i]); + SvxFontItem aForceFont(*pSourceFont); aForceFont.SetWhich(aIds[i]); pCtrlStck->NewAttr(*pPaM->GetPoint(), aForceFont); @@ -2874,7 +2878,11 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const rtl::OUString& rAddS for (size_t i = 0; i < SAL_N_ELEMENTS(aIds); ++i) { if (aForced[i]) + { pCtrlStck->SetAttr(*pPaM->GetPoint(), aIds[i]); + if (pOverriddenItems[i]) + pCtrlStck->NewAttr(*pPaM->GetPoint(), *(pOverriddenItems[i])); + } } nPos = nEnd; |