LibreOffice Module sw (master) 1
view.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#include <sal/config.h>
21
22#include <string_view>
23
24#include <config_features.h>
25#include <config_wasm_strip.h>
26
27#include <stdlib.h>
28#include <hintids.hxx>
29#include <comphelper/string.hxx>
30#include <comphelper/lok.hxx>
31#include <o3tl/any.hxx>
32#include <o3tl/string_view.hxx>
33#include <officecfg/Office/Common.hxx>
34#include <vcl/graph.hxx>
35#include <vcl/inputctx.hxx>
36#include <svl/eitem.hxx>
38#include <unotools/lingucfg.hxx>
40#include <sfx2/dispatch.hxx>
41#include <sfx2/docfile.hxx>
42#include <sfx2/objface.hxx>
43#include <sfx2/request.hxx>
44#include <svx/ruler.hxx>
45#include <svx/srchdlg.hxx>
46#include <svx/fmshell.hxx>
47#include <svx/extrusionbar.hxx>
48#include <svx/fontworkbar.hxx>
49#include <svx/fmview.hxx>
50#include <unotxvw.hxx>
51#include <cmdid.h>
52#include <svl/hint.hxx>
53#include <swmodule.hxx>
54#include <inputwin.hxx>
55#include <uivwimp.hxx>
56#include <edtwin.hxx>
57#include <textsh.hxx>
58#include <listsh.hxx>
59#include <tabsh.hxx>
60#include <grfsh.hxx>
61#include <mediash.hxx>
62#include <docsh.hxx>
63#include <frmsh.hxx>
64#include <olesh.hxx>
65#include <drawsh.hxx>
66#include <drawbase.hxx>
67#include <drformsh.hxx>
68#include <drwtxtsh.hxx>
69#include <beziersh.hxx>
70#include <navsh.hxx>
71#include <globdoc.hxx>
72#include <scroll.hxx>
73#include <gloshdl.hxx>
74#include <usrpref.hxx>
75#include <srcview.hxx>
76#include <doc.hxx>
77#include <IDocumentUndoRedo.hxx>
81#include <IDocumentState.hxx>
83#include <drawdoc.hxx>
84#include <wdocsh.hxx>
85#include <wrtsh.hxx>
86#include <barcfg.hxx>
87#include <pview.hxx>
88#include <swdtflvr.hxx>
89#include <prtopt.hxx>
90#include <com/sun/star/frame/FrameSearchFlag.hpp>
91#include <com/sun/star/frame/XLayoutManager.hpp>
92#include <com/sun/star/scanner/ScannerContext.hpp>
93#include <com/sun/star/scanner/XScannerManager2.hpp>
94#include <com/sun/star/lang/XMultiServiceFactory.hpp>
95#include <com/sun/star/sdb/XDatabaseContext.hpp>
96#include <com/sun/star/sdb/DatabaseContext.hpp>
98#include <sal/log.hxx>
99
100#include <formatclipboard.hxx>
101#include <PostItMgr.hxx>
102#include <annotsh.hxx>
103#include <swruler.hxx>
105#include <com/sun/star/document/XDocumentProperties.hpp>
106#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
107
109#include <sfx2/lokhelper.hxx>
110#include <LibreOfficeKit/LibreOfficeKitEnums.h>
111#include <svtools/embedhlp.hxx>
113
114using namespace ::com::sun::star;
115using namespace ::com::sun::star::uno;
116using namespace ::com::sun::star::lang;
117using namespace ::com::sun::star::scanner;
118using namespace ::com::sun::star::sdb;
119using namespace ::com::sun::star::sdbc;
120
121#define SWVIEWFLAGS SfxViewShellFlags::HAS_PRINTOPTIONS
122
123// Statics. OMG.
124
125bool bDocSzUpdated = true;
126
128
129bool SwView::s_bExtra = false;
130bool SwView::s_bFound = false;
131bool SwView::s_bJustOpened = false;
132
133std::unique_ptr<SearchAttrItemList> SwView::s_xSearchList;
134std::unique_ptr<SearchAttrItemList> SwView::s_xReplaceList;
135
137{
138 return *GetViewFrame().GetDispatcher();
139}
140
142{
143 bool bResetVerbs = m_bVerbsActive;
144 if ( !GetViewFrame().GetFrame().IsInPlace() &&
146 {
147 FlyProtectFlags eProtectFlags = m_pWrtShell->IsSelObjProtected(FlyProtectFlags::Content);
148 if (eProtectFlags == FlyProtectFlags::NONE || nSelType & SelectionType::Ole)
149 {
150 if ( nSelType & SelectionType::Ole )
151 {
152 SetVerbs( GetWrtShell().GetOLEObject()->getSupportedVerbs() );
153 m_bVerbsActive = true;
154 bResetVerbs = false;
155 }
156 }
157 }
158 if ( bResetVerbs )
159 {
160 SetVerbs( Sequence< embed::VerbDescriptor >() );
161 m_bVerbsActive = false;
162 }
163}
164
165// Called by the SwEditWin when it gets the focus.
166
168{
169 // if we got the focus, and the form shell *is* on the top of the dispatcher
170 // stack, then we need to rebuild the stack (the form shell doesn't belong to
171 // the top then)
172 const SfxDispatcher& rDispatcher = const_cast< SwView* >( this )->GetDispatcher();
173 SfxShell* pTopShell = rDispatcher.GetShell( 0 );
174 FmFormShell* pAsFormShell = dynamic_cast<FmFormShell*>( pTopShell );
175 if ( pAsFormShell )
176 {
177 pAsFormShell->ForgetActiveControl();
178 const_cast< SwView* >( this )->AttrChangedNotify(nullptr);
179 }
180 else if ( m_pPostItMgr )
181 {
182 SwAnnotationShell* pAsAnnotationShell = dynamic_cast<SwAnnotationShell*>( pTopShell );
183 if ( pAsAnnotationShell )
184 {
185 m_pPostItMgr->SetActiveSidebarWin(nullptr);
186 const_cast< SwView* >( this )->AttrChangedNotify(nullptr);
187 }
188 }
189 if (SwWrtShell* pWrtShell = GetWrtShellPtr())
190 {
191 SwWrtShell& rWrtShell = GetWrtShell();
192 rWrtShell.GetDoc()->getIDocumentLayoutAccess().SetCurrentViewShell( pWrtShell );
194 rWrtShell.GetViewOptions()->getBrowseMode() );
195 }
196}
197
198// called by the FormShell when a form control is focused. This is
199// a request to put the form shell on the top of the dispatcher stack
200
201IMPL_LINK_NOARG(SwView, FormControlActivated, LinkParamNone*, void)
202{
203 // if a form control has been activated, and the form shell is not on the top
204 // of the dispatcher stack, then we need to activate it
205 const SfxDispatcher& rDispatcher = GetDispatcher();
206 const SfxShell* pTopShell = rDispatcher.GetShell( 0 );
207 const FmFormShell* pAsFormShell = dynamic_cast<const FmFormShell*>( pTopShell );
208 if ( !pAsFormShell )
209 {
210 // if we're editing text currently, cancel this
211 SdrView *pSdrView = m_pWrtShell ? m_pWrtShell->GetDrawView() : nullptr;
212 if ( pSdrView && pSdrView->IsTextEdit() )
213 pSdrView->SdrEndTextEdit( true );
214
215 AttrChangedNotify(nullptr);
216 }
217}
218
219namespace
220{
221uno::Reference<frame::XLayoutManager> getLayoutManager(const SfxViewFrame& rViewFrame)
222{
223 uno::Reference<frame::XLayoutManager> xLayoutManager;
224 uno::Reference<beans::XPropertySet> xPropSet(rViewFrame.GetFrame().GetFrameInterface(),
225 uno::UNO_QUERY);
226 if (xPropSet.is())
227 {
228 try
229 {
230 xLayoutManager.set(xPropSet->getPropertyValue("LayoutManager"), uno::UNO_QUERY);
231 }
232 catch (const Exception& e)
233 {
234 SAL_WARN("sw.ui", "Failure getting layout manager: " + e.Message);
235 }
236 }
237 return xLayoutManager;
238}
239}
240
241void SwView::ShowUIElement(const OUString& sElementURL) const
242{
243 if (auto xLayoutManager = getLayoutManager(GetViewFrame()))
244 {
245 if (!xLayoutManager->getElement(sElementURL).is())
246 {
247 xLayoutManager->createElement(sElementURL);
248 xLayoutManager->showElement(sElementURL);
249 }
250 }
251}
252
254{
255 // Attention: Maintain the SelectShell for the WebView additionally
256
257 if(m_bInDtor)
258 return;
259
260 // Decision if the UpdateTable has to be called
261 bool bUpdateTable = false;
262 const SwFrameFormat* pCurTableFormat = m_pWrtShell->GetTableFormat();
263 if(pCurTableFormat && pCurTableFormat != m_pLastTableFormat)
264 {
265 bUpdateTable = true; // can only be executed later
266 }
267 m_pLastTableFormat = pCurTableFormat;
268
269 //SEL_TBL and SEL_TBL_CELLS can be ORed!
270 SelectionType nNewSelectionType = m_pWrtShell->GetSelectionType()
271 & ~SelectionType::TableCell;
272
273 // Determine if a different fly frame was selected.
274 bool bUpdateFly = false;
275 const SwFrameFormat* pCurFlyFormat = nullptr;
277 {
278 pCurFlyFormat = m_pWrtShell->GetFlyFrameFormat();
279 }
280 if (pCurFlyFormat && pCurFlyFormat != m_pLastFlyFormat)
281 {
282 bUpdateFly = true;
283 }
284 m_pLastFlyFormat = pCurFlyFormat;
285
287 nNewSelectionType |= SelectionType::FormControl;
288
289 if ( nNewSelectionType == m_nSelectionType )
290 {
294 // For graphs and OLE the verb can be modified of course!
295 ImpSetVerb( nNewSelectionType );
296
297 if (bUpdateFly)
298 {
299 SfxViewFrame& rViewFrame = GetViewFrame();
300 uno::Reference<frame::XFrame> xFrame = rViewFrame.GetFrame().GetFrameInterface();
301 if (xFrame.is())
302 {
303 // Invalidate cached dispatch objects.
304 xFrame->contextChanged();
305 }
306 }
307 }
308 else
309 {
310
311 SfxDispatcher &rDispatcher = GetDispatcher();
312 SwToolbarConfigItem *pBarCfg = SW_MOD()->GetToolbarConfig();
313
314 if ( m_pShell )
315 {
316 rDispatcher.Flush(); // Really erase all cached shells
317 //Remember to the old selection which toolbar was visible
319 if (eId != ToolbarId::None)
320 pBarCfg->SetTopToolbar(m_nSelectionType, eId);
321
322 for ( sal_uInt16 i = 0; true; ++i )
323 {
324 SfxShell *pSfxShell = rDispatcher.GetShell( i );
325 if ( dynamic_cast< const SwBaseShell *>( pSfxShell ) != nullptr
326 || dynamic_cast< const SwDrawTextShell *>( pSfxShell ) != nullptr
327 || dynamic_cast< const svx::ExtrusionBar*>( pSfxShell ) != nullptr
328 || dynamic_cast< const svx::FontworkBar*>( pSfxShell ) != nullptr
329 || dynamic_cast< const SwAnnotationShell *>( pSfxShell ) != nullptr
330 )
331 {
332 rDispatcher.Pop( *pSfxShell, SfxDispatcherPopFlags::POP_DELETE );
333 }
334 else if ( dynamic_cast< const FmFormShell *>( pSfxShell ) != nullptr )
335 {
336 rDispatcher.Pop( *pSfxShell );
337 }
338 else
339 break;
340 }
341 }
342
343 bool bInitFormShell = false;
344 if (!m_pFormShell)
345 {
346 bInitFormShell = true;
347 m_pFormShell = new FmFormShell( this );
348 m_pFormShell->SetControlActivationHandler( LINK( this, SwView, FormControlActivated ) );
350 }
351
352 bool bSetExtInpCntxt = false;
353 m_nSelectionType = nNewSelectionType;
354 ShellMode eShellMode;
355
357 rDispatcher.Push( *m_pFormShell );
358
359 m_pShell = new SwNavigationShell( *this );
360 rDispatcher.Push( *m_pShell );
361
363 {
364 eShellMode = ShellMode::Object;
365 m_pShell = new SwOleShell( *this );
366 rDispatcher.Push( *m_pShell );
367 }
370 {
371 eShellMode = ShellMode::Frame;
372 m_pShell = new SwFrameShell( *this );
373 rDispatcher.Push( *m_pShell );
375 {
376 eShellMode = ShellMode::Graphic;
377 m_pShell = new SwGrfShell( *this );
378 rDispatcher.Push( *m_pShell );
379 }
380 }
382 {
383 eShellMode = ShellMode::Draw;
384 m_pShell = new SwDrawShell( *this );
385 rDispatcher.Push( *m_pShell );
386
388 {
389 eShellMode = ShellMode::Bezier;
390 m_pShell = new SwBezierShell( *this );
391 rDispatcher.Push( *m_pShell );
392 }
393#if HAVE_FEATURE_AVMEDIA
395 {
396 eShellMode = ShellMode::Media;
397 m_pShell = new SwMediaShell( *this );
398 rDispatcher.Push( *m_pShell );
399 }
400#endif
402 {
404 m_pShell = new svx::ExtrusionBar(this);
405 rDispatcher.Push( *m_pShell );
406 }
408 {
409 eShellMode = ShellMode::FontWork;
410 m_pShell = new svx::FontworkBar(this);
411 rDispatcher.Push( *m_pShell );
412 }
413 }
415 {
416 eShellMode = ShellMode::DrawForm;
417 m_pShell = new SwDrawFormShell( *this );
418
419 rDispatcher.Push( *m_pShell );
420 }
422 {
423 bSetExtInpCntxt = true;
424 eShellMode = ShellMode::DrawText;
425 rDispatcher.Push( *(new SwBaseShell( *this )) );
426 m_pShell = new SwDrawTextShell( *this );
427 rDispatcher.Push( *m_pShell );
428 }
430 {
431 eShellMode = ShellMode::PostIt;
432 m_pShell = new SwAnnotationShell( *this );
433 rDispatcher.Push( *m_pShell );
434 }
435 else
436 {
437 bSetExtInpCntxt = true;
438 eShellMode = ShellMode::Text;
440 {
441 eShellMode = ShellMode::ListText;
442 m_pShell = new SwListShell( *this );
443 rDispatcher.Push( *m_pShell );
444 }
445 m_pShell = new SwTextShell(*this);
446 rDispatcher.Push( *m_pShell );
448 {
449 eShellMode = eShellMode == ShellMode::ListText ? ShellMode::TableListText
451 m_pShell = new SwTableShell( *this );
452 rDispatcher.Push( *m_pShell );
453 }
454 }
455
457 rDispatcher.Push( *m_pFormShell );
458
459 m_pViewImpl->SetShellMode(eShellMode);
461
462 if( !GetDocShell()->IsReadOnly() )
463 {
464 if( bSetExtInpCntxt && GetWrtShell().HasReadonlySel() )
465 bSetExtInpCntxt = false;
466
467 InputContext aCntxt( GetEditWin().GetInputContext() );
468 aCntxt.SetOptions( bSetExtInpCntxt
469 ? (aCntxt.GetOptions() |
470 ( InputContextFlags::Text |
471 InputContextFlags::ExtText ))
472 : (aCntxt.GetOptions() & ~
473 InputContextFlags( InputContextFlags::Text |
474 InputContextFlags::ExtText )) );
475 GetEditWin().SetInputContext( aCntxt );
476 }
477
478 // Show Mail Merge toolbar initially for documents with Database fields
479 if (!m_bInitOnceCompleted && GetWrtShell().IsAnyDatabaseFieldInDoc())
480 ShowUIElement("private:resource/toolbar/mailmerge");
481
482 // Activate the toolbar to the new selection which also was active last time.
483 // Before a flush () must be, but does not affect the UI according to MBA and
484 // is not a performance problem.
485 // TODO/LATER: maybe now the Flush() command is superfluous?!
486 rDispatcher.Flush();
487
488 Point aPnt = GetEditWin().OutputToScreenPixel(GetEditWin().GetPointerPosPixel());
489 aPnt = GetEditWin().PixelToLogic(aPnt);
491
492 SdrView* pDView = GetWrtShell().GetDrawView();
493 if ( bInitFormShell && pDView )
494 m_pFormShell->SetView(dynamic_cast<FmFormView*>( pDView) );
495
496 }
497 // Opportune time for the communication with OLE objects?
498 if ( GetDocShell()->GetDoc()->IsOLEPrtNotifyPending() )
499 GetDocShell()->GetDoc()->PrtOLENotify( false );
500
501 // now the table-update
502 if(bUpdateTable)
503 m_pWrtShell->UpdateTable();
504
506
508}
509
510// Interaction: AttrChangedNotify() and TimeoutHdl.
511// No Update if actions are still open, since the cursor on the core side
512// can be somewhere in no man's land.
513// But since we can no longer supply status and we want instead lock
514// the dispatcher.
515
516extern "C"
517{
518 static int lcl_CmpIds( const void *pFirst, const void *pSecond)
519 {
520 return *static_cast<sal_uInt16 const *>(pFirst) - *static_cast<sal_uInt16 const *>(pSecond);
521 }
522}
523
524IMPL_LINK_NOARG(SwView, AttrChangedNotify, LinkParamNone*, void)
525{
526 if ( GetEditWin().IsChainMode() )
527 GetEditWin().SetChainMode( false );
528
529 if (!m_pWrtShell || !GetDocShell())
530 {
531 return;
532 }
533
534 //Opt: Not if PaintLocked. During unlock a notify will be once more triggered.
535 if( !m_pWrtShell->IsPaintLocked() && !g_bNoInterrupt &&
536 GetDocShell()->IsReadOnly() )
537 CheckReadonlyState();
538
539 if( !m_pWrtShell->IsPaintLocked() && !g_bNoInterrupt )
540 CheckReadonlySelection();
541
542 if( !m_bAttrChgNotified )
543 {
544 if (m_pWrtShell->ActionPend() || g_bNoInterrupt ||
545 GetDispatcher().IsLocked() || //do not confuse the SFX
546 GetViewFrame().GetBindings().IsInUpdate() )//do not confuse the SFX
547 {
548 m_bAttrChgNotified = true;
549 m_aTimer.Start();
550
551 const SfxBoolItem *pItem =
552 GetObjectShell()->GetMedium()->GetItemSet().
553 GetItemIfSet( SID_HIDDEN, false );
554 if ( !pItem || !pItem->GetValue() )
555 {
556 GetViewFrame().GetBindings().ENTERREGISTRATIONS();
557 m_bAttrChgNotifiedWithRegistrations = true;
558 }
559
560 }
561 else
562 SelectShell();
563
564 }
565
566 // change ui if cursor is at a SwPostItField
567 if (m_pPostItMgr)
568 {
569 // only perform the code that is needed to determine, if at the
570 // actual cursor position is a post-it field
571 m_pPostItMgr->SetShadowState( m_pWrtShell->GetPostItFieldAtCursor() );
572 }
573}
574
575IMPL_LINK_NOARG(SwView, TimeoutHdl, Timer *, void)
576{
577 if (m_pWrtShell->ActionPend() || g_bNoInterrupt)
578 {
579 m_aTimer.Start();
580 return;
581 }
582
583 if ( m_bAttrChgNotifiedWithRegistrations )
584 {
585 GetViewFrame().GetBindings().LEAVEREGISTRATIONS();
586 m_bAttrChgNotifiedWithRegistrations = false;
587 }
588
589 CheckReadonlyState();
590 CheckReadonlySelection();
591
592 bool bOldUndo = m_pWrtShell->DoesUndo();
593 m_pWrtShell->DoUndo( false );
594 SelectShell();
595 m_pWrtShell->DoUndo( bOldUndo );
596 m_bAttrChgNotified = false;
597 GetViewImpl()->GetUNOObject_Impl()->NotifySelChanged();
598}
599
601{
603 // To be able to recognize if it is already disabled!
604 SfxItemState eStateRO, eStateProtAll;
605 const SfxPoolItem *pItem;
606 // Query the status from a slot which is only known to us.
607 // Otherwise the slot is known from other; like the BasicIde
608 eStateRO = rDis.QueryState( FN_INSERT_BOOKMARK, pItem );
609 eStateProtAll = rDis.QueryState( FN_EDIT_REGION, pItem );
610 bool bChgd = false;
611
612 if ( !m_pWrtShell->IsCursorReadonly() )
613 {
614 static sal_uInt16 aROIds[] =
615 {
616 SID_DELETE, FN_BACKSPACE, FN_SHIFT_BACKSPACE,
617 SID_UNDO,
618 SID_REDO, SID_REPEAT, SID_PASTE,
619 SID_PASTE_UNFORMATTED, FN_PASTE_NESTED_TABLE, FN_TABLE_PASTE_ROW_BEFORE,
620 FN_TABLE_PASTE_COL_BEFORE, SID_PASTE_SPECIAL, SID_SBA_BRW_INSERT,
621 SID_BACKGROUND_COLOR, FN_INSERT_BOOKMARK, SID_CHARMAP_CONTROL,
622 SID_CHARMAP, FN_INSERT_SOFT_HYPHEN,
623 FN_INSERT_HARDHYPHEN, FN_INSERT_HARD_SPACE, FN_INSERT_NNBSP,
632 FN_CALCULATE, FN_FORMAT_RESET,
633 FN_POSTIT, FN_JAVAEDIT, SID_ATTR_PARA_ADJUST_LEFT,
634 SID_ATTR_PARA_ADJUST_RIGHT, SID_ATTR_PARA_ADJUST_CENTER,SID_ATTR_PARA_ADJUST_BLOCK,
635 SID_ATTR_PARA_LINESPACE_10, SID_ATTR_PARA_LINESPACE_15, SID_ATTR_PARA_LINESPACE_20,
636 SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONTHEIGHT, SID_ATTR_CHAR_COLOR_BACKGROUND,
637 SID_ATTR_CHAR_BACK_COLOR,
638 SID_ATTR_CHAR_COLOR_BACKGROUND_EXT, SID_ATTR_CHAR_COLOR_EXT,
639 SID_ATTR_CHAR_COLOR, SID_ATTR_CHAR_WEIGHT, SID_ATTR_CHAR_POSTURE,
640 SID_ATTR_CHAR_OVERLINE,
641 SID_ATTR_CHAR_UNDERLINE, SID_ATTR_FLASH, SID_ATTR_CHAR_STRIKEOUT,
642 SID_ULINE_VAL_SINGLE, SID_ULINE_VAL_DOUBLE, SID_ULINE_VAL_DOTTED,
643 SID_ATTR_CHAR_CONTOUR, SID_ATTR_CHAR_SHADOWED,
644 SID_ATTR_CHAR_AUTOKERN, SID_ATTR_CHAR_ESCAPEMENT, FN_SET_SUPER_SCRIPT,
645 FN_SET_SUB_SCRIPT, SID_ATTR_CHAR_CASEMAP, SID_ATTR_CHAR_LANGUAGE,
646 SID_ATTR_CHAR_KERNING, SID_CHAR_DLG, SID_ATTR_CHAR_WORDLINEMODE,
648 FN_FORMAT_DROPCAPS, SID_ATTR_PARA_ADJUST, SID_ATTR_PARA_LINESPACE,
649 SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_KEEP, SID_ATTR_PARA_WIDOWS,
650 SID_ATTR_PARA_ORPHANS,
651 SID_ATTR_PARA_MODEL, SID_PARA_DLG,
652 FN_SELECT_PARA, SID_DEC_INDENT,
653 SID_INC_INDENT
654 };
655 static bool bFirst = true;
656 if ( bFirst )
657 {
658 qsort( static_cast<void*>(aROIds), SAL_N_ELEMENTS(aROIds), sizeof(sal_uInt16), lcl_CmpIds );
659 bFirst = false;
660 }
661 if ( SfxItemState::DISABLED == eStateRO )
662 {
663 rDis.SetSlotFilter( SfxSlotFilterState::ENABLED_READONLY, aROIds );
664 bChgd = true;
665 }
666 }
667 else if( m_pWrtShell->IsAllProtect() )
668 {
669 if ( SfxItemState::DISABLED == eStateProtAll )
670 {
671 static sal_uInt16 aAllProtIds[] = { SID_SAVEDOC, FN_EDIT_REGION };
672 static bool bAllProtFirst = true;
673 if ( bAllProtFirst )
674 {
675 qsort( static_cast<void*>(aAllProtIds), SAL_N_ELEMENTS(aAllProtIds), sizeof(sal_uInt16), lcl_CmpIds );
676 bAllProtFirst = false;
677 }
678 rDis.SetSlotFilter( SfxSlotFilterState::ENABLED_READONLY, aAllProtIds );
679 bChgd = true;
680 }
681 }
682 else if ( SfxItemState::DISABLED != eStateRO ||
683 SfxItemState::DISABLED != eStateProtAll )
684 {
685 bChgd = true;
686 rDis.SetSlotFilter();
687 }
688 if ( bChgd )
690}
691
693{
694 SfxDisableFlags nDisableFlags = SfxDisableFlags::NONE;
696
697 if( m_pWrtShell->HasReadonlySel() &&
698 ( !m_pWrtShell->GetDrawView() ||
699 !m_pWrtShell->GetDrawView()->GetMarkedObjectList().GetMarkCount() ))
700 nDisableFlags |= SfxDisableFlags::SwOnProtectedCursor;
701
702 if( (SfxDisableFlags::SwOnProtectedCursor & nDisableFlags ) !=
703 (SfxDisableFlags::SwOnProtectedCursor & rDis.GetDisableFlags() ) )
704 {
705 // Additionally move at the Window the InputContext, so that
706 // in japanese / chinese versions the external input will be
707 // turned on or off. This but only if the correct shell is on
708 // the stack.
709 switch( m_pViewImpl->GetShellMode() )
710 {
711 case ShellMode::Text:
715 {
716// Temporary solution!!! Should set the font of the current insertion point
717// at each cursor movement, so outside of this "if". But TH does not
718// evaluates the font at this time and the "purchase" appears to me
719// as too expensive.
720// Moreover, we don't have a font, but only attributes from which the
721// text formatting and the correct font will be build together.
722
723 InputContext aCntxt( GetEditWin().GetInputContext() );
724 aCntxt.SetOptions( SfxDisableFlags::SwOnProtectedCursor & nDisableFlags
725 ? (aCntxt.GetOptions() & ~
726 InputContextFlags( InputContextFlags::Text |
727 InputContextFlags::ExtText ))
728 : (aCntxt.GetOptions() |
729 ( InputContextFlags::Text |
730 InputContextFlags::ExtText )) );
731 GetEditWin().SetInputContext( aCntxt );
732 }
733 break;
734 default:
735 ;
736 }
737
738 }
739
740 if( nDisableFlags != rDis.GetDisableFlags() )
741 {
742 rDis.SetDisableFlags( nDisableFlags );
744 }
745}
746
748 : SfxViewShell(_rFrame, SWVIEWFLAGS),
749 m_aTimer( "sw::SwView m_aTimer" ),
750 m_nNewPage(USHRT_MAX),
751 m_nOldPageNum(0),
752 m_pNumRuleNodeFromDoc(nullptr),
753 m_pEditWin( VclPtr<SwEditWin>::Create( &_rFrame.GetWindow(), *this ) ),
754 m_pShell(nullptr),
755 m_pFormShell(nullptr),
756 m_pHScrollbar(nullptr),
757 m_pVScrollbar(nullptr),
758 m_pVRuler(VclPtr<SvxRuler>::Create(&GetViewFrame().GetWindow(), m_pEditWin,
761 GetViewFrame().GetBindings(),
763 m_pLastTableFormat(nullptr),
764 m_pLastFlyFormat(nullptr),
765 m_pFormatClipboard(new SwFormatClipboard()),
766 m_nSelectionType( SelectionType::All ),
767 m_nPageCnt(0),
768 m_nDrawSfxId( USHRT_MAX ),
769 m_nFormSfxId( USHRT_MAX ),
770 m_eFormObjKind(SdrObjKind::NONE),
771 m_nLastPasteDestination( static_cast<SotExchangeDest>(0xFFFF) ),
772 m_nLeftBorderDistance( 0 ),
773 m_nRightBorderDistance( 0 ),
774 m_eLastSearchCommand( static_cast<SvxSearchCmd>(0xFFFF) ),
775 m_bWheelScrollInProgress(false),
776 m_bCenterCursor(false),
777 m_bTopCursor(false),
778 m_bTabColFromDoc(false),
779 m_bTabRowFromDoc(false),
780 m_bSetTabColFromDoc(false),
781 m_bSetTabRowFromDoc(false),
782 m_bAttrChgNotified(false),
783 m_bAttrChgNotifiedWithRegistrations(false),
784 m_bVerbsActive(false),
785 m_bDrawRotate(false),
786 m_bDrawSelMode(true),
787 m_bShowAtResize(true),
788 m_bInOuterResizePixel(false),
789 m_bInInnerResizePixel(false),
790 m_bPasteState(false),
791 m_bPasteSpecialState(false),
792 m_bInMailMerge(false),
793 m_bInDtor(false),
794 m_bOldShellWasPagePreview(false),
795 m_bIsPreviewDoubleClick(false),
796 m_bMakeSelectionVisible(false),
797 m_bForceChangesToolbar(true),
798 m_nLOKPageUpDownOffset(0)
799{
800 static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
801 if (bRequestDoubleBuffering)
802 m_pEditWin->RequestDoubleBuffering(true);
803
804 // According to discussion with MBA and further
805 // investigations, no old SfxViewShell will be set as parameter <pOldSh>,
806 // if function "New Window" is performed to open an additional view beside
807 // an already existing one.
808 // If the view is switch from one to another, the 'old' view is given by
809 // parameter <pOldSh>.
810
811 bDocSzUpdated = true;
812
813 static bool bFuzzing = utl::ConfigManager::IsFuzzing();
814
815 if (!bFuzzing)
816 {
817 CreateScrollbar( true );
818 CreateScrollbar( false );
819 }
820
821 m_pViewImpl.reset(new SwView_Impl(this));
822 SetName("View");
824
825 m_aTimer.SetTimeout( 120 );
826
827 SwDocShell& rDocSh = dynamic_cast<SwDocShell&>(*_rFrame.GetObjectShell());
828 bool bOldModifyFlag = rDocSh.IsEnableSetModified();
829 if (bOldModifyFlag)
830 rDocSh.EnableSetModified( false );
831 // HACK: SwDocShell has some cached font info, VCL informs about font updates,
832 // but loading of docs with embedded fonts happens after SwDocShell is created
833 // but before SwEditWin (which handles the VCL event) is created. So update
834 // manually.
836 rDocSh.UpdateFontList();
837 bool bWebDShell = dynamic_cast<const SwWebDocShell*>(&rDocSh) != nullptr;
838
839 const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(bWebDShell);
840 SwViewOption aUsrPref( *pUsrPref);
841
843 SvtLinguOptions aLinguOpt;
844 SvtLinguConfig().GetOptions( aLinguOpt );
845 aUsrPref.SetOnlineSpell( aLinguOpt.bIsSpellAuto );
846
847 bool bOldShellWasSrcView = false;
848
849 // determine if there is an existing view for
850 // document
851 SfxViewShell* pExistingSh = nullptr;
852 if ( pOldSh )
853 {
854 pExistingSh = pOldSh;
855 // determine type of existing view
856 if (SwPagePreview* pPagePreview = dynamic_cast<SwPagePreview *>(pExistingSh))
857 {
858 m_sSwViewData = pPagePreview->GetPrevSwViewData();
859 m_sNewCursorPos = pPagePreview->GetNewCursorPos();
860 m_nNewPage = pPagePreview->GetNewPage();
862 m_bIsPreviewDoubleClick = !m_sNewCursorPos.isEmpty() || m_nNewPage != USHRT_MAX;
863 }
864 else if (dynamic_cast<const SwSrcView *>(pExistingSh) != nullptr)
865 bOldShellWasSrcView = true;
866 }
867
868 SAL_INFO( "sw.ui", "before create WrtShell" );
869 if (SwView *pView = dynamic_cast<SwView*>(pExistingSh))
870 {
871 m_pWrtShell.reset(new SwWrtShell(*pView->m_pWrtShell, m_pEditWin, *this));
872 }
873 else if (SwWrtShell *pWrtShell = dynamic_cast<SwWrtShell*>(rDocSh.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()))
874 {
875 m_pWrtShell.reset(new SwWrtShell(*pWrtShell, m_pEditWin, *this));
876 }
877 else
878 {
879 SwDoc& rDoc = *rDocSh.GetDoc();
880
881 if( !bOldShellWasSrcView && bWebDShell && !m_bOldShellWasPagePreview )
882 aUsrPref.setBrowseMode( true );
883 else
885
886 //For the BrowseMode we do not assume a factor.
887 if( aUsrPref.getBrowseMode() && aUsrPref.GetZoomType() != SvxZoomType::PERCENT )
888 {
889 aUsrPref.SetZoomType( SvxZoomType::PERCENT );
890 aUsrPref.SetZoom( 100 );
891 }
892 if (rDocSh.IsPreview())
893 {
894 aUsrPref.SetZoomType( SvxZoomType::WHOLEPAGE );
895 aUsrPref.SetViewLayoutBookMode( false );
896 aUsrPref.SetViewLayoutColumns( 1 );
897 }
898 m_pWrtShell.reset(new SwWrtShell(rDoc, m_pEditWin, *this, &aUsrPref));
899 // creating an SwView from a SwPagePreview needs to
900 // add the SwViewShell to the ring of the other SwViewShell(s)
902 {
903 SwViewShell& rPreviewViewShell = *static_cast<SwPagePreview*>(pExistingSh)->GetViewShell();
904 m_pWrtShell->MoveTo(&rPreviewViewShell);
905 // to update the field command et.al. if necessary
906 const SwViewOption* pPreviewOpt = rPreviewViewShell.GetViewOptions();
907 if( pPreviewOpt->IsFieldName() != aUsrPref.IsFieldName() ||
908 pPreviewOpt->IsShowHiddenField() != aUsrPref.IsShowHiddenField() ||
909 pPreviewOpt->IsShowHiddenPara() != aUsrPref.IsShowHiddenPara() ||
910 pPreviewOpt->IsShowHiddenChar() != aUsrPref.IsShowHiddenChar() )
911 rPreviewViewShell.ApplyViewOptions(aUsrPref);
912 // reset design mode at draw view for form
913 // shell, if needed.
914 if ( static_cast<SwPagePreview*>(pExistingSh)->ResetFormDesignMode() &&
915 m_pWrtShell->HasDrawView() )
916 {
917 SdrView* pDrawView = m_pWrtShell->GetDrawView();
918 pDrawView->SetDesignMode( static_cast<SwPagePreview*>(pExistingSh)->FormDesignModeToReset() );
919 }
920 }
921 }
922 SAL_INFO( "sw.ui", "after create WrtShell" );
924 SvxRulerSupportFlags::TABS |
925 SvxRulerSupportFlags::PARAGRAPH_MARGINS |
926 SvxRulerSupportFlags::BORDERS |
927 SvxRulerSupportFlags::NEGATIVE_MARGINS|
928 SvxRulerSupportFlags::REDUCED_METRIC,
931
932 // assure that modified state of document
933 // isn't reset, if document is already modified.
934 const bool bIsDocModified = m_pWrtShell->GetDoc()->getIDocumentState().IsModified();
935
936 // Thus among other things, the HRuler is not displayed in the read-only case.
937 aUsrPref.SetReadonly( m_pWrtShell->GetViewOptions()->IsReadonly() );
938
939 // no margin for OLE!
940 Size aBrwsBorder;
941 if( SfxObjectCreateMode::EMBEDDED != rDocSh.GetCreateMode() )
942 aBrwsBorder = GetMargin();
943
944 m_pWrtShell->SetBrowseBorder( aBrwsBorder );
945
946 // In CTOR no shell changes may take place, which must be temporarily stored
947 // with the timer. Otherwise, the SFX removes them from the stack!
948 bool bOld = g_bNoInterrupt;
949 g_bNoInterrupt = true;
950
951 m_pHRuler->SetActive();
952 m_pVRuler->SetActive();
953
954 SfxViewFrame& rViewFrame = GetViewFrame();
955
956 StartListening(rViewFrame, DuplicateHandling::Prevent);
957 StartListening(rDocSh, DuplicateHandling::Prevent);
958
959 // Set Zoom-factor from HRuler
960 Fraction aZoomFract( aUsrPref.GetZoom(), 100 );
961 m_pHRuler->SetZoom( aZoomFract );
962 m_pVRuler->SetZoom( aZoomFract );
963 m_pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick ));
964 FieldUnit eMetric = pUsrPref->GetHScrollMetric();
965 m_pHRuler->SetUnit( eMetric );
966
967 eMetric = pUsrPref->GetVScrollMetric();
968 m_pVRuler->SetUnit( eMetric );
969
970 m_pHRuler->SetCharWidth( 371 ); // default character width
971 m_pVRuler->SetLineHeight( 551 ); // default line height
972
973 // Set DocShell
974 m_xGlueDocShell.reset(new SwViewGlueDocShell(*this, rDocSh));
975 m_pPostItMgr.reset(new SwPostItMgr(this));
976
977 // Check and process the DocSize. Via the handler, the shell could not
978 // be found, because the shell is not known in the SFX management
979 // within the CTOR phase.
980 DocSzChgd( m_pWrtShell->GetDocSize() );
981
982 // Set AttrChangedNotify link
983 m_pWrtShell->SetChgLnk(LINK(this, SwView, AttrChangedNotify));
984
985 if (rDocSh.GetCreateMode() == SfxObjectCreateMode::EMBEDDED &&
987 SetVisArea(rDocSh.GetVisArea(ASPECT_CONTENT),false);
988
991 "sw.ui", "/org.openoffice.Office.Common/Undo/Steps <= 0");
992 if (!bFuzzing && 0 < officecfg::Office::Common::Undo::Steps::get())
993 {
994 m_pWrtShell->DoUndo();
995 }
996
997 const bool bBrowse = m_pWrtShell->GetViewOptions()->getBrowseMode();
998 // Disable "multiple window"
999 SetNewWindowAllowed(!bBrowse);
1000 // End of disabled multiple window
1001
1004 if (m_pHScrollbar)
1005 m_pHScrollbar->SetAuto(bBrowse);
1006 if( aUsrPref.IsViewHRuler() )
1007 CreateTab();
1008 if( aUsrPref.IsViewVRuler() )
1009 CreateVRuler();
1010
1011 m_pWrtShell->SetUIOptions( aUsrPref );
1012 m_pWrtShell->SetReadOnlyAvailable( aUsrPref.IsCursorInProtectedArea() );
1013#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1014 m_pWrtShell->ApplyAccessibilityOptions();
1015#endif
1016
1017 if( m_pWrtShell->GetDoc()->getIDocumentState().IsUpdateExpField() )
1018 {
1019 if (m_pWrtShell->GetDoc()->GetDocumentFieldsManager().containsUpdatableFields())
1020 {
1021 CurrShell aCurr(m_pWrtShell.get());
1022 m_pWrtShell->StartAction();
1023 m_pWrtShell->CalcLayout();
1024 m_pWrtShell->GetDoc()->getIDocumentFieldsAccess().UpdateFields(false);
1025 m_pWrtShell->EndAction();
1026 }
1027 m_pWrtShell->GetDoc()->getIDocumentState().SetUpdateExpFieldStat( false );
1028 }
1029
1030 // Update all tables if necessary:
1031 if( m_pWrtShell->GetDoc()->IsUpdateTOX() )
1032 {
1033 SfxRequest aSfxRequest( FN_UPDATE_TOX, SfxCallMode::SLOT, GetPool() );
1034 Execute( aSfxRequest );
1035 m_pWrtShell->GetDoc()->SetUpdateTOX( false ); // reset again
1036 m_pWrtShell->SttEndDoc(true);
1037 }
1038
1039 // No ResetModified, if there is already a view to this doc.
1040 SfxViewFrame& rVFrame = GetViewFrame();
1041 SfxViewFrame* pFirst = SfxViewFrame::GetFirst(&rDocSh);
1042 // Currently(360) the view is registered firstly after the CTOR,
1043 // the following expression is also working if this changes.
1044 // If the modification cannot be canceled by undo, then do NOT set
1045 // the modify back.
1046 // no reset of modified state, if document
1047 // was already modified.
1048 if (!m_pWrtShell->GetDoc()->GetIDocumentUndoRedo().IsUndoNoResetModified() &&
1049 ( !pFirst || pFirst == &rVFrame ) &&
1050 !bIsDocModified )
1051 {
1052 m_pWrtShell->ResetModified();
1053 }
1054
1055 g_bNoInterrupt = bOld;
1056
1057 // If a new GlobalDoc will be created, the navigator will also be generated.
1058 if( dynamic_cast<const SwGlobalDocShell*>(&rDocSh) != nullptr &&
1059 !rVFrame.GetChildWindow( SID_NAVIGATOR ))
1060 {
1061 SfxBoolItem aNavi(SID_NAVIGATOR, true);
1062 GetDispatcher().ExecuteList(SID_NAVIGATOR, SfxCallMode::ASYNCHRON, { &aNavi });
1063 }
1064
1065 uno::Reference< frame::XFrame > xFrame = rVFrame.GetFrame().GetFrameInterface();
1066
1067 uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame(
1068 "_beamer", frame::FrameSearchFlag::CHILDREN);
1069 if(xBeamerFrame.is())
1070 {
1071 SwDBData aData = m_pWrtShell->GetDBData();
1072 SwModule::ShowDBObj( *this, aData );
1073 }
1074
1075 // has anybody calls the attrchanged handler in the constructor?
1077 {
1078 GetViewFrame().GetBindings().LEAVEREGISTRATIONS();
1079 if( m_aTimer.IsActive() )
1080 m_aTimer.Stop();
1081 }
1082
1083 m_aTimer.SetInvokeHandler(LINK(this, SwView, TimeoutHdl));
1085 if (bOldModifyFlag)
1086 rDocSh.EnableSetModified();
1088
1089 if (!bFuzzing)
1090 {
1091 if (!m_pHScrollbar->IsScrollbarVisible(true))
1092 ShowHScrollbar( false );
1093 if (!m_pVScrollbar->IsScrollbarVisible(true))
1094 ShowVScrollbar( false );
1095 }
1096
1097 if (m_pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
1098 m_pWrtShell->InvalidateOutlineContentVisibility();
1099
1100 if (!bFuzzing)
1101 GetViewFrame().GetWindow().AddChildEventListener(LINK(this, SwView, WindowChildEventListener));
1102}
1103
1105 : m_rView(rView)
1106{
1107 // Set DocShell
1108 rDocSh.SetView(&m_rView);
1109 SW_MOD()->SetView(&m_rView);
1110}
1111
1113{
1114 SwDocShell* pDocSh = m_rView.GetDocShell();
1115 if (pDocSh && pDocSh->GetView() == &m_rView)
1116 pDocSh->SetView(nullptr);
1117 if (SW_MOD()->GetView() == &m_rView)
1118 SW_MOD()->SetView(nullptr);
1119}
1120
1122{
1123 // Notify other LOK views that we are going away.
1124 SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", "false");
1125 SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", "");
1126 SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "EMPTY");
1127
1128 // Need to remove activated field's button before disposing EditWin.
1130
1131 GetViewFrame().GetWindow().RemoveChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
1132 m_pPostItMgr.reset();
1133
1134 m_bInDtor = true;
1135 m_pEditWin->Hide(); // prevent problems with painting
1136
1137 // Set pointer in SwDocShell to the view again
1138 m_xGlueDocShell.reset();
1139
1141 GetViewFrame().GetBindings().LEAVEREGISTRATIONS();
1142
1143 // the last view must end the text edit
1144 SdrView *pSdrView = m_pWrtShell->GetDrawView();
1145 if( pSdrView && pSdrView->IsTextEdit() )
1146 pSdrView->SdrEndTextEdit( true );
1147 else if (pSdrView)
1148 {
1149 pSdrView->DisposeUndoManager();
1150 }
1151
1152 SetWindow( nullptr );
1153
1154 m_pViewImpl->Invalidate();
1155 EndListening(GetViewFrame());
1156 EndListening(*GetDocShell());
1157
1158 // tdf#155410 speedup shutdown, prevent unnecessary broadcasting during teardown of draw model
1160 const bool bWasLocked = pDrawModel->isLocked();
1161 pDrawModel->setLock(true);
1162 m_pWrtShell.reset(); // reset here so that it is not accessible by the following dtors.
1163 pDrawModel->setLock(bWasLocked);
1164
1169 m_pGlosHdl.reset();
1170 m_pViewImpl.reset();
1171
1172 // If this was enabled in the ctor for the frame, then disable it here.
1173 static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
1174 if (bRequestDoubleBuffering)
1175 m_pEditWin->RequestDoubleBuffering(false);
1177
1178 m_pFormatClipboard.reset();
1179}
1180
1182{
1184 return;
1185 auto* pDocShell = GetDocShell();
1186 if (pDocShell)
1187 {
1188 svx::ThemeColorPaletteManager aManager(pDocShell->GetThemeColors());
1189 libreOfficeKitViewCallback(LOK_CALLBACK_COLOR_PALETTES, aManager.generateJSON());
1190 }
1191}
1192
1194{
1196 return dynamic_cast<SwDocShell*>( pDocShell );
1197}
1198
1199// Remember CursorPos
1200
1201void SwView::WriteUserData( OUString &rUserData, bool bBrowse )
1202{
1203 // The browse flag will be passed from Sfx when documents are browsed
1204 // (not to be confused with the BrowseMode).
1205 // Then that stored data are not persistent!
1206
1207 const SwRect& rRect = m_pWrtShell->GetCharRect();
1208 const tools::Rectangle& rVis = GetVisArea();
1209
1210 rUserData = OUString::number( rRect.Left() );
1211 rUserData += ";";
1212 rUserData += OUString::number( rRect.Top() );
1213 rUserData += ";";
1214 rUserData += OUString::number( m_pWrtShell->GetViewOptions()->GetZoom() );
1215 rUserData += ";";
1216 rUserData += OUString::number( rVis.Left() );
1217 rUserData += ";";
1218 rUserData += OUString::number( rVis.Top() );
1219 rUserData += ";";
1220 rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Right());
1221 rUserData += ";";
1222 rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Bottom());
1223 rUserData += ";";
1224 rUserData += OUString::number(
1225 static_cast<sal_uInt16>(m_pWrtShell->GetViewOptions()->GetZoomType()));//eZoom;
1226 rUserData += ";";
1227 rUserData += FrameTypeFlags::NONE == m_pWrtShell->GetSelFrameType() ? std::u16string_view(u"0") : std::u16string_view(u"1");
1228}
1229
1230// Set CursorPos
1231
1232static bool lcl_IsOwnDocument( SwView& rView )
1233{
1235 {
1236 return true;
1237 }
1238 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
1239 rView.GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
1240 uno::Reference<document::XDocumentProperties> xDocProps
1241 = xDPS->getDocumentProperties();
1242 OUString Created = xDocProps->getAuthor();
1243 OUString Changed = xDocProps->getModifiedBy();
1244 OUString FullName = SW_MOD()->GetUserOptions().GetFullName();
1245 return !FullName.isEmpty()
1246 && (Changed == FullName || (Changed.isEmpty() && Created == FullName));
1247}
1248
1249void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
1250{
1251 if ( !(rUserData.indexOf(';')>=0 && // more than one token
1252 // For document without layout only in the onlinelayout or
1253 // while forward/backward
1254 (!m_pWrtShell->IsNewLayout() || m_pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse)) )
1255 return;
1256
1257 bool bIsOwnDocument = lcl_IsOwnDocument( *this );
1258
1259 CurrShell aCurr(m_pWrtShell.get());
1260
1261 sal_Int32 nPos = 0;
1262
1263 // No it is *not* a good idea to call GetToken within Point constr. immediately,
1264 // because which parameter is evaluated first?
1265 tools::Long nX = o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos )),
1266 nY = o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos ));
1267 Point aCursorPos( nX, nY );
1268
1269 sal_uInt16 nZoomFactor =
1270 static_cast< sal_uInt16 >( o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos )) );
1271
1272 tools::Long nLeft = o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos )),
1273 nTop = o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos )),
1274 nRight = o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos )),
1275 nBottom= o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos ));
1276
1277 const tools::Long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
1278 if ( nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) )
1279 return;
1280
1281 m_pWrtShell->EnableSmooth( false );
1282
1283 const tools::Rectangle aVis( nLeft, nTop, nRight, nBottom );
1284
1285 sal_Int32 nOff = 0;
1286 SvxZoomType eZoom;
1287 if( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
1288 eZoom = static_cast<SvxZoomType>(o3tl::narrowing<sal_uInt16>(o3tl::toInt32(o3tl::getToken(rUserData, nOff, ';', nPos ))));
1289 else
1290 {
1291 eZoom = SvxZoomType::PERCENT;
1292 ++nOff;
1293 }
1294
1295 bool bSelectObj = (0 != o3tl::toInt32(o3tl::getToken(rUserData, nOff, ';', nPos )))
1296 && m_pWrtShell->IsObjSelectable( aCursorPos );
1297
1298 // restore editing position
1299 m_pViewImpl->SetRestorePosition(aCursorPos, bSelectObj);
1300 // set flag value to avoid macro execution.
1301 bool bSavedFlagValue = m_pWrtShell->IsMacroExecAllowed();
1302 m_pWrtShell->SetMacroExecAllowed( false );
1303// os: changed: The user data has to be read if the view is switched back from page preview
1304// go to the last editing position when opening own files
1305 if(m_bOldShellWasPagePreview || bIsOwnDocument)
1306 {
1307 m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1308 if( bSelectObj )
1309 {
1310 m_pWrtShell->SelectObj( aCursorPos );
1311 m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1312 }
1313 }
1314
1315 // reset flag value
1316 m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
1317
1318 // set visible area before applying
1319 // information from print preview. Otherwise, the applied information
1320 // is lost.
1321// os: changed: The user data has to be read if the view is switched back from page preview
1322// go to the last editing position when opening own files
1323 if(m_bOldShellWasPagePreview || bIsOwnDocument )
1324 {
1325 if ( bBrowse )
1326 SetVisArea( aVis.TopLeft() );
1327 else
1328 SetVisArea( aVis );
1329 }
1330
1331 //apply information from print preview - if available
1332 if( !m_sNewCursorPos.isEmpty() )
1333 {
1334 sal_Int32 nIdx{ 0 };
1335 const tools::Long nXTmp = o3tl::toInt32(o3tl::getToken(m_sNewCursorPos, 0, ';', nIdx ));
1336 const tools::Long nYTmp = o3tl::toInt32(o3tl::getToken(m_sNewCursorPos, 0, ';', nIdx ));
1337 Point aCursorPos2( nXTmp, nYTmp );
1338 bSelectObj = m_pWrtShell->IsObjSelectable( aCursorPos2 );
1339
1340 m_pWrtShell->SwCursorShell::SetCursor( aCursorPos2 );
1341 if( bSelectObj )
1342 {
1343 m_pWrtShell->SelectObj( aCursorPos2 );
1344 m_pWrtShell->EnterSelFrameMode( &aCursorPos2 );
1345 }
1346 m_pWrtShell->MakeSelVisible();
1347 m_sNewCursorPos.clear();
1348 }
1349 else if(USHRT_MAX != m_nNewPage)
1350 {
1351 m_pWrtShell->GotoPage(m_nNewPage, true);
1352 m_nNewPage = USHRT_MAX;
1353 }
1354
1355 SelectShell();
1356
1357 m_pWrtShell->StartAction();
1358 const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
1359 if( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom )
1360 SetZoom( eZoom, nZoomFactor);
1361
1362 m_pWrtShell->LockView( true );
1363 m_pWrtShell->EndAction();
1364 m_pWrtShell->LockView( false );
1365 m_pWrtShell->EnableSmooth( true );
1366}
1367
1368void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >& rSequence )
1369{
1370 if(GetDocShell()->IsPreview()||m_bIsPreviewDoubleClick)
1371 return;
1372 bool bIsOwnDocument = lcl_IsOwnDocument( *this );
1373
1374 CurrShell aCurr(m_pWrtShell.get());
1375 const SwRect& rRect = m_pWrtShell->GetCharRect();
1376 const tools::Rectangle &rVis = GetVisArea();
1377 const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
1378
1379 sal_Int64 nX = rRect.Left(), nY = rRect.Top(), nLeft = rVis.Left(), nTop = rVis.Top();
1380 sal_Int16 nZoomType = static_cast< sal_Int16 >(pVOpt->GetZoomType());
1381 sal_Int16 nZoomFactor = static_cast < sal_Int16 > (pVOpt->GetZoom());
1382 bool bViewLayoutBookMode = pVOpt->IsViewLayoutBookMode();
1383 sal_Int16 nViewLayoutColumns = pVOpt->GetViewLayoutColumns();
1384
1385 bool bSelectedFrame = ( m_pWrtShell->GetSelFrameType() != FrameTypeFlags::NONE ),
1386 bGotVisibleLeft = false,
1387 bGotVisibleTop = false,
1388 bGotZoomType = false,
1389 bGotZoomFactor = false, bGotIsSelectedFrame = false,
1390 bGotViewLayoutColumns = false, bGotViewLayoutBookMode = false,
1391 bBrowseMode = false, bGotBrowseMode = false;
1392 bool bKeepRatio = pVOpt->IsKeepRatio();
1393 bool bGotKeepRatio = false;
1394
1395 for (const beans::PropertyValue& rValue : rSequence)
1396 {
1397 if ( rValue.Name == "ViewLeft" )
1398 {
1399 rValue.Value >>= nX;
1401 }
1402 else if ( rValue.Name == "ViewTop" )
1403 {
1404 rValue.Value >>= nY;
1406 }
1407 else if ( rValue.Name == "VisibleLeft" )
1408 {
1409 rValue.Value >>= nLeft;
1410 nLeft = o3tl::toTwips(nLeft, o3tl::Length::mm100);
1411 bGotVisibleLeft = true;
1412 }
1413 else if ( rValue.Name == "VisibleTop" )
1414 {
1415 rValue.Value >>= nTop;
1416 nTop = o3tl::toTwips(nTop, o3tl::Length::mm100);
1417 bGotVisibleTop = true;
1418 }
1419 else if ( rValue.Name == "ZoomType" )
1420 {
1421 rValue.Value >>= nZoomType;
1422 bGotZoomType = true;
1423 }
1424 else if ( rValue.Name == "ZoomFactor" )
1425 {
1426 rValue.Value >>= nZoomFactor;
1427 bGotZoomFactor = true;
1428 }
1429 else if ( rValue.Name == "ViewLayoutColumns" )
1430 {
1431 rValue.Value >>= nViewLayoutColumns;
1432 bGotViewLayoutColumns = true;
1433 }
1434 else if ( rValue.Name == "ViewLayoutBookMode" )
1435 {
1436 bViewLayoutBookMode = *o3tl::doAccess<bool>(rValue.Value);
1437 bGotViewLayoutBookMode = true;
1438 }
1439 else if ( rValue.Name == "IsSelectedFrame" )
1440 {
1441 rValue.Value >>= bSelectedFrame;
1442 bGotIsSelectedFrame = true;
1443 }
1444 else if (rValue.Name == "ShowOnlineLayout")
1445 {
1446 rValue.Value >>= bBrowseMode;
1447 bGotBrowseMode = true;
1448 }
1449 else if (rValue.Name == "KeepRatio")
1450 {
1451 rValue.Value >>= bKeepRatio;
1452 bGotKeepRatio = true;
1453 }
1454 // Fallback to common SdrModel processing
1455 else
1457 }
1458 if (bGotBrowseMode)
1459 {
1460 // delegate further
1461 GetViewImpl()->GetUNOObject_Impl()->getViewSettings()->setPropertyValue("ShowOnlineLayout", uno::Any(bBrowseMode));
1462 }
1463
1464 SelectShell();
1465
1466 Point aCursorPos( nX, nY );
1467
1468 m_pWrtShell->EnableSmooth( false );
1469
1470 SvxZoomType eZoom;
1471 if ( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
1472 eZoom = static_cast < SvxZoomType > ( nZoomType );
1473 else
1474 {
1475 eZoom = SvxZoomType::PERCENT;
1476 }
1477 if (bGotIsSelectedFrame)
1478 {
1479 bool bSelectObj = bSelectedFrame && m_pWrtShell->IsObjSelectable( aCursorPos );
1480
1481 // set flag value to avoid macro execution.
1482 bool bSavedFlagValue = m_pWrtShell->IsMacroExecAllowed();
1483 m_pWrtShell->SetMacroExecAllowed( false );
1484// os: changed: The user data has to be read if the view is switched back from page preview
1485// go to the last editing position when opening own files
1486 m_pViewImpl->SetRestorePosition(aCursorPos, bSelectObj);
1487 if(m_bOldShellWasPagePreview|| bIsOwnDocument)
1488 {
1489 m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1490
1491 // Update the shell to toggle Header/Footer edit if needed
1492 bool bInHeader = true;
1493 if ( m_pWrtShell->IsInHeaderFooter( &bInHeader ) )
1494 {
1495 if ( !bInHeader )
1496 {
1497 m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Footer, true );
1498 m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Header, false );
1499 }
1500 else
1501 {
1502 m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Header, true );
1503 m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Footer, false );
1504 }
1505
1506 // Force repaint
1507 m_pWrtShell->GetWin()->Invalidate();
1508 }
1509 if ( m_pWrtShell->IsInHeaderFooter() != m_pWrtShell->IsHeaderFooterEdit() )
1510 m_pWrtShell->ToggleHeaderFooterEdit();
1511
1512 if( bSelectObj )
1513 {
1514 m_pWrtShell->SelectObj( aCursorPos );
1515 m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1516 }
1517 }
1518
1519 // reset flag value
1520 m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
1521 }
1522
1523 if (bGotKeepRatio && bKeepRatio != pVOpt->IsKeepRatio())
1524 {
1525 // Got a custom value, then it makes sense to trigger notifications.
1526 SwViewOption aUsrPref(*pVOpt);
1527 aUsrPref.SetKeepRatio(bKeepRatio);
1528 SW_MOD()->ApplyUsrPref(aUsrPref, this);
1529 }
1530
1531 // Set ViewLayoutSettings
1532 const bool bSetViewLayoutSettings = bGotViewLayoutColumns && bGotViewLayoutBookMode &&
1533 ( pVOpt->GetViewLayoutColumns() != nViewLayoutColumns || pVOpt->IsViewLayoutBookMode() != bViewLayoutBookMode );
1534
1535 const bool bSetViewSettings = bGotZoomType && bGotZoomFactor &&
1536 ( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom );
1537
1538 // In case we have a 'fixed' view layout of 2 or more columns,
1539 // we have to apply the view options *before* starting the action.
1540 // Otherwise the SetZoom function cannot work correctly, because
1541 // the view layout hasn't been calculated.
1542 const bool bZoomNeedsViewLayout = bSetViewLayoutSettings &&
1543 1 < nViewLayoutColumns &&
1544 bSetViewSettings &&
1545 eZoom != SvxZoomType::PERCENT;
1546
1547 if ( !bZoomNeedsViewLayout )
1548 m_pWrtShell->StartAction();
1549
1550 if ( bSetViewLayoutSettings )
1551 SetViewLayout( nViewLayoutColumns, bViewLayoutBookMode, true );
1552
1553 if ( bZoomNeedsViewLayout )
1554 m_pWrtShell->StartAction();
1555
1556 if ( bSetViewSettings )
1557 SetZoom( eZoom, nZoomFactor, true );
1558
1559// os: changed: The user data has to be read if the view is switched back from page preview
1560// go to the last editing position when opening own files
1561 if(m_bOldShellWasPagePreview||bIsOwnDocument)
1562 {
1563 if ( bGotVisibleLeft && bGotVisibleTop )
1564 {
1565 Point aTopLeft(nLeft, nTop);
1566 // make sure the document is still centered
1567 const SwTwips lBorder = IsDocumentBorder() ? DOCUMENTBORDER : 2 * DOCUMENTBORDER;
1568 SwTwips nEditWidth = GetEditWin().GetOutDev()->GetOutputSize().Width();
1569 if(nEditWidth > (m_aDocSz.Width() + lBorder ))
1570 aTopLeft.setX( ( m_aDocSz.Width() + lBorder - nEditWidth ) / 2 );
1571 else
1572 {
1573 //check if the values are possible
1574 tools::Long nXMax = m_pHScrollbar->GetRangeMax() - m_pHScrollbar->GetVisibleSize();
1575 if( aTopLeft.X() > nXMax )
1576 aTopLeft.setX( nXMax < 0 ? 0 : nXMax );
1577 }
1578 SetVisArea( aTopLeft );
1579 }
1580 }
1581
1582 m_pWrtShell->LockView( true );
1583 m_pWrtShell->EndAction();
1584 m_pWrtShell->LockView( false );
1585 m_pWrtShell->EnableSmooth( true );
1586
1587}
1588
1589void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSequence )
1590{
1591 const SwRect& rRect = m_pWrtShell->GetCharRect();
1592 const tools::Rectangle& rVis = GetVisArea();
1593
1594 std::vector<beans::PropertyValue> aVector;
1595
1596 sal_uInt16 nViewID( GetViewFrame().GetCurViewId());
1597 aVector.push_back(comphelper::makePropertyValue("ViewId", "view" + OUString::number(nViewID)));
1598
1599 aVector.push_back(comphelper::makePropertyValue("ViewLeft", convertTwipToMm100 ( rRect.Left() )));
1600
1601 aVector.push_back(comphelper::makePropertyValue("ViewTop", convertTwipToMm100 ( rRect.Top() )));
1602
1603 auto visibleLeft = convertTwipToMm100 ( rVis.Left() );
1604 aVector.push_back(comphelper::makePropertyValue("VisibleLeft", visibleLeft));
1605
1606 auto visibleTop = convertTwipToMm100 ( rVis.Top() );
1607 aVector.push_back(comphelper::makePropertyValue("VisibleTop", visibleTop));
1608
1609 // We don't read VisibleRight and VisibleBottom anymore, but write them,
1610 // because older versions rely on their presence to restore position
1611
1612 auto visibleRight = rVis.IsWidthEmpty() ? visibleLeft : convertTwipToMm100 ( rVis.Right() );
1613 aVector.push_back(comphelper::makePropertyValue("VisibleRight", visibleRight));
1614
1615 auto visibleBottom = rVis.IsHeightEmpty() ? visibleTop : convertTwipToMm100 ( rVis.Bottom() );
1616 aVector.push_back(comphelper::makePropertyValue("VisibleBottom", visibleBottom));
1617
1618 const sal_Int16 nZoomType = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetZoomType());
1619 aVector.push_back(comphelper::makePropertyValue("ZoomType", nZoomType));
1620
1621 const sal_Int16 nViewLayoutColumns = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetViewLayoutColumns());
1622 aVector.push_back(comphelper::makePropertyValue("ViewLayoutColumns", nViewLayoutColumns));
1623
1624 aVector.push_back(comphelper::makePropertyValue("ViewLayoutBookMode", m_pWrtShell->GetViewOptions()->IsViewLayoutBookMode()));
1625
1626 aVector.push_back(comphelper::makePropertyValue("ZoomFactor", static_cast < sal_Int16 > (m_pWrtShell->GetViewOptions()->GetZoom())));
1627
1628 aVector.push_back(comphelper::makePropertyValue("IsSelectedFrame", FrameTypeFlags::NONE != m_pWrtShell->GetSelFrameType()));
1629
1630 aVector.push_back(
1631 comphelper::makePropertyValue("KeepRatio", m_pWrtShell->GetViewOptions()->IsKeepRatio()));
1632
1633 rSequence = comphelper::containerToSequence(aVector);
1634
1635 // Common SdrModel processing
1637}
1638
1639void SwView::ShowCursor( bool bOn )
1640{
1641 //don't scroll the cursor into the visible area
1642 bool bUnlockView = !m_pWrtShell->IsViewLocked();
1643 m_pWrtShell->LockView( true ); //lock visible section
1644
1645 if( !bOn )
1646 m_pWrtShell->HideCursor();
1647 else if( !m_pWrtShell->IsFrameSelected() && !m_pWrtShell->IsObjSelected() )
1648 m_pWrtShell->ShowCursor();
1649
1650 if( bUnlockView )
1651 m_pWrtShell->LockView( false );
1652}
1653
1654ErrCode SwView::DoVerb(sal_Int32 nVerb)
1655{
1656 if ( !GetViewFrame().GetFrame().IsInPlace() )
1657 {
1658 SwWrtShell &rSh = GetWrtShell();
1659 const SelectionType nSel = rSh.GetSelectionType();
1660 if ( nSel & SelectionType::Ole )
1661 rSh.LaunchOLEObj( nVerb );
1662 }
1663 return ERRCODE_NONE;
1664}
1665
1666// only return true for a text selection
1667
1668bool SwView::HasSelection( bool bText ) const
1669{
1670 return bText ? GetWrtShell().SwCursorShell::HasSelection()
1672}
1673
1674OUString SwView::GetSelectionText( bool bCompleteWrds, bool /*bOnlyASample*/ )
1675{
1676 return GetSelectionTextParam( bCompleteWrds, true );
1677}
1678
1679OUString SwView::GetSelectionTextParam( bool bCompleteWrds, bool bEraseTrail )
1680{
1681 OUString sReturn;
1682 if( bCompleteWrds && !GetWrtShell().HasSelection() )
1683 GetWrtShell().SelWrd();
1684
1685 GetWrtShell().GetSelectedText( sReturn );
1686 if( bEraseTrail )
1687 sReturn = comphelper::string::stripEnd(sReturn, ' ');
1688 return sReturn;
1689}
1690
1692{
1693 if(!m_pGlosHdl)
1694 m_pGlosHdl.reset(new SwGlossaryHdl(GetViewFrame(), m_pWrtShell.get()));
1695 return m_pGlosHdl.get();
1696}
1697
1698void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
1699{
1700 bool bCallBase = true;
1701 if(auto pChangedHint = dynamic_cast<const FmDesignModeChangedHint*>(&rHint))
1702 {
1703 bool bDesignMode = pChangedHint->GetDesignMode();
1704 if (!bDesignMode && GetDrawFuncPtr())
1705 {
1707 SetDrawFuncPtr(nullptr);
1709 AttrChangedNotify(nullptr);
1710 }
1711 }
1712 else
1713 {
1714 SfxHintId nId = rHint.GetId();
1715
1716 switch ( nId )
1717 {
1718 // sub shells will be destroyed by the
1719 // dispatcher, if the view frame is dying. Thus, reset member <pShell>.
1720 case SfxHintId::Dying:
1721 {
1722 if ( &rBC == &GetViewFrame() )
1723 {
1724 ResetSubShell();
1725 }
1726 }
1727 break;
1728 case SfxHintId::ModeChanged:
1729 {
1730 // Modal mode change-over?
1731 bool bModal = GetDocShell()->IsInModalMode();
1732 m_pHRuler->SetActive( !bModal );
1733 m_pVRuler->SetActive( !bModal );
1734 }
1735
1736 [[fallthrough]];
1737
1738 case SfxHintId::TitleChanged:
1739 if ( GetDocShell()->IsReadOnly() != GetWrtShell().GetViewOptions()->IsReadonly() )
1740 {
1741 SwWrtShell &rSh = GetWrtShell();
1743
1744 if ( rSh.GetViewOptions()->IsViewVRuler() )
1745 CreateVRuler();
1746 else
1747 KillVRuler();
1748 if ( rSh.GetViewOptions()->IsViewHRuler() )
1749 CreateTab();
1750 else
1751 KillTab();
1752 bool bReadonly = GetDocShell()->IsReadOnly();
1753 // if document is to be opened in alive-mode then this has to be
1754 // regarded while switching from readonly-mode to edit-mode
1755 if( !bReadonly )
1756 {
1758 if (pDrawDoc)
1759 {
1760 if( !pDrawDoc->GetOpenInDesignMode() )
1761 break;// don't touch the design mode
1762 }
1763 }
1764 SfxBoolItem aItem( SID_FM_DESIGN_MODE, !bReadonly);
1765 GetDispatcher().ExecuteList(SID_FM_DESIGN_MODE,
1766 SfxCallMode::ASYNCHRON, { &aItem });
1767 }
1768 break;
1769
1770 case SfxHintId::SwDrawViewsCreated:
1771 {
1772 bCallBase = false;
1773 if ( GetFormShell() )
1774 {
1775 GetFormShell()->SetView(dynamic_cast<FmFormView*>(GetWrtShell().GetDrawView()));
1776 SfxBoolItem aItem( SID_FM_DESIGN_MODE, !GetDocShell()->IsReadOnly());
1777 GetDispatcher().ExecuteList(SID_FM_DESIGN_MODE,
1778 SfxCallMode::SYNCHRON, { &aItem });
1779 }
1780 }
1781 break;
1782 case SfxHintId::RedlineChanged:
1783 {
1784 static sal_uInt16 const aSlotRedLine[] = {
1791 0
1792 };
1793 GetViewFrame().GetBindings().Invalidate(aSlotRedLine);
1794 }
1795 break;
1796 default: break;
1797 }
1798 }
1799
1800 if ( bCallBase )
1801 SfxViewShell::Notify(rBC, rHint);
1802}
1803
1804#if defined(_WIN32) || defined UNX
1805
1807{
1808 uno::Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager();
1809 if( xScanMgr.is() )
1810 {
1811 const ScannerContext aContext( xScanMgr->getAvailableScanners().getConstArray()[ 0 ] );
1812 const ScanError eError = xScanMgr->getError( aContext );
1813
1814 if( ScanError_ScanErrorNone == eError )
1815 {
1816 const uno::Reference< awt::XBitmap > xBitmap( xScanMgr->getBitmap( aContext ) );
1817
1818 if( xBitmap.is() )
1819 {
1820 const BitmapEx aScanBmp( VCLUnoHelper::GetBitmap( xBitmap ) );
1821
1822 if( !aScanBmp.IsEmpty() )
1823 {
1824 Graphic aGrf(aScanBmp);
1825 m_pWrtShell->InsertGraphic( OUString(), OUString(), aGrf );
1826 }
1827 }
1828 }
1829 }
1831 rBind.Invalidate( SID_TWAIN_SELECT );
1832 rBind.Invalidate( SID_TWAIN_TRANSFER );
1833}
1834#endif
1835
1837{
1838 if(m_aTimer.IsActive())
1839 {
1840 m_aTimer.Stop();
1842 {
1843 GetViewFrame().GetBindings().LEAVEREGISTRATIONS();
1845 }
1846 SelectShell();
1847 m_bAttrChgNotified = false;
1848 }
1849}
1850
1851bool SwView::PrepareClose( bool bUI )
1852{
1853 SfxViewFrame& rVFrame = GetViewFrame();
1854 rVFrame.SetChildWindow( SwInputChild::GetChildWindowId(), false );
1855 if( rVFrame.GetDispatcher()->IsLocked() )
1856 rVFrame.GetDispatcher()->Lock(false);
1857
1858 if ( m_pFormShell && !m_pFormShell->PrepareClose( bUI ) )
1859 {
1860 return false;
1861 }
1862 return SfxViewShell::PrepareClose( bUI );
1863}
1864
1865// status methods for clipboard.
1866// Status changes now notified from the clipboard.
1868{
1870 if( m_nLastPasteDestination != nPasteDestination )
1871 {
1872 TransferableDataHelper aDataHelper(
1874 &GetEditWin()) );
1875 if( aDataHelper.GetXTransferable().is() )
1876 {
1879 *m_pWrtShell, aDataHelper );
1880 }
1881 else
1883
1884 if( static_cast<SotExchangeDest>(0xFFFF) == m_nLastPasteDestination ) // the init value
1885 m_pViewImpl->AddClipboardListener();
1886 m_nLastPasteDestination = nPasteDestination;
1887 }
1888 return m_bPasteState;
1889}
1890
1892{
1894 return false;
1895
1897 if( m_nLastPasteDestination != nPasteDestination )
1898 {
1899 TransferableDataHelper aDataHelper(
1901 &GetEditWin()) );
1902 if( aDataHelper.GetXTransferable().is() )
1903 {
1906 *m_pWrtShell, aDataHelper );
1907 }
1908 else
1910
1911 if( static_cast<SotExchangeDest>(0xFFFF) == m_nLastPasteDestination ) // the init value
1912 m_pViewImpl->AddClipboardListener();
1913 }
1914 return m_bPasteSpecialState;
1915}
1916
1917bool SwView::IsPasteSpreadsheet(bool bHasOwnTableCopied)
1918{
1919 TransferableDataHelper aDataHelper(
1921 &GetEditWin()) );
1922 if( aDataHelper.GetXTransferable().is() )
1923 {
1924 if (bHasOwnTableCopied && SwTransferable::IsPasteOwnFormat( aDataHelper ))
1925 return true;
1926 return aDataHelper.HasFormat( SotClipboardFormatId::SYLK ) || aDataHelper.HasFormat( SotClipboardFormatId::SYLK_BIGCAPS );
1927 }
1928 return false;
1929}
1930
1932{
1934}
1935
1936// Printing
1937
1939{
1940 SwXTextView *const pTempImpl = GetViewImpl()->GetUNOObject_Impl();
1941 return pTempImpl->BuildTmpSelectionDoc();
1942}
1943
1945{
1946 GetViewImpl()->AddTransferable(rTransferable);
1947}
1948
1950{
1951 if (SwViewShell* pVwSh = GetWrtShellPtr())
1952 return pVwSh->getLOKVisibleArea();
1953 else
1954 return tools::Rectangle();
1955}
1956
1958{
1959 if (SwWrtShell* pSh = GetWrtShellPtr())
1960 pSh->FlushPendingLOKInvalidateTiles();
1961}
1962
1963std::optional<OString> SwView::getLOKPayload(int nType, int nViewId) const
1964{
1965 if (SwWrtShell* pSh = GetWrtShellPtr())
1966 return pSh->getLOKPayload(nType, nViewId);
1967 else
1968 return std::nullopt;
1969}
1970
1972{
1973 uno::Reference<lang::XMultiServiceFactory> xFactory(GetDocShell()->GetModel(), uno::UNO_QUERY);
1974 uno::Reference<beans::XPropertySet> xSettings(
1975 xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
1976 OUString sDataSourceName = "";
1977 xSettings->getPropertyValue("CurrentDatabaseDataSource") >>= sDataSourceName;
1978
1979 return sDataSourceName;
1980}
1981
1982bool SwView::IsDataSourceAvailable(const OUString sDataSourceName)
1983{
1984 uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
1985 Reference< XDatabaseContext> xDatabaseContext = DatabaseContext::create(xContext);
1986
1987 return xDatabaseContext->hasByName(sDataSourceName);
1988}
1989
1990namespace sw {
1991
1992void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
1993{
1994 o_rData = *SW_MOD()->GetPrtOptions(bWeb);
1995}
1996
1997} // namespace sw
1998
1999/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr auto convertTwipToMm100(N n)
bool IsEmpty() const
bool GetOpenInDesignMode() const
bool PrepareClose(bool bUI=true)
bool IsActiveControl() const
void ForgetActiveControl()
void SetView(FmFormView *pView)
void SetControlActivationHandler(const Link< LinkParamNone *, void > &_rHdl)
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual void SetCurrentViewShell(SwViewShell *pNew)=0
!!!The old layout must be deleted!!!
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual void ClearFieldActivation()=0
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
InputContextFlags GetOptions() const
void SetOptions(InputContextFlags nOptions)
Size GetOutputSize() const
void setX(tools::Long nX)
constexpr tools::Long X() const
void SetDesignMode(bool bOn=true)
bool isLocked() const
void ReadUserDataSequenceValue(const css::beans::PropertyValue *pValue)
void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &rValues)
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
void DisposeUndoManager()
virtual bool IsTextEdit() const final override
void Invalidate(sal_uInt16 nId)
void InvalidateAll(bool bWithMsg)
bool GetValue() const
void SetDisableFlags(SfxDisableFlags nFlags)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
ToolbarId GetObjectBarId(sal_uInt16 nPos) const
bool IsLocked() const
void SetSlotFilter(SfxSlotFilterState nEnable=SfxSlotFilterState::DISABLED, o3tl::span< sal_uInt16 const > pSIDs=o3tl::span< sal_uInt16 const >())
void Pop(SfxShell &rShell, SfxDispatcherPopFlags nMode=SfxDispatcherPopFlags::NONE)
SfxDisableFlags GetDisableFlags() const
void Lock(bool bLock)
void Push(SfxShell &rShell)
SfxShell * GetShell(sal_uInt16 nIdx) const
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SfxHintId GetId() const
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
bool IsInModalMode() const
bool IsEnableSetModified() const
bool IsReadOnly() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
void EnableSetModified(bool bEnable=true)
SfxObjectCreateMode GetCreateMode() const
bool IsPreview() const
SfxItemPool & GetPool() const
void SetVerbs(const css::uno::Sequence< css::embed::VerbDescriptor > &aVerbs)
SfxViewFrame * GetFrame() const
SfxViewShell * GetViewShell() const
void SetName(const OUString &rName)
vcl::Window & GetWindow() const
SfxBindings & GetBindings()
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
SfxDispatcher * GetDispatcher()
SfxChildWindow * GetChildWindow(sal_uInt16)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxFrame & GetFrame() const
virtual SfxObjectShell * GetObjectShell() override
virtual bool PrepareClose(bool bUI=true)
void InvalidateBorder()
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
SfxViewFrame & GetViewFrame() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
void SetNewWindowAllowed(bool bSet)
void SetWindow(vcl::Window *pViewPort)
vcl::Window * GetWindow() const
const Size & GetMargin() const
constexpr tools::Long Width() const
void GetOptions(SvtLinguOptions &rOptions) const
void SetView(SwView *pVw)
Set View for actions via Shell.
Definition: docsh.cxx:1162
void UpdateFontList()
Definition: docshini.cxx:415
const SwView * GetView() const
Definition: docsh.hxx:221
virtual tools::Rectangle GetVisArea(sal_uInt16 nAspect) const override
Definition: docsh.cxx:912
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:204
Definition: doc.hxx:197
void PrtOLENotify(bool bAll)
Definition: docdesc.cxx:812
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:190
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:169
virtual void Deactivate()
Definition: drawbase.cxx:444
SfxShell subclass that is used while interacting with the editeng-based text of a shape.
Definition: drwtxtsh.hxx:32
void GetSelectedText(OUString &rBuf, ParaBreakType nHndlParaBreak=ParaBreakType::ToBlank)
Query text within selection.
Definition: edglss.cxx:249
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:61
void UpdatePointer(const Point &, sal_uInt16 nButtons=0)
Definition: edtwin.cxx:344
This class acts as data container and execution class for the format paintbrush feature in writer.
Style of a layout element.
Definition: frmfmt.hxx:72
FieldUnit GetHScrollMetric() const
Definition: usrpref.hxx:217
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
Definition: swmodul1.cxx:367
View of a document.
Definition: pview.hxx:162
bool ResetFormDesignMode() const
Definition: pview.hxx:275
bool FormDesignModeToReset() const
Definition: pview.hxx:280
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
void SetTopToolbar(SelectionType nSelType, ToolbarId eBarId)
Definition: barcfg.cxx:82
static bool IsPasteOwnFormat(const TransferableDataHelper &)
Definition: swdtflvr.cxx:3392
static bool IsPasteSpecial(const SwWrtShell &rWrtShell, const TransferableDataHelper &)
Definition: swdtflvr.cxx:3383
static SotExchangeDest GetSotDestination(const SwWrtShell &rSh)
Definition: swdtflvr.cxx:2100
static bool IsPaste(const SwWrtShell &, const TransferableDataHelper &)
Definition: swdtflvr.cxx:1367
SwView & m_rView
Definition: view.hxx:138
SwViewGlueDocShell(SwView &rView, SwDocShell &rDocSh)
Definition: view.cxx:1104
bool IsViewHRuler(bool bDirect=false) const
Definition: viewopt.hxx:756
bool IsViewLayoutBookMode() const
Definition: viewopt.hxx:643
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:710
bool IsShowHiddenField() const
Definition: viewopt.hxx:494
bool IsShowHiddenPara() const
Definition: viewopt.hxx:568
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:669
void SetZoomType(SvxZoomType eZoom_)
Definition: viewopt.hxx:736
void SetZoom(sal_uInt16 n)
Definition: viewopt.hxx:670
sal_uInt16 GetViewLayoutColumns() const
Definition: viewopt.hxx:645
bool IsKeepRatio() const
Definition: viewopt.hxx:699
bool IsViewHScrollBar() const
Definition: viewopt.hxx:691
void SetKeepRatio(bool b)
Definition: viewopt.hxx:718
bool getBrowseMode() const
Definition: viewopt.hxx:636
bool IsShowHiddenChar(bool bHard=false) const
Definition: viewopt.hxx:487
void SetOnlineSpell(bool b)
Definition: viewopt.hxx:541
bool IsViewVRuler(bool bDirect=false) const
Definition: viewopt.hxx:770
bool IsCursorInProtectedArea() const
Definition: viewopt.hxx:580
void SetReadonly(bool bSet)
Definition: viewopt.hxx:628
bool IsViewVScrollBar() const
Definition: viewopt.hxx:683
bool IsFieldName() const
Definition: viewopt.hxx:417
void SetViewLayoutColumns(sal_uInt16 nNew)
Definition: viewopt.hxx:646
void SetViewLayoutBookMode(bool bNew)
Definition: viewopt.hxx:644
void setBrowseMode(bool bSet)
Definition: viewopt.hxx:637
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:452
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2205
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2821
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: viewsh.cxx:2823
SwDoc * GetDoc() const
Definition: viewsh.hxx:308
SdrView * GetDrawView()
Definition: vnew.cxx:386
void AddTransferable(SwTransferable &rTransferable)
Definition: uivwimp.cxx:218
SwXTextView * GetUNOObject_Impl()
Definition: uivwimp.cxx:92
Definition: view.hxx:146
virtual bool PrepareClose(bool bUI=true) override
Definition: view.cxx:1851
void ScannerEventHdl()
Definition: view.cxx:1806
SwView(SfxViewFrame &rFrame, SfxViewShell *)
Definition: view.cxx:747
void afterCallbackRegistered() override
See SfxViewShell::afterCallbackRegistered().
Definition: view.cxx:1181
virtual ErrCode DoVerb(sal_Int32 nVerb) override
Definition: view.cxx:1654
VclPtr< SwScrollbar > m_pHScrollbar
Definition: view.hxx:202
FmFormShell * m_pFormShell
Definition: view.hxx:198
SAL_DLLPRIVATE void CheckReadonlyState()
Definition: view.cxx:600
SotExchangeDest m_nLastPasteDestination
Definition: view.hxx:229
bool m_bInDtor
Definition: view.hxx:258
virtual void WriteUserData(OUString &, bool bBrowse=false) override
Definition: view.cxx:1201
bool m_bPasteState
Definition: view.hxx:255
virtual bool HasSelection(bool bText=true) const override
Definition: view.cxx:1668
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: view.cxx:1368
SfxDispatcher & GetDispatcher()
Definition: view.cxx:136
virtual void flushPendingLOKInvalidateTiles() override
Definition: view.cxx:1957
static SvxSearchItem * s_pSrchItem
Definition: view.hxx:165
SwWrtShell & GetWrtShell() const
Definition: view.hxx:423
SAL_DLLPRIVATE void CheckReadonlySelection()
Definition: view.cxx:692
SfxShell * m_pShell
Definition: view.hxx:197
void CreateVRuler()
Definition: viewmdi.cxx:689
std::unique_ptr< SwGlossaryHdl > m_pGlosHdl
Definition: view.hxx:211
std::unique_ptr< SwView_Impl > m_pViewImpl
Definition: view.hxx:200
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:194
virtual OUString GetSelectionText(bool bCompleteWords=false, bool bOnlyASample=false) override
Definition: view.cxx:1674
virtual SdrView * GetDrawView() const override
Definition: viewdraw.cxx:621
virtual std::optional< OString > getLOKPayload(int nType, int nViewId) const override
Definition: view.cxx:1963
std::unique_ptr< SwPostItMgr > m_pPostItMgr
Definition: view.hxx:219
VclPtr< SwScrollbar > m_pVScrollbar
Definition: view.hxx:203
virtual void SelectShell()
Definition: view.cxx:253
sal_uInt16 m_nNewPage
Definition: view.hxx:182
bool IsPasteAllowed()
Definition: view.cxx:1867
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:589
void GotFocus() const
Definition: view.cxx:167
void Execute(SfxRequest &)
Definition: view2.cxx:606
bool m_bVScrollbarEnabled
Definition: view.hxx:206
VclPtr< SvxRuler > m_pHRuler
Definition: view.hxx:208
bool IsDocumentBorder()
Definition: viewport.cxx:54
VclPtr< SvxRuler > m_pVRuler
Definition: view.hxx:209
friend class SwView_Impl
Definition: view.hxx:149
VclPtr< SwEditWin > m_pEditWin
Definition: view.hxx:193
void CreateTab()
Definition: viewmdi.cxx:647
void SetViewLayout(sal_uInt16 nColumns, bool bBookMode, bool bViewOnly=false)
Definition: viewmdi.cxx:225
void ShowHScrollbar(bool bShow)
Definition: viewmdi.cxx:749
std::unique_ptr< SwFormatClipboard > m_pFormatClipboard
Definition: view.hxx:217
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:436
static std::unique_ptr< SearchAttrItemList > s_xReplaceList
Definition: view.hxx:175
virtual tools::Rectangle getLOKVisibleArea() const override
Definition: view.cxx:1949
SfxObjectShellLock CreateTmpSelectionDoc()
Definition: view.cxx:1938
virtual ~SwView() override
Definition: view.cxx:1121
bool m_bAttrChgNotified
Definition: view.hxx:247
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: view.cxx:1589
bool m_bOldShellWasPagePreview
Definition: view.hxx:259
static std::unique_ptr< SearchAttrItemList > s_xSearchList
Definition: view.hxx:174
bool m_bPasteSpecialState
Definition: view.hxx:256
void StopShellTimer()
Definition: view.cxx:1836
OUString GetDataSourceName() const
Definition: view.cxx:1971
void ImpSetVerb(SelectionType nSelType)
Definition: view.cxx:141
virtual void ReadUserData(const OUString &, bool bBrowse=false) override
Definition: view.cxx:1249
SelectionType m_nSelectionType
Definition: view.hxx:221
void AddTransferable(SwTransferable &rTransferable)
Definition: view.cxx:1944
Size m_aDocSz
Definition: view.hxx:190
static bool s_bExtra
Definition: view.hxx:170
bool m_bInitOnceCompleted
Definition: view.hxx:263
bool IsPasteSpecialAllowed()
Definition: view.cxx:1891
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:424
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:537
SwGlossaryHdl * GetGlosHdl()
Definition: view.cxx:1691
virtual void ShowCursor(bool bOn=true) override
Definition: view.cxx:1639
void ResetSubShell()
Definition: view.hxx:593
SwEditWin & GetEditWin()
Definition: view.hxx:426
void SetDrawFuncPtr(std::unique_ptr< SwDrawBase > pFuncPtr)
Definition: viewdraw.cxx:641
virtual SAL_DLLPRIVATE void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: view.cxx:1698
static bool s_bFound
Definition: view.hxx:171
std::unique_ptr< SwViewGlueDocShell > m_xGlueDocShell
Definition: view.hxx:195
void KillTab()
Definition: viewmdi.cxx:655
SwDocShell * GetDocShell()
Definition: view.cxx:1193
SwView_Impl * GetViewImpl()
Definition: view.hxx:358
void DocSzChgd(const Size &rNewSize)
Definition: viewport.cxx:154
bool m_bAttrChgNotifiedWithRegistrations
Definition: view.hxx:248
OUString m_sSwViewData
Definition: view.hxx:178
SAL_DLLPRIVATE void CreateScrollbar(bool bHori)
Definition: viewmdi.cxx:301
void SetVisArea(const tools::Rectangle &, bool bUpdateScrollbar=true)
Definition: viewport.cxx:198
void KillVRuler()
Definition: viewmdi.cxx:698
bool m_bIsPreviewDoubleClick
Definition: view.hxx:260
void LeaveDrawCreate()
Definition: view.hxx:549
const SwFrameFormat * m_pLastTableFormat
Definition: view.hxx:214
void ShowUIElement(const OUString &sElementURL) const
Definition: view.cxx:241
Timer m_aTimer
Definition: view.hxx:177
static bool IsDataSourceAvailable(const OUString sDataSourceName)
Definition: view.cxx:1982
void ShowVScrollbar(bool bShow)
Definition: viewmdi.cxx:761
bool m_bHScrollbarEnabled
Definition: view.hxx:205
const SwFrameFormat * m_pLastFlyFormat
Definition: view.hxx:215
bool IsPasteSpreadsheet(bool bHasOwnTableCopied)
Definition: view.cxx:1917
OUString m_sNewCursorPos
Definition: view.hxx:180
bool m_bVerbsActive
Definition: view.hxx:249
void SetZoom(SvxZoomType eZoomType, short nFactor=100, bool bViewOnly=false)
Definition: viewmdi.cxx:73
OUString GetSelectionTextParam(bool bCompleteWords, bool bEraseTrail)
Definition: view.cxx:1679
void NotifyDBChanged()
Definition: view.cxx:1931
static bool s_bJustOpened
Definition: view.hxx:172
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1723
virtual void SetReadonlyOption(bool bSet) override
Definition: wrtsh1.cxx:2129
bool HasSelection() const
Definition: wrtsh.hxx:147
bool SelWrd(const Point *=nullptr)
Definition: select.cxx:74
void LaunchOLEObj(sal_Int32 nVerb=css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY)
Definition: wrtsh1.cxx:654
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override
Definition: unotxvw.cxx:472
void NotifyDBChanged()
Definition: unotxvw.cxx:652
SfxObjectShellLock BuildTmpSelectionDoc()
Definition: unotxvw.cxx:604
void NotifySelChanged()
Definition: unotxvw.cxx:640
bool IsActive() const
void Stop()
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
bool HasFormat(SotClipboardFormatId nFormat) const
css::uno::Reference< css::datatransfer::XTransferable > GetXTransferable() const
static BitmapEx GetBitmap(const css::uno::Reference< css::awt::XBitmap > &rxBitmap)
void disposeAndClear()
static VclPtr< reference_type > Create(Arg &&... arg)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr tools::Long Right() const
constexpr bool IsWidthEmpty() const
constexpr bool IsHeightEmpty() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
static bool IsFuzzing()
Point OutputToScreenPixel(const Point &rPos) const
void SetInputContext(const InputContext &rInputContext)
::OutputDevice const * GetOutDev() const
void AddChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Point PixelToLogic(const Point &rDevicePt) const
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
#define FN_UPDATE_TOX
Definition: cmdid.h:537
#define FN_REDLINE_ACCEPT_DIRECT
Definition: cmdid.h:143
#define FN_TABLE_PASTE_COL_BEFORE
Definition: cmdid.h:323
#define FN_FORMAT_DROPCAPS
Definition: cmdid.h:352
#define FN_INSERT_LINEBREAK
Definition: cmdid.h:222
#define FN_INSERT_BOOKMARK
Definition: cmdid.h:206
#define FN_INSERT_BREAK_DLG
Definition: cmdid.h:209
#define FN_INSERT_COMBO_BOX_CONTENT_CONTROL
Definition: cmdid.h:236
#define FN_INSERT_CONTENT_CONTROL
Definition: cmdid.h:224
#define FN_SET_SUPER_SCRIPT
Definition: cmdid.h:341
#define FN_BACKSPACE
Definition: cmdid.h:698
#define FN_INSERT_PLAIN_TEXT_CONTENT_CONTROL
Definition: cmdid.h:232
#define FN_DELETE_LINE
Definition: cmdid.h:703
#define FN_EDIT_REGION
Definition: cmdid.h:117
#define FN_REDLINE_ACCEPT_ALL
Definition: cmdid.h:149
#define FN_DELETE_BACK_LINE
Definition: cmdid.h:704
#define FN_JAVAEDIT
Definition: cmdid.h:294
#define FN_DELETE_SENT
Definition: cmdid.h:699
#define FN_SHIFT_BACKSPACE
Definition: cmdid.h:713
#define FN_GROW_FONT_SIZE
Definition: cmdid.h:338
#define FN_SELECT_PARA
Definition: cmdid.h:127
#define FN_POSTIT
Definition: cmdid.h:233
#define FN_SHRINK_FONT_SIZE
Definition: cmdid.h:339
#define FN_TXTATR_INET
Definition: cmdid.h:771
#define FN_INSERT_DROPDOWN_CONTENT_CONTROL
Definition: cmdid.h:228
#define FN_DELETE_BACK_PARA
Definition: cmdid.h:706
#define FN_DELETE_PARA
Definition: cmdid.h:705
#define FN_REDLINE_REJECT_DIRECT
Definition: cmdid.h:144
#define FN_DELETE_WORD
Definition: cmdid.h:701
#define FN_DELETE_BACK_WORD
Definition: cmdid.h:702
#define FN_INSERT_DATE_CONTENT_CONTROL
Definition: cmdid.h:231
#define FN_PASTE_NESTED_TABLE
Definition: cmdid.h:321
#define FN_REDLINE_NEXT_CHANGE
Definition: cmdid.h:147
#define FN_REDLINE_PREV_CHANGE
Definition: cmdid.h:148
#define FN_DELETE_WHOLE_LINE
Definition: cmdid.h:707
#define FN_SET_SUB_SCRIPT
Definition: cmdid.h:342
#define FN_INSERT_COLUMN_BREAK
Definition: cmdid.h:210
#define FN_INSERT_PICTURE_CONTENT_CONTROL
Definition: cmdid.h:230
#define FN_CALCULATE
Definition: cmdid.h:524
#define FN_INSERT_CHECKBOX_CONTENT_CONTROL
Definition: cmdid.h:225
#define FN_REDLINE_REJECT_ALL
Definition: cmdid.h:150
#define FN_TABLE_PASTE_ROW_BEFORE
Definition: cmdid.h:322
#define FN_DELETE_BACK_SENT
Definition: cmdid.h:700
virtual SfxBindings & GetBindings() override
float u
#define ERRCODE_NONE
SotExchangeDest
Reference< XSingleServiceFactory > xFactory
FlyProtectFlags
values can be combined via logical or
Definition: fesh.hxx:106
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
FieldUnit
SelectionType
SfxHintId
Shell * m_pShell
InputContextFlags
sal_uInt16 nPos
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
#define SAL_N_ELEMENTS(arr)
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
SfxDispatcher * GetDispatcher()
OString stripEnd(const OString &rIn, char c)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
int i
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
Definition: legacyitem.cxx:32
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
constexpr auto toTwips(N number, Length from)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Dialog to specify the properties of date form field.
void InitPrintOptionsFromApplication(SwPrintData &o_rData, bool const bWeb)
Definition: view.cxx:1992
long Long
#define SFX_OBJECTBAR_OBJECT
#define ASPECT_CONTENT
sal_Int16 nId
SfxItemState
QPRO_FUNC_TYPE nType
constexpr auto WB_STDRULER
constexpr WinBits WB_EXTRAFIELD
SvxRulerSupportFlags
SfxDisableFlags
SvxSearchCmd
Reference< XFrame > xFrame
SdrObjKind
bool g_bNoInterrupt
Definition: swmodule.cxx:115
#define SW_MOD()
Definition: swmodule.hxx:254
tools::Long SwTwips
Definition: swtypes.hxx:51
constexpr SwTwips DOCUMENTBORDER
Definition: swtypes.hxx:79
TABS
ToolbarId
#define SAL_MIN_INT32
#define SWVIEWFLAGS
Definition: view.cxx:121
static bool lcl_IsOwnDocument(SwView &rView)
Definition: view.cxx:1232
static int lcl_CmpIds(const void *pFirst, const void *pSecond)
Definition: view.cxx:518
bool bDocSzUpdated
Definition: view.cxx:125
IMPL_LINK_NOARG(SwView, FormControlActivated, LinkParamNone *, void)
Definition: view.cxx:201
ShellMode
Definition: view.hxx:87
@ ExtrudedCustomShape
WinBits const WB_BORDER
WinBits const WB_VSCROLL
SvxZoomType