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