LibreOffice Module sc (master) 1
tpview.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 <tpview.hxx>
23#include <global.hxx>
24#include <viewopti.hxx>
25#include <scresid.hxx>
26#include <docsh.hxx>
27#include <sc.hrc>
28#include <strings.hrc>
29#include <units.hrc>
30#include <appoptio.hxx>
31#include <scmod.hxx>
32#include <svl/eitem.hxx>
33#include <svtools/unitconv.hxx>
34
36 : SfxTabPage(pPage, pController, "modules/scalc/ui/tpviewpage.ui", "TpViewPage", &rArgSet)
37 , m_xGridLB(m_xBuilder->weld_combo_box("grid"))
38 , m_xBreakCB(m_xBuilder->weld_check_button("break"))
39 , m_xGuideLineCB(m_xBuilder->weld_check_button("guideline"))
40 , m_xFormulaCB(m_xBuilder->weld_check_button("formula"))
41 , m_xNilCB(m_xBuilder->weld_check_button("nil"))
42 , m_xAnnotCB(m_xBuilder->weld_check_button("annot"))
43 , m_xFormulaMarkCB(m_xBuilder->weld_check_button("formulamark"))
44 , m_xValueCB(m_xBuilder->weld_check_button("value"))
45 , m_xAnchorCB(m_xBuilder->weld_check_button("anchor"))
46 , m_xRangeFindCB(m_xBuilder->weld_check_button("rangefind"))
47 , m_xObjGrfLB(m_xBuilder->weld_combo_box("objgrf"))
48 , m_xDiagramLB(m_xBuilder->weld_combo_box("diagram"))
49 , m_xDrawLB(m_xBuilder->weld_combo_box("draw"))
50 , m_xSyncZoomCB(m_xBuilder->weld_check_button("synczoom"))
51 , m_xRowColHeaderCB(m_xBuilder->weld_check_button("rowcolheader"))
52 , m_xHScrollCB(m_xBuilder->weld_check_button("hscroll"))
53 , m_xVScrollCB(m_xBuilder->weld_check_button("vscroll"))
54 , m_xTblRegCB(m_xBuilder->weld_check_button("tblreg"))
55 , m_xOutlineCB(m_xBuilder->weld_check_button("outline"))
56 , m_xSummaryCB(m_xBuilder->weld_check_button("cbSummary"))
57 , m_xThemedCursorRB(m_xBuilder->weld_radio_button("rbThemedCursor"))
58 , m_xSystemCursorRB(m_xBuilder->weld_radio_button("rbSystemCursor"))
59{
61 Link<weld::ComboBox&,void> aSelObjHdl(LINK( this, ScTpContentOptions, SelLbObjHdl ) );
62 m_xObjGrfLB->connect_changed(aSelObjHdl);
63 m_xDiagramLB->connect_changed(aSelObjHdl);
64 m_xDrawLB->connect_changed(aSelObjHdl);
65 m_xGridLB->connect_changed( LINK( this, ScTpContentOptions, GridHdl ) );
66
68 m_xFormulaCB->connect_toggled(aCBHdl);
69 m_xNilCB->connect_toggled(aCBHdl);
70 m_xAnnotCB->connect_toggled(aCBHdl);
71 m_xAnnotCB->set_accessible_description(ScResId(STR_A11Y_DESC_ANNOT));
72 m_xFormulaMarkCB->connect_toggled(aCBHdl);
73 m_xValueCB->connect_toggled(aCBHdl);
74 m_xAnchorCB->connect_toggled(aCBHdl);
75
76 m_xVScrollCB->connect_toggled(aCBHdl);
77 m_xHScrollCB->connect_toggled(aCBHdl);
78 m_xTblRegCB->connect_toggled(aCBHdl);
79 m_xOutlineCB->connect_toggled(aCBHdl);
80 m_xBreakCB->connect_toggled(aCBHdl);
81 m_xGuideLineCB->connect_toggled(aCBHdl);
82 m_xRowColHeaderCB->connect_toggled(aCBHdl);
83 m_xSummaryCB->connect_toggled(aCBHdl);
84 m_xThemedCursorRB->connect_toggled(aCBHdl);
85}
86
88{
89}
90
91std::unique_ptr<SfxTabPage> ScTpContentOptions::Create( weld::Container* pPage, weld::DialogController* pController,
92 const SfxItemSet* rCoreSet )
93{
94 return std::make_unique<ScTpContentOptions>(pPage, pController, *rCoreSet);
95}
96
98{
99 bool bRet = false;
100 if( m_xFormulaCB->get_state_changed_from_saved() ||
101 m_xNilCB->get_state_changed_from_saved() ||
102 m_xAnnotCB->get_state_changed_from_saved() ||
103 m_xFormulaMarkCB->get_state_changed_from_saved() ||
104 m_xValueCB->get_state_changed_from_saved() ||
105 m_xAnchorCB->get_state_changed_from_saved() ||
106 m_xObjGrfLB->get_value_changed_from_saved() ||
107 m_xDiagramLB->get_value_changed_from_saved() ||
108 m_xDrawLB->get_value_changed_from_saved() ||
109 m_xGridLB->get_value_changed_from_saved() ||
110 m_xRowColHeaderCB->get_state_changed_from_saved() ||
111 m_xHScrollCB->get_state_changed_from_saved() ||
112 m_xVScrollCB->get_state_changed_from_saved() ||
113 m_xTblRegCB->get_state_changed_from_saved() ||
114 m_xOutlineCB->get_state_changed_from_saved() ||
115 m_xBreakCB->get_state_changed_from_saved() ||
116 m_xSummaryCB->get_state_changed_from_saved() ||
117 m_xThemedCursorRB->get_state_changed_from_saved() ||
118 m_xGuideLineCB->get_state_changed_from_saved())
119 {
120 rCoreSet->Put(ScTpViewItem(*m_xLocalOptions));
121 bRet = true;
122 }
123 if(m_xRangeFindCB->get_state_changed_from_saved())
124 {
125 rCoreSet->Put(SfxBoolItem(SID_SC_INPUT_RANGEFINDER, m_xRangeFindCB->get_active()));
126 bRet = true;
127 }
128 if(m_xSyncZoomCB->get_state_changed_from_saved())
129 {
130 rCoreSet->Put(SfxBoolItem(SID_SC_OPT_SYNCZOOM, m_xSyncZoomCB->get_active()));
131 bRet = true;
132 }
133
134 return bRet;
135}
136
138{
139 if(const ScTpViewItem* pViewItem = rCoreSet->GetItemIfSet(SID_SCVIEWOPTIONS, false))
140 m_xLocalOptions.reset( new ScViewOptions( pViewItem->GetViewOptions() ) );
141 else
142 m_xLocalOptions.reset( new ScViewOptions );
143 m_xFormulaCB ->set_active(m_xLocalOptions->GetOption(VOPT_FORMULAS));
144 m_xNilCB ->set_active(m_xLocalOptions->GetOption(VOPT_NULLVALS));
145 m_xAnnotCB ->set_active(m_xLocalOptions->GetOption(VOPT_NOTES));
147 m_xValueCB ->set_active(m_xLocalOptions->GetOption(VOPT_SYNTAX));
148 m_xAnchorCB ->set_active(m_xLocalOptions->GetOption(VOPT_ANCHOR));
149
150 m_xObjGrfLB ->set_active( static_cast<sal_uInt16>(m_xLocalOptions->GetObjMode(VOBJ_TYPE_OLE)) );
151 m_xDiagramLB ->set_active( static_cast<sal_uInt16>(m_xLocalOptions->GetObjMode(VOBJ_TYPE_CHART)) );
152 m_xDrawLB ->set_active( static_cast<sal_uInt16>(m_xLocalOptions->GetObjMode(VOBJ_TYPE_DRAW)) );
153
154 m_xRowColHeaderCB->set_active( m_xLocalOptions->GetOption(VOPT_HEADER) );
155 m_xHScrollCB->set_active( m_xLocalOptions->GetOption(VOPT_HSCROLL) );
156 m_xVScrollCB->set_active( m_xLocalOptions->GetOption(VOPT_VSCROLL) );
157 m_xTblRegCB ->set_active( m_xLocalOptions->GetOption(VOPT_TABCONTROLS) );
158 m_xOutlineCB->set_active( m_xLocalOptions->GetOption(VOPT_OUTLINER) );
159 m_xSummaryCB->set_active( m_xLocalOptions->GetOption(VOPT_SUMMARY) );
160 if ( m_xLocalOptions->GetOption(VOPT_THEMEDCURSOR) )
161 m_xThemedCursorRB->set_active( true );
162 else
163 m_xSystemCursorRB->set_active( true );
164
165 InitGridOpt();
166
167 m_xBreakCB->set_active( m_xLocalOptions->GetOption(VOPT_PAGEBREAKS) );
168 m_xGuideLineCB->set_active( m_xLocalOptions->GetOption(VOPT_HELPLINES) );
169
170 if(const SfxBoolItem* pFinderItem = rCoreSet->GetItemIfSet(SID_SC_INPUT_RANGEFINDER, false))
171 m_xRangeFindCB->set_active(pFinderItem->GetValue());
172 if(const SfxBoolItem* pZoomItem = rCoreSet->GetItemIfSet(SID_SC_OPT_SYNCZOOM, false))
173 m_xSyncZoomCB->set_active(pZoomItem->GetValue());
174
175 m_xRangeFindCB->save_state();
176 m_xSyncZoomCB->save_state();
177
178 m_xFormulaCB->save_state();
179 m_xNilCB->save_state();
180 m_xAnnotCB->save_state();
181 m_xFormulaMarkCB->save_state();
182 m_xValueCB->save_state();
183 m_xAnchorCB->save_state();
184 m_xObjGrfLB->save_value();
185 m_xDiagramLB->save_value();
186 m_xDrawLB->save_value();
187 m_xRowColHeaderCB->save_state();
188 m_xHScrollCB->save_state();
189 m_xVScrollCB->save_state();
190 m_xTblRegCB->save_state();
191 m_xOutlineCB->save_state();
192 m_xGridLB->save_value();
193 m_xBreakCB->save_state();
194 m_xGuideLineCB->save_state();
195 m_xSummaryCB->save_state();
196 m_xThemedCursorRB->save_state();
197}
198
200{
201 if(const ScTpViewItem* pViewItem = rSet.GetItemIfSet(SID_SCVIEWOPTIONS, false))
202 *m_xLocalOptions = pViewItem->GetViewOptions();
203}
204
206{
207 if(pSetP)
208 FillItemSet(pSetP);
209 return DeactivateRC::LeavePage;
210}
211
212IMPL_LINK( ScTpContentOptions, SelLbObjHdl, weld::ComboBox&, rLb, void )
213{
214 const sal_Int32 nSelPos = rLb.get_active();
215 ScVObjMode eMode = ScVObjMode(nSelPos);
217
218 if ( &rLb == m_xDiagramLB.get() )
220 else if ( &rLb == m_xDrawLB.get() )
222
223 m_xLocalOptions->SetObjMode( eType, eMode );
224}
225
227{
228 ScViewOption eOption = VOPT_FORMULAS;
229 bool bChecked = rBtn.get_active();
230
231 if (m_xFormulaCB.get() == &rBtn ) eOption = VOPT_FORMULAS;
232 else if ( m_xNilCB.get() == &rBtn ) eOption = VOPT_NULLVALS;
233 else if ( m_xAnnotCB.get() == &rBtn ) eOption = VOPT_NOTES;
234 else if ( m_xFormulaMarkCB.get() == &rBtn ) eOption = VOPT_FORMULAS_MARKS;
235 else if ( m_xValueCB.get() == &rBtn ) eOption = VOPT_SYNTAX;
236 else if ( m_xAnchorCB.get() == &rBtn ) eOption = VOPT_ANCHOR;
237 else if ( m_xVScrollCB.get() == &rBtn ) eOption = VOPT_VSCROLL;
238 else if ( m_xHScrollCB.get() == &rBtn ) eOption = VOPT_HSCROLL;
239 else if ( m_xTblRegCB.get() == &rBtn ) eOption = VOPT_TABCONTROLS;
240 else if ( m_xOutlineCB.get() == &rBtn ) eOption = VOPT_OUTLINER;
241 else if ( m_xBreakCB.get() == &rBtn ) eOption = VOPT_PAGEBREAKS;
242 else if ( m_xGuideLineCB.get() == &rBtn ) eOption = VOPT_HELPLINES;
243 else if ( m_xRowColHeaderCB.get() == &rBtn ) eOption = VOPT_HEADER;
244 else if ( m_xSummaryCB.get() == &rBtn ) eOption = VOPT_SUMMARY;
245 else if ( m_xThemedCursorRB.get() == &rBtn ) eOption = VOPT_THEMEDCURSOR;
246
247 m_xLocalOptions->SetOption( eOption, bChecked );
248}
249
251{
252 bool bGrid = m_xLocalOptions->GetOption( VOPT_GRID );
253 bool bGridOnTop = m_xLocalOptions->GetOption( VOPT_GRID_ONTOP );
254 sal_Int32 nSelPos = 0;
255
256 if ( bGrid || bGridOnTop )
257 {
258 if ( !bGridOnTop )
259 nSelPos = 0;
260 else
261 nSelPos = 1;
262 }
263 else
264 nSelPos = 2;
265
266 m_xGridLB->set_active (nSelPos);
267}
268
270{
271 sal_Int32 nSelPos = rLb.get_active();
272 bool bGrid = ( nSelPos <= 1 );
273 bool bGridOnTop = ( nSelPos == 1 );
274
275 m_xLocalOptions->SetOption( VOPT_GRID, bGrid );
276 m_xLocalOptions->SetOption( VOPT_GRID_ONTOP, bGridOnTop );
277}
278
280 : SfxTabPage(pPage, pController, "modules/scalc/ui/scgeneralpage.ui", "ScGeneralPage", &rArgSet)
281 , pDoc(nullptr)
282 , m_xUnitLB(m_xBuilder->weld_combo_box("unitlb"))
283 , m_xTabMF(m_xBuilder->weld_metric_spin_button("tabmf", FieldUnit::CM))
284 , m_xAlwaysRB(m_xBuilder->weld_radio_button("alwaysrb"))
285 , m_xRequestRB(m_xBuilder->weld_radio_button("requestrb"))
286 , m_xNeverRB(m_xBuilder->weld_radio_button("neverrb"))
287 , m_xAlignCB(m_xBuilder->weld_check_button("aligncb"))
288 , m_xAlignLB(m_xBuilder->weld_combo_box("alignlb"))
289 , m_xEditModeCB(m_xBuilder->weld_check_button("editmodecb"))
290 , m_xFormatCB(m_xBuilder->weld_check_button("formatcb"))
291 , m_xExpRefCB(m_xBuilder->weld_check_button("exprefcb"))
292 , m_xSortRefUpdateCB(m_xBuilder->weld_check_button("sortrefupdatecb"))
293 , m_xMarkHdrCB(m_xBuilder->weld_check_button("markhdrcb"))
294 , m_xReplWarnCB(m_xBuilder->weld_check_button("replwarncb"))
295 , m_xLegacyCellSelectionCB(m_xBuilder->weld_check_button("legacy_cell_selection_cb"))
296 , m_xEnterPasteModeCB(m_xBuilder->weld_check_button("enter_paste_mode_cb"))
297{
299
300 m_xUnitLB->connect_changed( LINK( this, ScTpLayoutOptions, MetricHdl ) );
301 m_xAlignCB->connect_toggled(LINK(this, ScTpLayoutOptions, AlignHdl));
302
303 for (size_t i = 0; i < SAL_N_ELEMENTS(SCSTR_UNIT); ++i)
304 {
305 OUString sMetric = ScResId(SCSTR_UNIT[i].first);
306 FieldUnit eFUnit = SCSTR_UNIT[i].second;
307
308 switch ( eFUnit )
309 {
310 case FieldUnit::MM:
311 case FieldUnit::CM:
312 case FieldUnit::POINT:
313 case FieldUnit::PICA:
314 case FieldUnit::INCH:
315 {
316 // only use these metrics
317 m_xUnitLB->append(OUString::number(static_cast<sal_uInt32>(eFUnit)), sMetric);
318 }
319 break;
320 default:
321 {
322 // added to avoid warnings
323 }
324 }
325 }
326}
327
329{
330}
331
332std::unique_ptr<SfxTabPage> ScTpLayoutOptions::Create( weld::Container* pPage, weld::DialogController* pController,
333 const SfxItemSet* rCoreSet )
334{
335 auto xNew = std::make_unique<ScTpLayoutOptions>(pPage, pController, *rCoreSet);
336
337 ScDocShell* pDocSh = dynamic_cast< ScDocShell *>( SfxObjectShell::Current() );
338 if (pDocSh!=nullptr)
339 xNew->pDoc = &pDocSh->GetDocument();
340 return xNew;
341}
342
344{
345 bool bRet = true;
346 if (m_xUnitLB->get_value_changed_from_saved())
347 {
348 const sal_Int32 nMPos = m_xUnitLB->get_active();
349 sal_uInt16 nFieldUnit = m_xUnitLB->get_id(nMPos).toUInt32();
350 rCoreSet->Put( SfxUInt16Item( SID_ATTR_METRIC, nFieldUnit ) );
351 bRet = true;
352 }
353
354 if (m_xTabMF->get_value_changed_from_saved())
355 {
356 rCoreSet->Put(SfxUInt16Item(SID_ATTR_DEFTABSTOP,
357 sal::static_int_cast<sal_uInt16>( m_xTabMF->denormalize(m_xTabMF->get_value(FieldUnit::TWIP)) )));
358 bRet = true;
359 }
360
362
363 if (m_xRequestRB->get_active())
364 {
365 nSet=LM_ON_DEMAND;
366 }
367 else if (m_xNeverRB->get_active())
368 {
369 nSet=LM_NEVER;
370 }
371
372 if (m_xRequestRB->get_state_changed_from_saved() ||
373 m_xNeverRB->get_state_changed_from_saved() )
374 {
375 if(pDoc)
376 pDoc->SetLinkMode(nSet);
377 ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
378 aAppOptions.SetLinkMode(nSet );
379 SC_MOD()->SetAppOptions(aAppOptions);
380 bRet = true;
381 }
382 if (m_xAlignCB->get_state_changed_from_saved())
383 {
384 rCoreSet->Put(SfxBoolItem(SID_SC_INPUT_SELECTION, m_xAlignCB->get_active()));
385 bRet = true;
386 }
387
388 if (m_xAlignLB->get_value_changed_from_saved())
389 {
390 rCoreSet->Put(SfxUInt16Item(SID_SC_INPUT_SELECTIONPOS, m_xAlignLB->get_active()));
391 bRet = true;
392 }
393
394 if (m_xEditModeCB->get_state_changed_from_saved())
395 {
396 rCoreSet->Put(SfxBoolItem(SID_SC_INPUT_EDITMODE, m_xEditModeCB->get_active()));
397 bRet = true;
398 }
399
400 if (m_xFormatCB->get_state_changed_from_saved())
401 {
402 rCoreSet->Put(SfxBoolItem(SID_SC_INPUT_FMT_EXPAND, m_xFormatCB->get_active()));
403 bRet = true;
404 }
405
406 if (m_xExpRefCB->get_state_changed_from_saved())
407 {
408 rCoreSet->Put(SfxBoolItem(SID_SC_INPUT_REF_EXPAND, m_xExpRefCB->get_active()));
409 bRet = true;
410 }
411
412 if (m_xSortRefUpdateCB->get_state_changed_from_saved())
413 {
414 rCoreSet->Put(SfxBoolItem(SID_SC_OPT_SORT_REF_UPDATE, m_xSortRefUpdateCB->get_active()));
415 bRet = true;
416 }
417
418 if (m_xMarkHdrCB->get_state_changed_from_saved())
419 {
420 rCoreSet->Put(SfxBoolItem(SID_SC_INPUT_MARK_HEADER, m_xMarkHdrCB->get_active()));
421 bRet = true;
422 }
423
424 if (m_xReplWarnCB->get_state_changed_from_saved())
425 {
426 rCoreSet->Put( SfxBoolItem( SID_SC_INPUT_REPLCELLSWARN, m_xReplWarnCB->get_active() ) );
427 bRet = true;
428 }
429
430 if (m_xLegacyCellSelectionCB->get_state_changed_from_saved())
431 {
432 rCoreSet->Put( SfxBoolItem( SID_SC_INPUT_LEGACY_CELL_SELECTION, m_xLegacyCellSelectionCB->get_active() ) );
433 bRet = true;
434 }
435
436 if (m_xEnterPasteModeCB->get_state_changed_from_saved())
437 {
438 rCoreSet->Put( SfxBoolItem( SID_SC_INPUT_ENTER_PASTE_MODE, m_xEnterPasteModeCB->get_active() ) );
439 bRet = true;
440 }
441
442 return bRet;
443}
444
446{
447 m_xUnitLB->set_active(-1);
448 if ( rCoreSet->GetItemState( SID_ATTR_METRIC ) >= SfxItemState::DEFAULT )
449 {
450 const SfxUInt16Item& rItem = rCoreSet->Get( SID_ATTR_METRIC );
451 FieldUnit eFieldUnit = static_cast<FieldUnit>(rItem.GetValue());
452
453 for (sal_Int32 i = 0, nEntryCount = m_xUnitLB->get_count(); i < nEntryCount; ++i)
454 {
455 if (m_xUnitLB->get_id(i).toUInt32() == static_cast<sal_uInt32>(eFieldUnit))
456 {
457 m_xUnitLB->set_active(i);
458 break;
459 }
460 }
461 ::SetFieldUnit(*m_xTabMF, eFieldUnit);
462 }
463 m_xUnitLB->save_value();
464
465 if(const SfxUInt16Item* pTabStopItem = rCoreSet->GetItemIfSet(SID_ATTR_DEFTABSTOP, false))
466 m_xTabMF->set_value(m_xTabMF->normalize(pTabStopItem->GetValue()), FieldUnit::TWIP);
467 m_xTabMF->save_value();
468
469 m_xUnitLB->save_value();
470 m_xTabMF->save_value();
471
473
474 if(pDoc!=nullptr)
475 {
476 nSet=pDoc->GetLinkMode();
477 }
478
479 if(nSet==LM_UNKNOWN)
480 {
481 ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
482 nSet=aAppOptions.GetLinkMode();
483 }
484
485 switch(nSet)
486 {
487 case LM_ALWAYS: m_xAlwaysRB->set_active(true); break;
488 case LM_NEVER: m_xNeverRB->set_active(true); break;
489 case LM_ON_DEMAND: m_xRequestRB->set_active(true); break;
490 default:
491 {
492 // added to avoid warnings
493 }
494 }
495 if(const SfxBoolItem* pSelectionItem = rCoreSet->GetItemIfSet(SID_SC_INPUT_SELECTION, false))
496 m_xAlignCB->set_active(pSelectionItem->GetValue());
497
498 if(const SfxUInt16Item* pPosItem = rCoreSet->GetItemIfSet(SID_SC_INPUT_SELECTIONPOS, false))
499 m_xAlignLB->set_active(pPosItem->GetValue());
500
501 if(const SfxBoolItem* pEditModeItem = rCoreSet->GetItemIfSet(SID_SC_INPUT_EDITMODE, false))
502 m_xEditModeCB->set_active(pEditModeItem->GetValue());
503
504 if(const SfxBoolItem* pExpandItem = rCoreSet->GetItemIfSet(SID_SC_INPUT_FMT_EXPAND, false))
505 m_xFormatCB->set_active(pExpandItem->GetValue());
506
507 if(const SfxBoolItem* pExpandItem = rCoreSet->GetItemIfSet(SID_SC_INPUT_REF_EXPAND, false))
508 m_xExpRefCB->set_active(pExpandItem->GetValue());
509
510 if (const SfxBoolItem* pUpdateItem = rCoreSet->GetItemIfSet(SID_SC_OPT_SORT_REF_UPDATE))
511 m_xSortRefUpdateCB->set_active(pUpdateItem->GetValue());
512
513 if(const SfxBoolItem* pHeaderItem = rCoreSet->GetItemIfSet(SID_SC_INPUT_MARK_HEADER, false))
514 m_xMarkHdrCB->set_active(pHeaderItem->GetValue());
515
516 if( const SfxBoolItem* pWarnItem = rCoreSet->GetItemIfSet( SID_SC_INPUT_REPLCELLSWARN, false ) )
517 m_xReplWarnCB->set_active( pWarnItem->GetValue() );
518
519 if( const SfxBoolItem* pSelectionItem = rCoreSet->GetItemIfSet( SID_SC_INPUT_LEGACY_CELL_SELECTION, false ) )
520 m_xLegacyCellSelectionCB->set_active( pSelectionItem->GetValue() );
521
522 if( const SfxBoolItem* pPasteModeItem = rCoreSet->GetItemIfSet( SID_SC_INPUT_ENTER_PASTE_MODE, false ) )
523 m_xEnterPasteModeCB->set_active( pPasteModeItem->GetValue() );
524
525 m_xAlignCB->save_state();
526 m_xAlignLB->save_value();
527 m_xEditModeCB->save_state();
528 m_xFormatCB->save_state();
529
530 m_xExpRefCB->save_state();
531 m_xSortRefUpdateCB->save_state();
532 m_xMarkHdrCB->save_state();
533 m_xReplWarnCB->save_state();
534
535 m_xLegacyCellSelectionCB->save_state();
536 m_xEnterPasteModeCB->save_state();
537
538 AlignHdl(*m_xAlignCB);
539
540 m_xAlwaysRB->save_state();
541 m_xNeverRB->save_state();
542 m_xRequestRB->save_state();
543}
544
545void ScTpLayoutOptions::ActivatePage( const SfxItemSet& /* rCoreSet */ )
546{
547}
548
550{
551 if(pSetP)
552 FillItemSet(pSetP);
553 return DeactivateRC::LeavePage;
554}
555
557{
558 const sal_Int32 nMPos = m_xUnitLB->get_active();
559 if (nMPos != -1)
560 {
561 FieldUnit eFieldUnit = static_cast<FieldUnit>(m_xUnitLB->get_id(nMPos).toUInt32());
562 sal_Int64 nVal =
563 m_xTabMF->denormalize( m_xTabMF->get_value( FieldUnit::TWIP ) );
564 ::SetFieldUnit( *m_xTabMF, eFieldUnit );
565 m_xTabMF->set_value( m_xTabMF->normalize( nVal ), FieldUnit::TWIP );
566 }
567}
568
570{
571 m_xAlignLB->set_sensitive(rBox.get_active());
572}
573
574/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetValue() const
ScLkUpdMode GetLinkMode() const
Definition: appoptio.hxx:67
void SetLinkMode(ScLkUpdMode nSet)
Definition: appoptio.hxx:68
const ScDocument & GetDocument() const
Definition: docsh.hxx:219
SC_DLLPUBLIC ScLinkMode GetLinkMode(SCTAB nTab) const
Definition: documen3.cxx:502
void SetLinkMode(ScLkUpdMode nSet)
Definition: document.hxx:2261
std::unique_ptr< ScViewOptions > m_xLocalOptions
Definition: tpview.hxx:29
ScTpContentOptions(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpview.cxx:35
std::unique_ptr< weld::CheckButton > m_xRangeFindCB
Definition: tpview.hxx:41
std::unique_ptr< weld::CheckButton > m_xGuideLineCB
Definition: tpview.hxx:33
std::unique_ptr< weld::CheckButton > m_xOutlineCB
Definition: tpview.hxx:53
std::unique_ptr< weld::CheckButton > m_xValueCB
Definition: tpview.hxx:39
std::unique_ptr< weld::ComboBox > m_xGridLB
Definition: tpview.hxx:31
std::unique_ptr< weld::CheckButton > m_xVScrollCB
Definition: tpview.hxx:51
virtual ~ScTpContentOptions() override
Definition: tpview.cxx:87
std::unique_ptr< weld::CheckButton > m_xNilCB
Definition: tpview.hxx:36
std::unique_ptr< weld::CheckButton > m_xFormulaMarkCB
Definition: tpview.hxx:38
std::unique_ptr< weld::ComboBox > m_xDiagramLB
Definition: tpview.hxx:44
std::unique_ptr< weld::CheckButton > m_xRowColHeaderCB
Definition: tpview.hxx:49
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tpview.cxx:205
std::unique_ptr< weld::CheckButton > m_xFormulaCB
Definition: tpview.hxx:35
std::unique_ptr< weld::CheckButton > m_xHScrollCB
Definition: tpview.hxx:50
std::unique_ptr< weld::CheckButton > m_xSummaryCB
Definition: tpview.hxx:54
virtual void Reset(const SfxItemSet *rCoreSet) override
Definition: tpview.cxx:137
std::unique_ptr< weld::CheckButton > m_xBreakCB
Definition: tpview.hxx:32
std::unique_ptr< weld::RadioButton > m_xThemedCursorRB
Definition: tpview.hxx:55
virtual void ActivatePage(const SfxItemSet &) override
Definition: tpview.cxx:199
std::unique_ptr< weld::CheckButton > m_xTblRegCB
Definition: tpview.hxx:52
std::unique_ptr< weld::ComboBox > m_xDrawLB
Definition: tpview.hxx:45
std::unique_ptr< weld::RadioButton > m_xSystemCursorRB
Definition: tpview.hxx:56
std::unique_ptr< weld::CheckButton > m_xAnnotCB
Definition: tpview.hxx:37
std::unique_ptr< weld::ComboBox > m_xObjGrfLB
Definition: tpview.hxx:43
std::unique_ptr< weld::CheckButton > m_xSyncZoomCB
Definition: tpview.hxx:47
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rCoreSet)
Definition: tpview.cxx:91
virtual bool FillItemSet(SfxItemSet *rCoreSet) override
Definition: tpview.cxx:97
std::unique_ptr< weld::CheckButton > m_xAnchorCB
Definition: tpview.hxx:40
void InitGridOpt()
Definition: tpview.cxx:250
std::unique_ptr< weld::RadioButton > m_xAlwaysRB
Definition: tpview.hxx:82
std::unique_ptr< weld::CheckButton > m_xExpRefCB
Definition: tpview.hxx:90
ScTpLayoutOptions(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpview.cxx:279
std::unique_ptr< weld::RadioButton > m_xRequestRB
Definition: tpview.hxx:83
virtual void ActivatePage(const SfxItemSet &) override
Definition: tpview.cxx:545
std::unique_ptr< weld::MetricSpinButton > m_xTabMF
Definition: tpview.hxx:80
std::unique_ptr< weld::CheckButton > m_xFormatCB
Definition: tpview.hxx:89
std::unique_ptr< weld::CheckButton > m_xReplWarnCB
Definition: tpview.hxx:93
std::unique_ptr< weld::CheckButton > m_xAlignCB
Definition: tpview.hxx:86
ScDocument * pDoc
Definition: tpview.hxx:77
std::unique_ptr< weld::CheckButton > m_xLegacyCellSelectionCB
Definition: tpview.hxx:94
std::unique_ptr< weld::CheckButton > m_xSortRefUpdateCB
Definition: tpview.hxx:91
virtual bool FillItemSet(SfxItemSet *rCoreSet) override
Definition: tpview.cxx:343
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tpview.cxx:549
virtual ~ScTpLayoutOptions() override
Definition: tpview.cxx:328
std::unique_ptr< weld::CheckButton > m_xEnterPasteModeCB
Definition: tpview.hxx:95
virtual void Reset(const SfxItemSet *rCoreSet) override
Definition: tpview.cxx:445
std::unique_ptr< weld::CheckButton > m_xEditModeCB
Definition: tpview.hxx:88
std::unique_ptr< weld::CheckButton > m_xMarkHdrCB
Definition: tpview.hxx:92
std::unique_ptr< weld::ComboBox > m_xUnitLB
Definition: tpview.hxx:79
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rCoreSet)
Definition: tpview.cxx:332
std::unique_ptr< weld::ComboBox > m_xAlignLB
Definition: tpview.hxx:87
std::unique_ptr< weld::RadioButton > m_xNeverRB
Definition: tpview.hxx:84
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
void SetExchangeSupport()
FieldUnit
DocumentType eType
ScVObjMode
Definition: global.hxx:368
ScLkUpdMode
Definition: global.hxx:410
@ LM_NEVER
Definition: global.hxx:412
@ LM_ON_DEMAND
Definition: global.hxx:413
@ LM_UNKNOWN
Definition: global.hxx:414
@ LM_ALWAYS
Definition: global.hxx:411
Mode eMode
#define SAL_N_ELEMENTS(arr)
int i
constexpr OUStringLiteral first
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
#define SC_MOD()
Definition: scmod.hxx:247
static SfxItemSet & rSet
DeactivateRC
IMPL_LINK_NOARG(ScTpLayoutOptions, MetricHdl, weld::ComboBox &, void)
Definition: tpview.cxx:556
IMPL_LINK(ScTpContentOptions, SelLbObjHdl, weld::ComboBox &, rLb, void)
Definition: tpview.cxx:212
ScVObjType
Definition: viewopti.hxx:52
@ VOBJ_TYPE_CHART
Definition: viewopti.hxx:54
@ VOBJ_TYPE_OLE
Definition: viewopti.hxx:53
@ VOBJ_TYPE_DRAW
Definition: viewopti.hxx:55
ScViewOption
Definition: viewopti.hxx:31
@ VOPT_SUMMARY
Definition: viewopti.hxx:47
@ VOPT_TABCONTROLS
Definition: viewopti.hxx:39
@ VOPT_ANCHOR
Definition: viewopti.hxx:45
@ VOPT_NULLVALS
Definition: viewopti.hxx:33
@ VOPT_HSCROLL
Definition: viewopti.hxx:38
@ VOPT_OUTLINER
Definition: viewopti.hxx:40
@ VOPT_HELPLINES
Definition: viewopti.hxx:44
@ VOPT_GRID_ONTOP
Definition: viewopti.hxx:43
@ VOPT_FORMULAS_MARKS
Definition: viewopti.hxx:36
@ VOPT_GRID
Definition: viewopti.hxx:42
@ VOPT_FORMULAS
Definition: viewopti.hxx:32
@ VOPT_NOTES
Definition: viewopti.hxx:35
@ VOPT_THEMEDCURSOR
Definition: viewopti.hxx:48
@ VOPT_HEADER
Definition: viewopti.hxx:41
@ VOPT_PAGEBREAKS
Definition: viewopti.hxx:46
@ VOPT_SYNTAX
Definition: viewopti.hxx:34
@ VOPT_VSCROLL
Definition: viewopti.hxx:37