LibreOffice Module sd (master) 1
drviewsc.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <DrawViewShell.hxx>
21
22#include <svx/imapdlg.hxx>
23#include <svx/svdoole2.hxx>
24#include <svx/svdograf.hxx>
25#include <svx/svxdlg.hxx>
26#include <svx/ImageMapInfo.hxx>
27
28#include <sfx2/viewfrm.hxx>
29
30#include <drawdoc.hxx>
31#include <drawview.hxx>
32#include <memory>
33
34namespace sd {
35
37{
38 if( ( dynamic_cast< SdrGrafObj *>( pObj ) == nullptr && dynamic_cast< SdrOle2Obj *>( pObj ) == nullptr )
39 || mpDrawView->IsTextEdit()
40 || !GetViewFrame()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) )
41 return;
42
43 Graphic aGraphic;
44 ImageMap* pIMap = nullptr;
45 std::unique_ptr<TargetList> pTargetList;
46 SvxIMapInfo* pIMapInfo = SvxIMapInfo::GetIMapInfo( pObj );
47
48 // get graphic from shape
49 SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( pObj );
50 if( pGrafObj )
51 aGraphic = pGrafObj->GetGraphic();
52
53 if ( pIMapInfo )
54 {
55 pIMap = const_cast<ImageMap*>(&pIMapInfo->GetImageMap());
56 pTargetList.reset(new TargetList);
57 SfxViewFrame::GetTargetList( *pTargetList );
58 }
59
60 SvxIMapDlgChildWindow::UpdateIMapDlg( aGraphic, pIMap, pTargetList.get(), pObj );
61}
62
63IMPL_LINK( DrawViewShell, NameObjectHdl, AbstractSvxObjectNameDialog&, rDialog, bool )
64{
65 OUString aName;
66 rDialog.GetName( aName );
67 return aName.isEmpty() || ( GetDoc() && !GetDoc()->GetObj( aName ) );
68}
69
70} // end of namespace sd
71
72/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const Graphic & GetGraphic() const
static void GetTargetList(TargetList &rList)
static void UpdateIMapDlg(const Graphic &rGraphic, const ImageMap *pImageMap, const TargetList *pTargetList, void *pEditingObj)
static SvxIMapInfo * GetIMapInfo(const SdrObject *pObject)
const ImageMap & GetImageMap() const
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
std::unique_ptr< DrawView > mpDrawView
void UpdateIMapDlg(SdrObject *pObj)
Definition: drviewsc.cxx:36
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
::std::vector< OUString > TargetList
OUString aName
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)