diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-02 17:01:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-02 17:06:04 +0000 |
commit | f070a64a1d3ccdb382a189506bd4c5001411fc11 (patch) | |
tree | 06027d693d3b7cf828e9e9008a99562b6c7d3b00 | |
parent | f8452c55c7edef28a356775b61d18b92cfbb3402 (diff) |
Resolves: fdo#36514 avoid empty style names in ww2 docs
Change-Id: Ib7987e00bb33e46117442db74dcdd386e8a2bc97
(cherry picked from commit 52979151ca45f9a8aff1694f3c4e1b87ef971ba8)
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index f3c154d19b10..3f7897e38a34 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -4229,35 +4229,30 @@ void WW8RStyle::ImportOldFormatStyles() continue; SwWW8StyInf &rSI = pIo->vColl[stc]; + OUString sName; + if (nCount != 0xFF) // undefined style { - OUString sName; - if (nCount == 0) // inbuilt style - { - ww::sti eSti = ww::GetCanonicalStiFromStc(stc); - if (const sal_Char *pStr = GetEnglishNameFromSti(eSti)) - sName = OUString(pStr, strlen(pStr), RTL_TEXTENCODING_ASCII_US); - else - sName = "Unknown"; - } - else // user style + if (nCount != 0) // user style { OString aTmp = read_uInt8s_ToOString(rSt, nCount); nByteCount += aTmp.getLength(); sName = OStringToOUString(aTmp, eStructChrSet); } - rSI.SetOrgWWIdent(sName, stc); rSI.bImported = true; } - else + + if (sName.isEmpty()) { ww::sti eSti = ww::GetCanonicalStiFromStc(stc); if (const sal_Char *pStr = GetEnglishNameFromSti(eSti)) - { - OUString sName = OUString(pStr, strlen(pStr), RTL_TEXTENCODING_ASCII_US); - rSI.SetOrgWWIdent(sName, stc); - } + sName = OUString(pStr, strlen(pStr), RTL_TEXTENCODING_ASCII_US); } + + if (sName.isEmpty()) + sName = OUString("Unknown Style: ") + OUString::number(stc); + + rSI.SetOrgWWIdent(sName, stc); stcp++; } |