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:02:58 +0000 |
commit | 52979151ca45f9a8aff1694f3c4e1b87ef971ba8 (patch) | |
tree | c80ba70a8815fffdcb7c9bd0eb910b3e3b4ffd4a /sw | |
parent | 9b61cf4a70b9c3023d035a1b0f7cc1488dd55e22 (diff) |
Resolves: fdo#36514 avoid empty style names in ww2 docs
Change-Id: Ib7987e00bb33e46117442db74dcdd386e8a2bc97
Diffstat (limited to 'sw')
-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 ca804428b2e1..8fe310b73056 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++; } |