summaryrefslogtreecommitdiff
path: root/xmloff/source
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2015-08-30 16:08:20 +0800
committerAndras Timar <andras.timar@collabora.com>2015-11-03 18:10:25 +0100
commite3dc11d4fdcb08649f2dfb0e9e60fbe1e2525d55 (patch)
tree95dc177f6855114fcb9344f3a51655c566c56634 /xmloff/source
parentf81ea780e6592299df0f42defd78f872d5786ed4 (diff)
Fix tdf#93438 Impress generate abnormal style when copy-pasting
from Writer with Chinese UI. When user configure UI language as Chinese, style names are also translated. However when Copy-pasting from Writer to Impress ( select RTF fromat with paste-special), Chinese (unicode) style names are borken into multiparts, where some of them are empty string. Neither deleting the abnormal style nor saving the file can be achieved. The only remedy is to remove style with emtpy name with macro. With this patch: 1) Catch NoSuchElementException and ignores it, so user still has chance saving file. 2) Make sure style has valid number before inserting it. 3) Prevent text breaking into multiple tokens by handling ucN in ScanText(). Change-Id: I417f70b81c23ac63c175cc13c548068873d13a38 Reviewed-on: https://gerrit.libreoffice.org/18148 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/19685 (cherry picked from commit 52f3eb47aa42bd1a2a61088706cd3c729e274fc0)
Diffstat (limited to 'xmloff/source')
-rw-r--r--xmloff/source/style/styleexp.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 0ab12cce8c5e..8ca89b6f6507 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -419,6 +419,10 @@ void XMLStyleExport::exportStyleFamily(
// not export them here and remain silent.
continue;
}
+ catch(css::container::NoSuchElementException&)
+ {
+ continue;
+ }
assert(xStyle.is());
if (!bUsed || xStyle->isInUse())