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