summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-21 20:44:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-22 12:52:28 +0200
commitbe8a33c0f03b83357d2ae37dda6bf65313267cea (patch)
tree83aa385e23e1f4deda8858c68d59d61c2a6342cc /xmloff
parent17ca11125f1639d87d31237af822767dd38d31e7 (diff)
tdf#132970 SMP bullets mangled
working: a) bullet preview b) writer rendering c) save to odt a) load from odt Change-Id: I2f85576389fe4f0437f81799c14dfd98c8c40b2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103129 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnume.cxx9
-rw-r--r--xmloff/source/style/xmlnumi.cxx11
2 files changed, 13 insertions, 7 deletions
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index 3eca9cda1bc1..9dd157122b1a 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -50,7 +50,7 @@
#include <xmloff/xmlnume.hxx>
#include <xmloff/xmlexp.hxx>
#include <tools/fontenum.hxx>
-
+#include <vcl/vclenum.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -90,7 +90,7 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
sal_Int16 nStartValue = 1, nDisplayLevels = 1, nBullRelSize = 0;
- sal_Unicode cBullet = 0xf095;
+ sal_UCS4 cBullet = 0xf095;
OUString sBulletFontName, sBulletFontStyleName ;
FontFamily eBulletFontFamily = FAMILY_DONTKNOW;
FontPitch eBulletFontPitch = PITCH_DONTKNOW;
@@ -127,7 +127,8 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
rProp.Value >>= sValue;
if( !sValue.isEmpty() )
{
- cBullet = sValue[0];
+ sal_Int32 nIndexUtf16 = 0;
+ cBullet = sValue.iterateCodePoints(&nIndexUtf16);
}
}
else if( rProp.Name == "BulletRelSize" )
@@ -278,7 +279,7 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
cBullet = 0xF000 + 149;
}
// text:bullet-char="..."
- sTmp.append( cBullet );
+ sTmp.append(OUString(&cBullet, 1));
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_BULLET_CHAR,
sTmp.makeStringAndClear() );
}
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 9fdba383d98e..bed36cb693da 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -45,6 +45,8 @@
#include <sax/tools/converter.hxx>
+#include <vcl/vclenum.hxx>
+
#include <xmloff/xmltkmap.hxx>
#include <xmloff/namespacemap.hxx>
#include <xmloff/xmlnamespace.hxx>
@@ -152,7 +154,7 @@ class SvxXMLListLevelStyleContext_Impl : public SvXMLImportContext
rtl_TextEncoding eBulletFontEncoding;
sal_Int16 eImageVertOrient;
- sal_Unicode cBullet;
+ sal_UCS4 cBullet;
sal_Int16 nRelSize;
Color m_nColor;
@@ -292,7 +294,10 @@ SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl(
break;
case XML_ELEMENT(TEXT, XML_BULLET_CHAR):
if (!sValue.isEmpty())
- cBullet = sValue[0];
+ {
+ sal_Int32 nIndexUtf16 = 0;
+ cBullet = sValue.iterateCodePoints(&nIndexUtf16);
+ }
break;
case XML_ELEMENT(XLINK, XML_HREF):
if( bImage )
@@ -490,7 +495,7 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties()
// Must append 'cBullet' even if it is zero
// if 'bBullet' is true and 'cBullet' is zero - BulletChar property must be 0.
pProps[nPos].Name = "BulletChar";
- pProps[nPos++].Value <<= OUString( cBullet );
+ pProps[nPos++].Value <<= OUString(&cBullet, 1);
pProps[nPos].Name = "BulletFont";
pProps[nPos++].Value <<= aFDesc;