summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2016-03-14 23:42:25 +0800
committerMark Hung <marklh9@gmail.com>2016-04-20 13:19:53 +0000
commit3c99cc8b824e3a9f7341e3cb3a2f48c846664491 (patch)
tree981f87bf10b03cf11f27603f3ddd6d2087d83488 /xmloff
parentc9b1bfd0802fdbadf4bcc1e9ced51c7a769f5cc6 (diff)
tdf#97567 xmloff: use programmatic name for imported automatic style.
Adopt programmatic name in created document model to prevent imported automatic style from referring a programmatic name that is not imported to a default style. Note for English UI, the pragammatic name is the same as the display name, hence using a display name wouldn't cause the problem. Change-Id: Iaf31431a516e3d097e2a22a6be51aa68f6a6eef6 Reviewed-on: https://gerrit.libreoffice.org/23247 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/prstylei.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index c5275cb132ae..d97a8bd2815a 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -304,7 +304,17 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite )
pProps->Name = "ParaStyleName";
OUString sParent( GetParentName() );
if( !sParent.isEmpty() )
+ {
sParent = GetImport().GetStyleDisplayName( GetFamily(), sParent );
+ Reference < XNameContainer > xFamilies = pSvXMLStylesContext->GetStylesContainer( GetFamily() );
+ if(xFamilies.is() && xFamilies->hasByName( sParent ) )
+ {
+ css::uno::Reference< css::style::XStyle > xStyle;
+ Any aAny = xFamilies->getByName( sParent );
+ aAny >>= xStyle;
+ sParent = xStyle->getName() ;
+ }
+ }
else
sParent = "Standard";
pProps->Value <<= sParent;