From 74d41618f71cad9ba5337e50ef099ffcbeb2b1ad Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Fri, 12 Feb 2016 20:17:47 +0530 Subject: sd: Output display names of styles, not internal ones For some reason, maDisplayName is not initialized always. Use GetDisplayName() that handles such a case gracefully. Change-Id: Ib62d4f03dcd3b5571749b540e5af7f90299e2067 Reviewed-on: https://gerrit.libreoffice.org/22348 Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit e95db1865c7a095cde5e9cb338394555767b5c65) --- sd/source/core/stlsheet.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 0295790fb028..f5460c75bcf3 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -1086,7 +1086,18 @@ Any SAL_CALL SdStyleSheet::getPropertyValue( const OUString& PropertyName ) thro } else if( pEntry->nWID == WID_STYLE_DISPNAME ) { - aAny <<= maDisplayName; + OUString aDisplayName; + if ( nFamily == SD_STYLE_FAMILY_MASTERPAGE ) + { + const SdStyleSheet* pStyleSheet = GetPseudoStyleSheet(); + if (pStyleSheet != nullptr) + aDisplayName = pStyleSheet->GetDisplayName(); + } + + if (aDisplayName.isEmpty()) + aDisplayName = GetDisplayName(); + + aAny <<= aDisplayName; } else if( pEntry->nWID == SDRATTR_TEXTDIRECTION ) { -- cgit v1.2.3