[Libreoffice-commits] .: sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Oct 20 02:32:48 PDT 2011
sw/source/filter/ww8/ww8par.cxx | 8 ++++++++
1 file changed, 8 insertions(+)
New commits:
commit 625a032f820234b0d55e44b2263c5847993dcc7d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 20 10:29:02 2011 +0100
Resolves: fdo#41556 restore original CTL font after forcing font
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 7ebd722..2876172 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;
More information about the Libreoffice-commits
mailing list