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>
This commit is contained in:
Mark Hung
2016-03-14 23:42:25 +08:00
parent c9b1bfd080
commit 3c99cc8b82

View File

@@ -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;