diff options
author | Pranav Kant <pranavk@collabora.com> | 2016-02-12 20:17:47 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-02-15 07:50:29 +0000 |
commit | e95db1865c7a095cde5e9cb338394555767b5c65 (patch) | |
tree | 2106c2ee189aa1a47bf2db4e6deb1cf0dc97e7e0 | |
parent | b0111f494c1ee2d75ac4f1544c06c24d464cc416 (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | sd/source/core/stlsheet.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 233a623a070b..376577519a98 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -1090,7 +1090,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 ) { |