LibreOffice Module sc (master) 1
delcodlg.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#undef SC_DLLIMPLEMENTATION
21
22#include <delcodlg.hxx>
23
28
30 : GenericDialogController(pParent, "modules/scalc/ui/deletecontents.ui", "DeleteContentsDialog")
31 , m_bObjectsDisabled(false)
32 , m_xBtnDelAll(m_xBuilder->weld_check_button("deleteall"))
33 , m_xBtnDelStrings(m_xBuilder->weld_check_button("text"))
34 , m_xBtnDelNumbers(m_xBuilder->weld_check_button("numbers"))
35 , m_xBtnDelDateTime(m_xBuilder->weld_check_button("datetime"))
36 , m_xBtnDelFormulas(m_xBuilder->weld_check_button("formulas"))
37 , m_xBtnDelNotes(m_xBuilder->weld_check_button("comments"))
38 , m_xBtnDelAttrs(m_xBuilder->weld_check_button("formats"))
39 , m_xBtnDelObjects(m_xBuilder->weld_check_button("objects"))
40{
49
50 DisableChecks( m_xBtnDelAll->get_active() );
51
52 m_xBtnDelAll->connect_toggled( LINK( this, ScDeleteContentsDlg, DelAllHdl ) );
53}
54
56{
57}
58
60{
62
63 if ( m_xBtnDelStrings->get_active() )
65 if ( m_xBtnDelNumbers->get_active() )
67 if ( m_xBtnDelDateTime->get_active())
69 if ( m_xBtnDelFormulas->get_active())
71 if ( m_xBtnDelNotes->get_active() )
73 if ( m_xBtnDelAttrs->get_active() )
75 if ( m_xBtnDelObjects->get_active() )
77
79
83}
84
85void ScDeleteContentsDlg::DisableChecks( bool bDelAllChecked )
86{
87 if ( bDelAllChecked )
88 {
89 m_xBtnDelStrings->set_sensitive(false);
90 m_xBtnDelNumbers->set_sensitive(false);
91 m_xBtnDelDateTime->set_sensitive(false);
92 m_xBtnDelFormulas->set_sensitive(false);
93 m_xBtnDelNotes->set_sensitive(false);
94 m_xBtnDelAttrs->set_sensitive(false);
95 m_xBtnDelObjects->set_sensitive(false);
96 }
97 else
98 {
99 m_xBtnDelStrings->set_sensitive(true);
100 m_xBtnDelNumbers->set_sensitive(true);
101 m_xBtnDelDateTime->set_sensitive(true);
102 m_xBtnDelFormulas->set_sensitive(true);
103 m_xBtnDelNotes->set_sensitive(true);
104 m_xBtnDelAttrs->set_sensitive(true);
106 m_xBtnDelObjects->set_sensitive(false);
107 else
108 m_xBtnDelObjects->set_sensitive(true);
109 }
110}
111
113{
114 m_bObjectsDisabled = true;
115 m_xBtnDelObjects->set_active(false);
116 m_xBtnDelObjects->set_sensitive(false);
117}
118
120{
121 DisableChecks( m_xBtnDelAll->get_active() );
122}
123
124/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::CheckButton > m_xBtnDelNotes
Definition: delcodlg.hxx:35
std::unique_ptr< weld::CheckButton > m_xBtnDelNumbers
Definition: delcodlg.hxx:32
std::unique_ptr< weld::CheckButton > m_xBtnDelStrings
Definition: delcodlg.hxx:31
std::unique_ptr< weld::CheckButton > m_xBtnDelDateTime
Definition: delcodlg.hxx:33
static bool bPreviousAllCheck
Definition: delcodlg.hxx:39
static InsertDeleteFlags nPreviousChecks
Definition: delcodlg.hxx:40
std::unique_ptr< weld::CheckButton > m_xBtnDelAll
Definition: delcodlg.hxx:30
virtual ~ScDeleteContentsDlg() override
Definition: delcodlg.cxx:55
std::unique_ptr< weld::CheckButton > m_xBtnDelAttrs
Definition: delcodlg.hxx:36
InsertDeleteFlags GetDelContentsCmdBits() const
Definition: delcodlg.cxx:59
ScDeleteContentsDlg(weld::Window *pParent)
Definition: delcodlg.cxx:29
std::unique_ptr< weld::CheckButton > m_xBtnDelFormulas
Definition: delcodlg.hxx:34
void DisableChecks(bool bDelAllChecked)
Definition: delcodlg.cxx:85
std::unique_ptr< weld::CheckButton > m_xBtnDelObjects
Definition: delcodlg.hxx:37
IMPL_LINK_NOARG(ScDeleteContentsDlg, DelAllHdl, weld::Toggleable &, void)
Definition: delcodlg.cxx:119
InsertDeleteFlags
Definition: global.hxx:149
@ NOTE
Strings (and string results if InsertDeleteFlags::FORMULA is not set).
@ OBJECTS
Cell styles.
@ STRING
Dates, times, datetime values.
@ DATETIME
Numeric values (and numeric results if InsertDeleteFlags::FORMULA is not set).
@ ATTRIB
Internal use only (d&d undo): do not delete caption objects of cell notes.
@ FORMULA
Cell notes.