summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-12-28 21:57:32 +0300
committerJustin Luth <justin_luth@sil.org>2016-12-29 06:00:01 +0000
commit87fce022c65c1d2aed1ca59967137d77d936043c (patch)
tree944a99259512379d8c84064d4f66f797105b1ad2 /sd
parentd339feac2a4344aae4952890f0b608e24b177b63 (diff)
SD SlsClipboard: cleanup and preparation for tdf64588
Isolating the patch itself from reorganization/optimization of variables. No logic change intended. Change-Id: I9e9008d57b4948372af138fb47224ebcf9c48ceb Reviewed-on: https://gerrit.libreoffice.org/32480 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index b9bcb07b06f6..cb73c3dc9fb7 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -386,6 +386,9 @@ void Clipboard::CreateSlideTransferable (
model::PageEnumeration aSelectedPages
(model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrSlideSorter.GetModel()));
+ SdDrawDocument* const pDocument = mrSlideSorter.GetModel().GetDocument();
+ DrawDocShell* const pDataDocSh = pDocument ? pDocument->GetDocSh() : nullptr;
+
while (aSelectedPages.HasMoreElements())
{
model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement());
@@ -417,7 +420,6 @@ void Clipboard::CreateSlideTransferable (
if (!aBookmarkList.empty())
{
mrSlideSorter.GetView().BrkAction();
- SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument();
SdTransferable* pTransferable = TransferableData::CreateTransferable (
pDocument,
nullptr,
@@ -436,9 +438,8 @@ void Clipboard::CreateSlideTransferable (
pTransferable->GetWorkDocument()->GetDocSh()
->FillTransferableObjectDescriptor (aObjDesc);
- if (pDocument->GetDocSh() != nullptr)
- aObjDesc.maDisplayName = pDocument->GetDocSh()
- ->GetMedium()->GetURLObject().GetURLNoPass();
+ if (pDataDocSh != nullptr)
+ aObjDesc.maDisplayName = pDataDocSh->GetMedium()->GetURLObject().GetURLNoPass();
vcl::Window* pActionWindow = pWindow;
if (pActionWindow == nullptr)