Line data Source code
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 <svx/linkwarn.hxx>
21 : #include <svtools/miscopt.hxx>
22 :
23 0 : SvxLinkWarningDialog::SvxLinkWarningDialog( vcl::Window* pParent, const OUString& _rFileName )
24 0 : : MessageDialog(pParent, "LinkWarnDialog" , "svx/ui/linkwarndialog.ui")
25 : {
26 0 : get(m_pWarningOnBox, "ask");
27 :
28 : // replace filename
29 0 : OUString sInfoText = get_primary_text();
30 0 : sInfoText = sInfoText.replaceAll("%FILENAME", _rFileName);
31 0 : set_primary_text( sInfoText );
32 :
33 : // load state of "warning on" checkbox from misc options
34 0 : SvtMiscOptions aMiscOpt;
35 0 : m_pWarningOnBox->Check( aMiscOpt.ShowLinkWarningDialog() );
36 0 : if( aMiscOpt.IsShowLinkWarningDialogReadOnly() )
37 0 : m_pWarningOnBox->Disable();
38 0 : }
39 :
40 0 : SvxLinkWarningDialog::~SvxLinkWarningDialog()
41 : {
42 : // save value of "warning off" checkbox, if necessary
43 0 : SvtMiscOptions aMiscOpt;
44 0 : bool bChecked = m_pWarningOnBox->IsChecked();
45 0 : if ( aMiscOpt.ShowLinkWarningDialog() != bChecked )
46 0 : aMiscOpt.SetShowLinkWarningDialog( bChecked );
47 594 : }
48 :
49 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|