cid#1636690 Dereference after null check
[LibreOffice.git] / cui / source / inc / hldoctp.hxx
blob61005a42d63598e0798bf434833e9dcc6829e1d0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #pragma once
21 #include "hltpbase.hxx"
23 /*************************************************************************
25 |* Tabpage : Hyperlink - Document
27 \************************************************************************/
28 class SvxHyperlinkDocTp final : public SvxHyperlinkTabPageBase
30 private:
31 std::unique_ptr<SvxHyperURLBox> m_xCbbPath;
32 std::unique_ptr<weld::Button> m_xBtFileopen;
33 std::unique_ptr<weld::Entry> m_xEdTarget;
34 std::unique_ptr<weld::Label> m_xFtFullURL;
35 std::unique_ptr<weld::Button> m_xBtBrowse;
37 OUString maStrURL;
39 bool m_bMarkWndOpen;
41 DECL_LINK (ClickFileopenHdl_Impl, weld::Button&, void );
42 DECL_LINK (ClickTargetHdl_Impl, weld::Button&, void );
44 DECL_LINK (ModifiedPathHdl_Impl, weld::ComboBox&, void ); ///< Contents of combobox "Path" modified
45 DECL_LINK (ModifiedTargetHdl_Impl, weld::Entry&, void ); ///< Contents of editfield "Target" modified
47 DECL_LINK( LostFocusPathHdl_Impl, weld::Widget&, void ); ///< Combobox "path" lost its focus
49 DECL_LINK( TimeoutHdl_Impl, Timer *, void ); ///< Handler for timer -timeout
51 enum class EPathType { Invalid, ExistsFile };
52 static EPathType GetPathType ( std::u16string_view rStrPath );
54 void FillDlgFields(const OUString& rStrURL) override;
55 void GetCurrentItemData ( OUString& rStrURL, OUString& aStrName,
56 OUString& aStrIntName, OUString& aStrFrame,
57 SvxLinkInsertMode& eMode ) override;
58 virtual bool ShouldOpenMarkWnd () override {return m_bMarkWndOpen;}
59 virtual void SetMarkWndShouldOpen (bool bOpen) override {m_bMarkWndOpen=bOpen;}
60 OUString GetCurrentURL() const;
62 public:
63 SvxHyperlinkDocTp(weld::Container* pParent, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet);
64 virtual ~SvxHyperlinkDocTp() override;
66 static std::unique_ptr<IconChoicePage> Create(weld::Container* pWindow, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet);
68 virtual void SetMarkStr ( const OUString& aStrMark ) override;
70 virtual void SetInitFocus() override;
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */