[Libreoffice-commits] core.git: xmloff/source

Mark Hung marklh9 at gmail.com
Wed Apr 20 13:20:15 UTC 2016


 xmloff/source/style/prstylei.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 3c99cc8b824e3a9f7341e3cb3a2f48c846664491
Author: Mark Hung <marklh9 at gmail.com>
Date:   Mon Mar 14 23:42:25 2016 +0800

    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 at libreoffice.org>
    Reviewed-by: Mark Hung <marklh9 at gmail.com>

diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index c5275cb..d97a8bd 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;


More information about the Libreoffice-commits mailing list