Coverage Report

Created: 2026-09-28 10:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sc/source/ui/view/tabvwshd.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 <sfx2/childwin.hxx>
21
#include <sfx2/viewfrm.hxx>
22
#include <vcl/weld/Dialog.hxx>
23
24
#include <tabvwsh.hxx>
25
#include <scmod.hxx>
26
#include <docsh.hxx>
27
#include <gridwin.hxx>
28
29
//!         parent window for dialogs
30
//!         Problem: OLE Server!
31
32
weld::Window* ScTabViewShell::GetDialogParent()
33
0
{
34
    //  if a ref-input dialog is open, use it as parent
35
    //  (necessary when a slot is executed from the dialog's OK handler)
36
0
    if (nCurRefDlgId && nCurRefDlgId == ScModule::get()->GetCurRefDlgId())
37
0
    {
38
0
        SfxViewFrame& rViewFrm = GetViewFrame();
39
0
        if (rViewFrm.HasChildWindow(nCurRefDlgId))
40
0
        {
41
0
            SfxChildWindow* pChild = rViewFrm.GetChildWindow(nCurRefDlgId);
42
0
            if (pChild)
43
0
            {
44
0
                auto xController = pChild->GetController();
45
0
                weld::Window* pRet = xController ? xController->getDialog() : nullptr;
46
0
                if (pRet && pRet->get_visible())
47
0
                    return pRet;
48
0
            }
49
0
        }
50
0
    }
51
52
0
    ScDocShell* pDocSh = GetViewData().GetDocShell();
53
0
    if (pDocSh->IsOle())
54
0
    {
55
        // TODO/LATER: how to GetEditWindow in embedded document?!
56
        // It should be OK to return the ViewShell Window!
57
0
        vcl::Window* pWin = GetWindow();
58
0
        return pWin ? pWin->GetFrameWeld() : nullptr;
59
        // SvInPlaceEnvironment* pEnv = rDocSh.GetIPEnv();
60
        // if (pEnv)
61
        //    return pEnv->GetEditWin();
62
0
    }
63
64
0
    vcl::Window* pWin = GetActiveWin(); // for normal views, too
65
0
    return pWin ? pWin->GetFrameWeld() : nullptr;
66
0
}
67
68
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */