Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sd/source/ui/view/drviewsc.cxx
Line
Count
Source
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
34
namespace sd {
35
36
void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
37
0
{
38
0
    if( ( dynamic_cast< SdrGrafObj *>( pObj ) == nullptr && dynamic_cast< SdrOle2Obj *>( pObj ) == nullptr )
39
0
        || mpDrawView->IsTextEdit()
40
0
        || !GetViewFrame()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) )
41
0
        return;
42
43
0
    Graphic     aGraphic;
44
0
    ImageMap*   pIMap = nullptr;
45
0
    std::unique_ptr<TargetList> pTargetList;
46
0
    SvxIMapInfo* pIMapInfo = SvxIMapInfo::GetIMapInfo( pObj );
47
48
    // get graphic from shape
49
0
    SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( pObj );
50
0
    if( pGrafObj )
51
0
        aGraphic = pGrafObj->GetGraphic();
52
53
0
    if ( pIMapInfo )
54
0
    {
55
0
        pIMap = const_cast<ImageMap*>(&pIMapInfo->GetImageMap());
56
0
        pTargetList.reset(new TargetList);
57
0
        SfxViewFrame::GetTargetList( *pTargetList );
58
0
    }
59
60
0
    SvxIMapDlgChildWindow::UpdateIMapDlg( aGraphic, pIMap, pTargetList.get(), pObj );
61
0
}
62
63
IMPL_LINK( DrawViewShell, NameObjectHdl, AbstractSvxObjectNameDialog&, rDialog, bool )
64
0
{
65
0
    OUString aName = rDialog.GetName();
66
0
    return aName.isEmpty() || ( GetDoc() && !GetDoc()->GetObj( aName ) );
67
0
}
68
69
} // end of namespace sd
70
71
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */