summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-07-26 10:50:05 +0200
committerAndras Timar <andras.timar@collabora.com>2017-08-04 12:03:25 +0200
commit639ace836d589b9873b2a54e2b2071a767b525da (patch)
treebadfe5834d95cdbef97f5ae28255b190ff6f3a4d /oox
parentbcc36b18a76ca66f46dee97102fc0c516d969223 (diff)
tdf#107723 Import font name from text portions in shapes
Reviewed-on: https://gerrit.libreoffice.org/40439 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 178b361c6379bc963c8a48925f1807c583f2d09f) Reviewed-on: https://gerrit.libreoffice.org/40529 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 07e656c99f86a59039decd462f66fa272ee2fbed) Change-Id: Ib9b73b5c05ec2e6846ea3adc950ccab5d1c0a9b0
Diffstat (limited to 'oox')
-rw-r--r--oox/source/vml/vmltextbox.cxx14
-rw-r--r--oox/source/vml/vmltextboxcontext.cxx6
2 files changed, 20 insertions, 0 deletions
diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx
index 395bf1e3c1ea..533f55257c73 100644
--- a/oox/source/vml/vmltextbox.cxx
+++ b/oox/source/vml/vmltextbox.cxx
@@ -82,6 +82,20 @@ void TextBox::convert(const uno::Reference<drawing::XShape>& xShape) const
std::vector<beans::PropertyValue> aPropVec;
const TextParagraphModel& rParagraph = aIt->maParagraph;
const TextFontModel& rFont = aIt->maFont;
+ if (rFont.moName.has())
+ {
+ aPropertyValue.Name = "CharFontName";
+ aPropertyValue.Value <<= rFont.moName.get();
+ aPropVec.push_back(aPropertyValue);
+
+ aPropertyValue.Name = "CharFontNameAsian";
+ aPropertyValue.Value <<= rFont.moNameAsian.get();
+ aPropVec.push_back(aPropertyValue);
+
+ aPropertyValue.Name = "CharFontNameComplex";
+ aPropertyValue.Value <<= rFont.moNameComplex.get();
+ aPropVec.push_back(aPropertyValue);
+ }
if (rFont.mobBold.has())
{
aPropertyValue.Name = "CharWeight";
diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx
index 239e53c3a655..c46ff71b98a5 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -139,6 +139,12 @@ void TextPortionContext::onStartElement(const AttributeList& rAttribs)
case W_TOKEN(rPr):
case W_TOKEN(t):
break;
+ case W_TOKEN(rFonts):
+ // See https://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.runfonts(v=office.14).aspx
+ maFont.moName = rAttribs.getString(W_TOKEN(ascii));
+ maFont.moNameAsian = rAttribs.getString(W_TOKEN(eastAsia));
+ maFont.moNameComplex = rAttribs.getString(W_TOKEN(cs));
+ break;
default:
SAL_INFO("oox", "unhandled: 0x" << std::hex<< getCurrentElement());
break;