diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-10-30 12:21:49 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-11-01 11:15:35 +0100 |
commit | 2884d57d4717afc3c31baee0ebc4a3e8b1c1d2f2 (patch) | |
tree | 7895b0b38b75fd35011ed24245d81a9340246c13 /sd/source/ui/app | |
parent | 2d928a87788644f7c6d46b70ab03bc13a8bf89d3 (diff) |
TSCP: Support DocInfo.Custom field for ODP file format
Impress has a limited support for fields - this includes support
for DocInfo.Custom field, which shows the user defined custom
fields that are used in TSCP. This commit adds minimal support
(only what is needed for TSCP) for DocInfo.Custom field but only
supports string fields for now. It is not possible to add the field
manually, at least not until the full support is added.
Change-Id: Ib3b73ab22fd4fe65ab6fb5173fe035a3359deea5
Reviewed-on: https://gerrit.libreoffice.org/44041
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd/source/ui/app')
-rw-r--r-- | sd/source/ui/app/sdmod2.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 29b8b9798228..b7b51f41917c 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -349,7 +349,21 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) } else if ((pCustomPropertyField = dynamic_cast<const editeng::CustomPropertyField*>(pField)) != nullptr) { - pInfo->SetRepresentation(pCustomPropertyField->GetFormatted(SfxObjectShell::Current()->getDocProperties())); + try + { + if (SfxObjectShell::Current() && SfxObjectShell::Current()->IsLoadingFinished()) + { + auto pNonConstCustomPropertyField = const_cast<editeng::CustomPropertyField*>(pCustomPropertyField); + OUString sCurrent = pNonConstCustomPropertyField->GetFormatted(SfxObjectShell::Current()->getDocProperties()); + pInfo->SetRepresentation(sCurrent); + } + else + pInfo->SetRepresentation(pCustomPropertyField->GetCurrentPresentation()); + } + catch (...) + { + pInfo->SetRepresentation(pCustomPropertyField->GetCurrentPresentation()); + } } else { |