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_COLOR_BACKGROUND_EXT, SID_ATTR_CHAR_COLOR_EXT,
635 SID_ATTR_CHAR_COLOR, SID_ATTR_CHAR_WEIGHT, SID_ATTR_CHAR_POSTURE,
636 SID_ATTR_CHAR_OVERLINE,
637 SID_ATTR_CHAR_UNDERLINE, SID_ATTR_FLASH, SID_ATTR_CHAR_STRIKEOUT,
638 SID_ULINE_VAL_SINGLE, SID_ULINE_VAL_DOUBLE, SID_ULINE_VAL_DOTTED,
639 SID_ATTR_CHAR_CONTOUR, SID_ATTR_CHAR_SHADOWED,
640 SID_ATTR_CHAR_AUTOKERN, SID_ATTR_CHAR_ESCAPEMENT, FN_SET_SUPER_SCRIPT,
641 FN_SET_SUB_SCRIPT, SID_ATTR_CHAR_CASEMAP, SID_ATTR_CHAR_LANGUAGE,
642 SID_ATTR_CHAR_KERNING, SID_CHAR_DLG, SID_ATTR_CHAR_WORDLINEMODE,
644 FN_FORMAT_DROPCAPS, SID_ATTR_PARA_ADJUST, SID_ATTR_PARA_LINESPACE,
645 SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_KEEP, SID_ATTR_PARA_WIDOWS,
646 SID_ATTR_PARA_ORPHANS,
647 SID_ATTR_PARA_MODEL, SID_PARA_DLG,
648 FN_SELECT_PARA, SID_DEC_INDENT,
649 SID_INC_INDENT
650 };
651 static bool bFirst = true;
652 if ( bFirst )
653 {
654 qsort( static_cast<void*>(aROIds), SAL_N_ELEMENTS(aROIds), sizeof(sal_uInt16), lcl_CmpIds );
655 bFirst = false;
656 }
657 if ( SfxItemState::DISABLED == eStateRO )
658 {
659 rDis.SetSlotFilter( SfxSlotFilterState::ENABLED_READONLY, aROIds );
660 bChgd = true;
661 }
662 }
663 else if( m_pWrtShell->IsAllProtect() )
664 {
665 if ( SfxItemState::DISABLED == eStateProtAll )
666 {
667 static sal_uInt16 aAllProtIds[] = { SID_SAVEDOC, FN_EDIT_REGION };
668 static bool bAllProtFirst = true;
669 if ( bAllProtFirst )
670 {
671 qsort( static_cast<void*>(aAllProtIds), SAL_N_ELEMENTS(aAllProtIds), sizeof(sal_uInt16), lcl_CmpIds );
672 bAllProtFirst = false;
673 }
674 rDis.SetSlotFilter( SfxSlotFilterState::ENABLED_READONLY, aAllProtIds );
675 bChgd = true;
676 }
677 }
678 else if ( SfxItemState::DISABLED != eStateRO ||
679 SfxItemState::DISABLED != eStateProtAll )
680 {
681 bChgd = true;
682 rDis.SetSlotFilter();
683 }
684 if ( bChgd )
686}
687
689{
690 SfxDisableFlags nDisableFlags = SfxDisableFlags::NONE;
692
693 if( m_pWrtShell->HasReadonlySel() &&
694 ( !m_pWrtShell->GetDrawView() ||
695 !m_pWrtShell->GetDrawView()->GetMarkedObjectList().GetMarkCount() ))
696 nDisableFlags |= SfxDisableFlags::SwOnProtectedCursor;
697
698 if( (SfxDisableFlags::SwOnProtectedCursor & nDisableFlags ) !=
699 (SfxDisableFlags::SwOnProtectedCursor & rDis.GetDisableFlags() ) )
700 {
701 // Additionally move at the Window the InputContext, so that
702 // in japanese / chinese versions the external input will be
703 // turned on or off. This but only if the correct shell is on
704 // the stack.
705 switch( m_pViewImpl->GetShellMode() )
706 {
707 case ShellMode::Text:
711 {
712// Temporary solution!!! Should set the font of the current insertion point
713// at each cursor movement, so outside of this "if". But TH does not
714// evaluates the font at this time and the "purchase" appears to me
715// as too expensive.
716// Moreover, we don't have a font, but only attributes from which the
717// text formatting and the correct font will be build together.
718
719 InputContext aCntxt( GetEditWin().GetInputContext() );
720 aCntxt.SetOptions( SfxDisableFlags::SwOnProtectedCursor & nDisableFlags
721 ? (aCntxt.GetOptions() & ~
722 InputContextFlags( InputContextFlags::Text |
723 InputContextFlags::ExtText ))
724 : (aCntxt.GetOptions() |
725 ( InputContextFlags::Text |
726 InputContextFlags::ExtText )) );
727 GetEditWin().SetInputContext( aCntxt );
728 }
729 break;
730 default:
731 ;
732 }
733
734 }
735
736 if( nDisableFlags != rDis.GetDisableFlags() )
737 {
738 rDis.SetDisableFlags( nDisableFlags );
740 }
741}
742
744 : SfxViewShell( _pFrame, SWVIEWFLAGS ),
745 m_aTimer( "sw::SwView m_aTimer" ),
746 m_nNewPage(USHRT_MAX),
747 m_nOldPageNum(0),
748 m_pNumRuleNodeFromDoc(nullptr),
749 m_pEditWin( VclPtr<SwEditWin>::Create( &_pFrame->GetWindow(), *this ) ),
750 m_pShell(nullptr),
751 m_pFormShell(nullptr),
752 m_pHScrollbar(nullptr),
753 m_pVScrollbar(nullptr),
754 m_pVRuler(VclPtr<SvxRuler>::Create(&GetViewFrame()->GetWindow(), m_pEditWin,
757 GetViewFrame()->GetBindings(),
759 m_pLastTableFormat(nullptr),
760 m_pLastFlyFormat(nullptr),
761 m_pFormatClipboard(new SwFormatClipboard()),
762 m_nSelectionType( SelectionType::All ),
763 m_nPageCnt(0),
764 m_nDrawSfxId( USHRT_MAX ),
765 m_nFormSfxId( USHRT_MAX ),
766 m_eFormObjKind(SdrObjKind::NONE),
767 m_nLastPasteDestination( static_cast<SotExchangeDest>(0xFFFF) ),
768 m_nLeftBorderDistance( 0 ),
769 m_nRightBorderDistance( 0 ),
770 m_eLastSearchCommand( static_cast<SvxSearchCmd>(0xFFFF) ),
771 m_bWheelScrollInProgress(false),
772 m_bCenterCursor(false),
773 m_bTopCursor(false),
774 m_bTabColFromDoc(false),
775 m_bTabRowFromDoc(false),
776 m_bSetTabColFromDoc(false),
777 m_bSetTabRowFromDoc(false),
778 m_bAttrChgNotified(false),
779 m_bAttrChgNotifiedWithRegistrations(false),
780 m_bVerbsActive(false),
781 m_bDrawRotate(false),
782 m_bDrawSelMode(true),
783 m_bShowAtResize(true),
784 m_bInOuterResizePixel(false),
785 m_bInInnerResizePixel(false),
786 m_bPasteState(false),
787 m_bPasteSpecialState(false),
788 m_bInMailMerge(false),
789 m_bInDtor(false),
790 m_bOldShellWasPagePreview(false),
791 m_bIsPreviewDoubleClick(false),
792 m_bMakeSelectionVisible(false),
793 m_bForceChangesToolbar(true),
794 m_nLOKPageUpDownOffset(0)
795{
796 static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
797 if (bRequestDoubleBuffering)
798 m_pEditWin->RequestDoubleBuffering(true);
799
800 // According to discussion with MBA and further
801 // investigations, no old SfxViewShell will be set as parameter <pOldSh>,
802 // if function "New Window" is performed to open an additional view beside
803 // an already existing one.
804 // If the view is switch from one to another, the 'old' view is given by
805 // parameter <pOldSh>.
806
807 bDocSzUpdated = true;
808
809 CreateScrollbar( true );
810 CreateScrollbar( false );
811
812 m_pViewImpl.reset(new SwView_Impl(this));
813 SetName("View");
815
816 m_aTimer.SetTimeout( 120 );
817
818 SwDocShell& rDocSh = dynamic_cast<SwDocShell&>(*_pFrame->GetObjectShell());
819 bool bOldModifyFlag = rDocSh.IsEnableSetModified();
820 if (bOldModifyFlag)
821 rDocSh.EnableSetModified( false );
822 // HACK: SwDocShell has some cached font info, VCL informs about font updates,
823 // but loading of docs with embedded fonts happens after SwDocShell is created
824 // but before SwEditWin (which handles the VCL event) is created. So update
825 // manually.
827 rDocSh.UpdateFontList();
828 bool bWebDShell = dynamic_cast<const SwWebDocShell*>(&rDocSh) != nullptr;
829
830 const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(bWebDShell);
831 SwViewOption aUsrPref( *pUsrPref);
832
834 SvtLinguOptions aLinguOpt;
835 SvtLinguConfig().GetOptions( aLinguOpt );
836 aUsrPref.SetOnlineSpell( aLinguOpt.bIsSpellAuto );
837
838 bool bOldShellWasSrcView = false;
839
840 // determine if there is an existing view for
841 // document
842 SfxViewShell* pExistingSh = nullptr;
843 if ( pOldSh )
844 {
845 pExistingSh = pOldSh;
846 // determine type of existing view
847 if (SwPagePreview* pPagePreview = dynamic_cast<SwPagePreview *>(pExistingSh))
848 {
849 m_sSwViewData = pPagePreview->GetPrevSwViewData();
850 m_sNewCursorPos = pPagePreview->GetNewCursorPos();
851 m_nNewPage = pPagePreview->GetNewPage();
853 m_bIsPreviewDoubleClick = !m_sNewCursorPos.isEmpty() || m_nNewPage != USHRT_MAX;
854 }
855 else if (dynamic_cast<const SwSrcView *>(pExistingSh) != nullptr)
856 bOldShellWasSrcView = true;
857 }
858
859 SAL_INFO( "sw.ui", "before create WrtShell" );
860 if (SwView *pView = dynamic_cast<SwView*>(pExistingSh))
861 {
862 m_pWrtShell.reset(new SwWrtShell(*pView->m_pWrtShell, m_pEditWin, *this));
863 }
864 else if (SwWrtShell *pWrtShell = dynamic_cast<SwWrtShell*>(rDocSh.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()))
865 {
866 m_pWrtShell.reset(new SwWrtShell(*pWrtShell, m_pEditWin, *this));
867 }
868 else
869 {
870 SwDoc& rDoc = *rDocSh.GetDoc();
871
872 if( !bOldShellWasSrcView && bWebDShell && !m_bOldShellWasPagePreview )
873 aUsrPref.setBrowseMode( true );
874 else
876
877 //For the BrowseMode we do not assume a factor.
878 if( aUsrPref.getBrowseMode() && aUsrPref.GetZoomType() != SvxZoomType::PERCENT )
879 {
880 aUsrPref.SetZoomType( SvxZoomType::PERCENT );
881 aUsrPref.SetZoom( 100 );
882 }
883 if (rDocSh.IsPreview())
884 {
885 aUsrPref.SetZoomType( SvxZoomType::WHOLEPAGE );
886 aUsrPref.SetViewLayoutBookMode( false );
887 aUsrPref.SetViewLayoutColumns( 1 );
888 }
889 m_pWrtShell.reset(new SwWrtShell(rDoc, m_pEditWin, *this, &aUsrPref));
890 // creating an SwView from a SwPagePreview needs to
891 // add the SwViewShell to the ring of the other SwViewShell(s)
893 {
894 SwViewShell& rPreviewViewShell = *static_cast<SwPagePreview*>(pExistingSh)->GetViewShell();
895 m_pWrtShell->MoveTo(&rPreviewViewShell);
896 // to update the field command et.al. if necessary
897 const SwViewOption* pPreviewOpt = rPreviewViewShell.GetViewOptions();
898 if( pPreviewOpt->IsFieldName() != aUsrPref.IsFieldName() ||
899 pPreviewOpt->IsShowHiddenField() != aUsrPref.IsShowHiddenField() ||
900 pPreviewOpt->IsShowHiddenPara() != aUsrPref.IsShowHiddenPara() ||
901 pPreviewOpt->IsShowHiddenChar() != aUsrPref.IsShowHiddenChar() )
902 rPreviewViewShell.ApplyViewOptions(aUsrPref);
903 // reset design mode at draw view for form
904 // shell, if needed.
905 if ( static_cast<SwPagePreview*>(pExistingSh)->ResetFormDesignMode() &&
906 m_pWrtShell->HasDrawView() )
907 {
908 SdrView* pDrawView = m_pWrtShell->GetDrawView();
909 pDrawView->SetDesignMode( static_cast<SwPagePreview*>(pExistingSh)->FormDesignModeToReset() );
910 }
911 }
912 }
913 SAL_INFO( "sw.ui", "after create WrtShell" );
915 SvxRulerSupportFlags::TABS |
916 SvxRulerSupportFlags::PARAGRAPH_MARGINS |
917 SvxRulerSupportFlags::BORDERS |
918 SvxRulerSupportFlags::NEGATIVE_MARGINS|
919 SvxRulerSupportFlags::REDUCED_METRIC,
922
923 // assure that modified state of document
924 // isn't reset, if document is already modified.
925 const bool bIsDocModified = m_pWrtShell->GetDoc()->getIDocumentState().IsModified();
926
927 // Thus among other things, the HRuler is not displayed in the read-only case.
928 aUsrPref.SetReadonly( m_pWrtShell->GetViewOptions()->IsReadonly() );
929
930 // no margin for OLE!
931 Size aBrwsBorder;
932 if( SfxObjectCreateMode::EMBEDDED != rDocSh.GetCreateMode() )
933 aBrwsBorder = GetMargin();
934
935 m_pWrtShell->SetBrowseBorder( aBrwsBorder );
936
937 // In CTOR no shell changes may take place, which must be temporarily stored
938 // with the timer. Otherwise, the SFX removes them from the stack!
939 bool bOld = g_bNoInterrupt;
940 g_bNoInterrupt = true;
941
942 m_pHRuler->SetActive();
943 m_pVRuler->SetActive();
944
945 SfxViewFrame* pViewFrame = GetViewFrame();
946
947 StartListening(*pViewFrame, DuplicateHandling::Prevent);
948 StartListening(rDocSh, DuplicateHandling::Prevent);
949
950 // Set Zoom-factor from HRuler
951 Fraction aZoomFract( aUsrPref.GetZoom(), 100 );
952 m_pHRuler->SetZoom( aZoomFract );
953 m_pVRuler->SetZoom( aZoomFract );
954 m_pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick ));
955 FieldUnit eMetric = pUsrPref->GetHScrollMetric();
956 m_pHRuler->SetUnit( eMetric );
957
958 eMetric = pUsrPref->GetVScrollMetric();
959 m_pVRuler->SetUnit( eMetric );
960
961 m_pHRuler->SetCharWidth( 371 ); // default character width
962 m_pVRuler->SetLineHeight( 551 ); // default line height
963
964 // Set DocShell
965 m_xGlueDocShell.reset(new SwViewGlueDocShell(*this, rDocSh));
966 m_pPostItMgr.reset(new SwPostItMgr(this));
967
968 // Check and process the DocSize. Via the handler, the shell could not
969 // be found, because the shell is not known in the SFX management
970 // within the CTOR phase.
971 DocSzChgd( m_pWrtShell->GetDocSize() );
972
973 // Set AttrChangedNotify link
974 m_pWrtShell->SetChgLnk(LINK(this, SwView, AttrChangedNotify));
975
976 if (rDocSh.GetCreateMode() == SfxObjectCreateMode::EMBEDDED &&
978 SetVisArea(rDocSh.GetVisArea(ASPECT_CONTENT),false);
979
982 "sw.ui", "/org.openoffice.Office.Common/Undo/Steps <= 0");
984 {
985 m_pWrtShell->DoUndo();
986 }
987
988 const bool bBrowse = m_pWrtShell->GetViewOptions()->getBrowseMode();
989 // Disable "multiple window"
990 SetNewWindowAllowed(!bBrowse);
991 // End of disabled multiple window
992
995 m_pHScrollbar->SetAuto(bBrowse);
996 if( aUsrPref.IsViewHRuler() )
997 CreateTab();
998 if( aUsrPref.IsViewVRuler() )
999 CreateVRuler();
1000
1001 m_pWrtShell->SetUIOptions( aUsrPref );
1002 m_pWrtShell->SetReadOnlyAvailable( aUsrPref.IsCursorInProtectedArea() );
1003#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1004 m_pWrtShell->ApplyAccessibilityOptions(SW_MOD()->GetAccessibilityOptions());
1005#endif
1006
1007 if( m_pWrtShell->GetDoc()->getIDocumentState().IsUpdateExpField() )
1008 {
1009 if (m_pWrtShell->GetDoc()->GetDocumentFieldsManager().containsUpdatableFields())
1010 {
1011 CurrShell aCurr(m_pWrtShell.get());
1012 m_pWrtShell->StartAction();
1013 m_pWrtShell->CalcLayout();
1014 m_pWrtShell->GetDoc()->getIDocumentFieldsAccess().UpdateFields(false);
1015 m_pWrtShell->EndAction();
1016 }
1017 m_pWrtShell->GetDoc()->getIDocumentState().SetUpdateExpFieldStat( false );
1018 }
1019
1020 // Update all tables if necessary:
1021 if( m_pWrtShell->GetDoc()->IsUpdateTOX() )
1022 {
1023 SfxRequest aSfxRequest( FN_UPDATE_TOX, SfxCallMode::SLOT, GetPool() );
1024 Execute( aSfxRequest );
1025 m_pWrtShell->GetDoc()->SetUpdateTOX( false ); // reset again
1026 m_pWrtShell->SttEndDoc(true);
1027 }
1028
1029 // No ResetModified, if there is already a view to this doc.
1030 SfxViewFrame* pVFrame = GetViewFrame();
1031 SfxViewFrame* pFirst = SfxViewFrame::GetFirst(&rDocSh);
1032 // Currently(360) the view is registered firstly after the CTOR,
1033 // the following expression is also working if this changes.
1034 // If the modification cannot be canceled by undo, then do NOT set
1035 // the modify back.
1036 // no reset of modified state, if document
1037 // was already modified.
1038 if (!m_pWrtShell->GetDoc()->GetIDocumentUndoRedo().IsUndoNoResetModified() &&
1039 ( !pFirst || pFirst == pVFrame ) &&
1040 !bIsDocModified )
1041 {
1042 m_pWrtShell->ResetModified();
1043 }
1044
1045 g_bNoInterrupt = bOld;
1046
1047 // If a new GlobalDoc will be created, the navigator will also be generated.
1048 if( dynamic_cast<const SwGlobalDocShell*>(&rDocSh) != nullptr &&
1049 !pVFrame->GetChildWindow( SID_NAVIGATOR ))
1050 {
1051 SfxBoolItem aNavi(SID_NAVIGATOR, true);
1052 GetDispatcher().ExecuteList(SID_NAVIGATOR, SfxCallMode::ASYNCHRON, { &aNavi });
1053 }
1054
1055 uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface();
1056
1057 uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame(
1058 "_beamer", frame::FrameSearchFlag::CHILDREN);
1059 if(xBeamerFrame.is())
1060 {
1061 SwDBData aData = m_pWrtShell->GetDBData();
1062 SwModule::ShowDBObj( *this, aData );
1063 }
1064
1065 // has anybody calls the attrchanged handler in the constructor?
1067 {
1068 GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1069 if( m_aTimer.IsActive() )
1070 m_aTimer.Stop();
1071 }
1072
1073 m_aTimer.SetInvokeHandler(LINK(this, SwView, TimeoutHdl));
1075 if (bOldModifyFlag)
1076 rDocSh.EnableSetModified();
1078
1079 if( !m_pHScrollbar->IsScrollbarVisible(true) )
1080 ShowHScrollbar( false );
1081 if( !m_pVScrollbar->IsScrollbarVisible(true) )
1082 ShowVScrollbar( false );
1083
1084 if (m_pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
1085 m_pWrtShell->InvalidateOutlineContentVisibility();
1086
1087 GetViewFrame()->GetWindow().AddChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
1088}
1089
1091 : m_rView(rView)
1092{
1093 // Set DocShell
1094 rDocSh.SetView(&m_rView);
1095 SW_MOD()->SetView(&m_rView);
1096}
1097
1099{
1100 SwDocShell* pDocSh = m_rView.GetDocShell();
1101 if (pDocSh && pDocSh->GetView() == &m_rView)
1102 pDocSh->SetView(nullptr);
1103 if (SW_MOD()->GetView() == &m_rView)
1104 SW_MOD()->SetView(nullptr);
1105}
1106
1108{
1109 // Notify other LOK views that we are going away.
1110 SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", "false");
1111 SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", "");
1112 SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "EMPTY");
1113
1114 // Need to remove activated field's button before disposing EditWin.
1116
1117 GetViewFrame()->GetWindow().RemoveChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
1118 m_pPostItMgr.reset();
1119
1120 m_bInDtor = true;
1121 m_pEditWin->Hide(); // prevent problems with painting
1122
1123 // Set pointer in SwDocShell to the view again
1124 m_xGlueDocShell.reset();
1125
1127 GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1128
1129 // the last view must end the text edit
1130 SdrView *pSdrView = m_pWrtShell->GetDrawView();
1131 if( pSdrView && pSdrView->IsTextEdit() )
1132 pSdrView->SdrEndTextEdit( true );
1133 else if (pSdrView)
1134 {
1135 pSdrView->DisposeUndoManager();
1136 }
1137
1138 SetWindow( nullptr );
1139
1140 m_pViewImpl->Invalidate();
1141 EndListening(*GetViewFrame());
1142 EndListening(*GetDocShell());
1143 m_pWrtShell.reset(); // reset here so that it is not accessible by the following dtors.
1148 m_pGlosHdl.reset();
1149 m_pViewImpl.reset();
1150
1151 // If this was enabled in the ctor for the frame, then disable it here.
1152 static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE");
1153 if (bRequestDoubleBuffering)
1154 m_pEditWin->RequestDoubleBuffering(false);
1156
1157 m_pFormatClipboard.reset();
1158}
1159
1161{
1162 SfxObjectShell* pDocShell = GetViewFrame()->GetObjectShell();
1163 return dynamic_cast<SwDocShell*>( pDocShell );
1164}
1165
1166// Remember CursorPos
1167
1168void SwView::WriteUserData( OUString &rUserData, bool bBrowse )
1169{
1170 // The browse flag will be passed from Sfx when documents are browsed
1171 // (not to be confused with the BrowseMode).
1172 // Then that stored data are not persistent!
1173
1174 const SwRect& rRect = m_pWrtShell->GetCharRect();
1175 const tools::Rectangle& rVis = GetVisArea();
1176
1177 rUserData = OUString::number( rRect.Left() );
1178 rUserData += ";";
1179 rUserData += OUString::number( rRect.Top() );
1180 rUserData += ";";
1181 rUserData += OUString::number( m_pWrtShell->GetViewOptions()->GetZoom() );
1182 rUserData += ";";
1183 rUserData += OUString::number( rVis.Left() );
1184 rUserData += ";";
1185 rUserData += OUString::number( rVis.Top() );
1186 rUserData += ";";
1187 rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Right());
1188 rUserData += ";";
1189 rUserData += OUString::number( bBrowse ? SAL_MIN_INT32 : rVis.Bottom());
1190 rUserData += ";";
1191 rUserData += OUString::number(
1192 static_cast<sal_uInt16>(m_pWrtShell->GetViewOptions()->GetZoomType()));//eZoom;
1193 rUserData += ";";
1194 rUserData += FrameTypeFlags::NONE == m_pWrtShell->GetSelFrameType() ? std::u16string_view(u"0") : std::u16string_view(u"1");
1195}
1196
1197// Set CursorPos
1198
1199static bool lcl_IsOwnDocument( SwView& rView )
1200{
1201 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
1202 rView.GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
1203 uno::Reference<document::XDocumentProperties> xDocProps
1204 = xDPS->getDocumentProperties();
1205 OUString Created = xDocProps->getAuthor();
1206 OUString Changed = xDocProps->getModifiedBy();
1207 OUString FullName = SW_MOD()->GetUserOptions().GetFullName();
1208 return !FullName.isEmpty()
1209 && (Changed == FullName || (Changed.isEmpty() && Created == FullName));
1210}
1211
1212void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
1213{
1214 if ( !(rUserData.indexOf(';')>=0 && // more than one token
1215 // For document without layout only in the onlinelayout or
1216 // while forward/backward
1217 (!m_pWrtShell->IsNewLayout() || m_pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse)) )
1218 return;
1219
1220 bool bIsOwnDocument = lcl_IsOwnDocument( *this );
1221
1222 CurrShell aCurr(m_pWrtShell.get());
1223
1224 sal_Int32 nPos = 0;
1225
1226 // No it is *not* a good idea to call GetToken within Point constr. immediately,
1227 // because which parameter is evaluated first?
1228 tools::Long nX = o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos )),
1229 nY = o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos ));
1230 Point aCursorPos( nX, nY );
1231
1232 sal_uInt16 nZoomFactor =
1233 static_cast< sal_uInt16 >( o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos )) );
1234
1235 tools::Long nLeft = o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos )),
1236 nTop = o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos )),
1237 nRight = o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos )),
1238 nBottom= o3tl::toInt32(o3tl::getToken(rUserData, 0, ';', nPos ));
1239
1240 const tools::Long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
1241 if ( nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) )
1242 return;
1243
1244 m_pWrtShell->EnableSmooth( false );
1245
1246 const tools::Rectangle aVis( nLeft, nTop, nRight, nBottom );
1247
1248 sal_Int32 nOff = 0;
1249 SvxZoomType eZoom;
1250 if( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
1251 eZoom = static_cast<SvxZoomType>(o3tl::narrowing<sal_uInt16>(o3tl::toInt32(o3tl::getToken(rUserData, nOff, ';', nPos ))));
1252 else
1253 {
1254 eZoom = SvxZoomType::PERCENT;
1255 ++nOff;
1256 }
1257
1258 bool bSelectObj = (0 != o3tl::toInt32(o3tl::getToken(rUserData, nOff, ';', nPos )))
1259 && m_pWrtShell->IsObjSelectable( aCursorPos );
1260
1261 // restore editing position
1262 m_pViewImpl->SetRestorePosition(aCursorPos, bSelectObj);
1263 // set flag value to avoid macro execution.
1264 bool bSavedFlagValue = m_pWrtShell->IsMacroExecAllowed();
1265 m_pWrtShell->SetMacroExecAllowed( false );
1266// os: changed: The user data has to be read if the view is switched back from page preview
1267// go to the last editing position when opening own files
1268 if(m_bOldShellWasPagePreview || bIsOwnDocument)
1269 {
1270 m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1271 if( bSelectObj )
1272 {
1273 m_pWrtShell->SelectObj( aCursorPos );
1274 m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1275 }
1276 }
1277
1278 // reset flag value
1279 m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
1280
1281 // set visible area before applying
1282 // information from print preview. Otherwise, the applied information
1283 // is lost.
1284// os: changed: The user data has to be read if the view is switched back from page preview
1285// go to the last editing position when opening own files
1286 if(m_bOldShellWasPagePreview || bIsOwnDocument )
1287 {
1288 if ( bBrowse )
1289 SetVisArea( aVis.TopLeft() );
1290 else
1291 SetVisArea( aVis );
1292 }
1293
1294 //apply information from print preview - if available
1295 if( !m_sNewCursorPos.isEmpty() )
1296 {
1297 sal_Int32 nIdx{ 0 };
1298 const tools::Long nXTmp = o3tl::toInt32(o3tl::getToken(m_sNewCursorPos, 0, ';', nIdx ));
1299 const tools::Long nYTmp = o3tl::toInt32(o3tl::getToken(m_sNewCursorPos, 0, ';', nIdx ));
1300 Point aCursorPos2( nXTmp, nYTmp );
1301 bSelectObj = m_pWrtShell->IsObjSelectable( aCursorPos2 );
1302
1303 m_pWrtShell->SwCursorShell::SetCursor( aCursorPos2 );
1304 if( bSelectObj )
1305 {
1306 m_pWrtShell->SelectObj( aCursorPos2 );
1307 m_pWrtShell->EnterSelFrameMode( &aCursorPos2 );
1308 }
1309 m_pWrtShell->MakeSelVisible();
1310 m_sNewCursorPos.clear();
1311 }
1312 else if(USHRT_MAX != m_nNewPage)
1313 {
1314 m_pWrtShell->GotoPage(m_nNewPage, true);
1315 m_nNewPage = USHRT_MAX;
1316 }
1317
1318 SelectShell();
1319
1320 m_pWrtShell->StartAction();
1321 const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
1322 if( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom )
1323 SetZoom( eZoom, nZoomFactor);
1324
1325 m_pWrtShell->LockView( true );
1326 m_pWrtShell->EndAction();
1327 m_pWrtShell->LockView( false );
1328 m_pWrtShell->EnableSmooth( true );
1329}
1330
1331void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >& rSequence )
1332{
1333 if(GetDocShell()->IsPreview()||m_bIsPreviewDoubleClick)
1334 return;
1335 bool bIsOwnDocument = lcl_IsOwnDocument( *this );
1336
1337 CurrShell aCurr(m_pWrtShell.get());
1338 const SwRect& rRect = m_pWrtShell->GetCharRect();
1339 const tools::Rectangle &rVis = GetVisArea();
1340 const SwViewOption* pVOpt = m_pWrtShell->GetViewOptions();
1341
1342 sal_Int64 nX = rRect.Left(), nY = rRect.Top(), nLeft = rVis.Left(), nTop = rVis.Top();
1343 sal_Int16 nZoomType = static_cast< sal_Int16 >(pVOpt->GetZoomType());
1344 sal_Int16 nZoomFactor = static_cast < sal_Int16 > (pVOpt->GetZoom());
1345 bool bViewLayoutBookMode = pVOpt->IsViewLayoutBookMode();
1346 sal_Int16 nViewLayoutColumns = pVOpt->GetViewLayoutColumns();
1347 bool bHideWhitespace = pVOpt->IsHideWhitespaceMode();
1348
1349 bool bSelectedFrame = ( m_pWrtShell->GetSelFrameType() != FrameTypeFlags::NONE ),
1350 bGotVisibleLeft = false,
1351 bGotVisibleTop = false,
1352 bGotZoomType = false,
1353 bGotZoomFactor = false, bGotIsSelectedFrame = false,
1354 bGotViewLayoutColumns = false, bGotViewLayoutBookMode = false,
1355 bGotHideWhitespace = false,
1356 bBrowseMode = false, bGotBrowseMode = false;
1357 bool bKeepRatio = pVOpt->IsKeepRatio();
1358 bool bGotKeepRatio = false;
1359
1360 for (const beans::PropertyValue& rValue : rSequence)
1361 {
1362 if ( rValue.Name == "ViewLeft" )
1363 {
1364 rValue.Value >>= nX;
1366 }
1367 else if ( rValue.Name == "ViewTop" )
1368 {
1369 rValue.Value >>= nY;
1371 }
1372 else if ( rValue.Name == "VisibleLeft" )
1373 {
1374 rValue.Value >>= nLeft;
1375 nLeft = o3tl::toTwips(nLeft, o3tl::Length::mm100);
1376 bGotVisibleLeft = true;
1377 }
1378 else if ( rValue.Name == "VisibleTop" )
1379 {
1380 rValue.Value >>= nTop;
1381 nTop = o3tl::toTwips(nTop, o3tl::Length::mm100);
1382 bGotVisibleTop = true;
1383 }
1384 else if ( rValue.Name == "ZoomType" )
1385 {
1386 rValue.Value >>= nZoomType;
1387 bGotZoomType = true;
1388 }
1389 else if ( rValue.Name == "ZoomFactor" )
1390 {
1391 rValue.Value >>= nZoomFactor;
1392 bGotZoomFactor = true;
1393 }
1394 else if ( rValue.Name == "ViewLayoutColumns" )
1395 {
1396 rValue.Value >>= nViewLayoutColumns;
1397 bGotViewLayoutColumns = true;
1398 }
1399 else if ( rValue.Name == "ViewLayoutBookMode" )
1400 {
1401 bViewLayoutBookMode = *o3tl::doAccess<bool>(rValue.Value);
1402 bGotViewLayoutBookMode = true;
1403 }
1404 else if ( rValue.Name == "IsSelectedFrame" )
1405 {
1406 rValue.Value >>= bSelectedFrame;
1407 bGotIsSelectedFrame = true;
1408 }
1409 else if (rValue.Name == "ShowOnlineLayout")
1410 {
1411 rValue.Value >>= bBrowseMode;
1412 bGotBrowseMode = true;
1413 }
1414 else if (rValue.Name == "KeepRatio")
1415 {
1416 rValue.Value >>= bKeepRatio;
1417 bGotKeepRatio = true;
1418 }
1419 else if (rValue.Name == "HideWhitespace")
1420 {
1421 rValue.Value >>= bHideWhitespace;
1422 bGotHideWhitespace = true;
1423 }
1424 // Fallback to common SdrModel processing
1425 else
1427 }
1428 if (bGotBrowseMode)
1429 {
1430 // delegate further
1431 GetViewImpl()->GetUNOObject_Impl()->getViewSettings()->setPropertyValue("ShowOnlineLayout", uno::Any(bBrowseMode));
1432 }
1433
1434 SelectShell();
1435
1436 Point aCursorPos( nX, nY );
1437
1438 m_pWrtShell->EnableSmooth( false );
1439
1440 SvxZoomType eZoom;
1441 if ( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
1442 eZoom = static_cast < SvxZoomType > ( nZoomType );
1443 else
1444 {
1445 eZoom = SvxZoomType::PERCENT;
1446 }
1447 if (bGotIsSelectedFrame)
1448 {
1449 bool bSelectObj = bSelectedFrame && m_pWrtShell->IsObjSelectable( aCursorPos );
1450
1451 // set flag value to avoid macro execution.
1452 bool bSavedFlagValue = m_pWrtShell->IsMacroExecAllowed();
1453 m_pWrtShell->SetMacroExecAllowed( false );
1454// os: changed: The user data has to be read if the view is switched back from page preview
1455// go to the last editing position when opening own files
1456 m_pViewImpl->SetRestorePosition(aCursorPos, bSelectObj);
1457 if(m_bOldShellWasPagePreview|| bIsOwnDocument)
1458 {
1459 m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1460
1461 // Update the shell to toggle Header/Footer edit if needed
1462 bool bInHeader = true;
1463 if ( m_pWrtShell->IsInHeaderFooter( &bInHeader ) )
1464 {
1465 if ( !bInHeader )
1466 {
1467 m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Footer, true );
1468 m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Header, false );
1469 }
1470 else
1471 {
1472 m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Header, true );
1473 m_pWrtShell->SetShowHeaderFooterSeparator( FrameControlType::Footer, false );
1474 }
1475
1476 // Force repaint
1477 m_pWrtShell->GetWin()->Invalidate();
1478 }
1479 if ( m_pWrtShell->IsInHeaderFooter() != m_pWrtShell->IsHeaderFooterEdit() )
1480 m_pWrtShell->ToggleHeaderFooterEdit();
1481
1482 if( bSelectObj )
1483 {
1484 m_pWrtShell->SelectObj( aCursorPos );
1485 m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1486 }
1487 }
1488
1489 // reset flag value
1490 m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
1491 }
1492
1493 SwViewOption aUsrPref(*pVOpt);
1494 bool bUsrPrefModified = false;
1495 if (bGotKeepRatio && bKeepRatio != pVOpt->IsKeepRatio())
1496 {
1497 // Got a custom value, then it makes sense to trigger notifications.
1498 aUsrPref.SetKeepRatio(bKeepRatio);
1499 bUsrPrefModified = true;
1500 }
1501 if (bGotHideWhitespace && bHideWhitespace != pVOpt->IsHideWhitespaceMode())
1502 {
1503 aUsrPref.SetHideWhitespaceMode(bHideWhitespace);
1504 bUsrPrefModified = true;
1505 }
1506 if (bUsrPrefModified)
1507 {
1508 SW_MOD()->ApplyUsrPref(aUsrPref, this);
1509 }
1510
1511 // Set ViewLayoutSettings
1512 const bool bSetViewLayoutSettings = bGotViewLayoutColumns && bGotViewLayoutBookMode &&
1513 ( pVOpt->GetViewLayoutColumns() != nViewLayoutColumns || pVOpt->IsViewLayoutBookMode() != bViewLayoutBookMode );
1514
1515 const bool bSetViewSettings = bGotZoomType && bGotZoomFactor &&
1516 ( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom );
1517
1518 // In case we have a 'fixed' view layout of 2 or more columns,
1519 // we have to apply the view options *before* starting the action.
1520 // Otherwise the SetZoom function cannot work correctly, because
1521 // the view layout hasn't been calculated.
1522 const bool bZoomNeedsViewLayout = bSetViewLayoutSettings &&
1523 1 < nViewLayoutColumns &&
1524 bSetViewSettings &&
1525 eZoom != SvxZoomType::PERCENT;
1526
1527 if ( !bZoomNeedsViewLayout )
1528 m_pWrtShell->StartAction();
1529
1530 if ( bSetViewLayoutSettings )
1531 SetViewLayout( nViewLayoutColumns, bViewLayoutBookMode, true );
1532
1533 if ( bZoomNeedsViewLayout )
1534 m_pWrtShell->StartAction();
1535
1536 if ( bSetViewSettings )
1537 SetZoom( eZoom, nZoomFactor, true );
1538
1539// os: changed: The user data has to be read if the view is switched back from page preview
1540// go to the last editing position when opening own files
1541 if(m_bOldShellWasPagePreview||bIsOwnDocument)
1542 {
1543 if ( bGotVisibleLeft && bGotVisibleTop )
1544 {
1545 Point aTopLeft(nLeft, nTop);
1546 // make sure the document is still centered
1547 const SwTwips lBorder = IsDocumentBorder() ? DOCUMENTBORDER : 2 * DOCUMENTBORDER;
1548 SwTwips nEditWidth = GetEditWin().GetOutDev()->GetOutputSize().Width();
1549 if(nEditWidth > (m_aDocSz.Width() + lBorder ))
1550 aTopLeft.setX( ( m_aDocSz.Width() + lBorder - nEditWidth ) / 2 );
1551 else
1552 {
1553 //check if the values are possible
1554 tools::Long nXMax = m_pHScrollbar->GetRangeMax() - m_pHScrollbar->GetVisibleSize();
1555 if( aTopLeft.X() > nXMax )
1556 aTopLeft.setX( nXMax < 0 ? 0 : nXMax );
1557 }
1558 SetVisArea( aTopLeft );
1559 }
1560 }
1561
1562 m_pWrtShell->LockView( true );
1563 m_pWrtShell->EndAction();
1564 m_pWrtShell->LockView( false );
1565 m_pWrtShell->EnableSmooth( true );
1566
1567}
1568
1569void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSequence )
1570{
1571 const SwRect& rRect = m_pWrtShell->GetCharRect();
1572 const tools::Rectangle& rVis = GetVisArea();
1573
1574 std::vector<beans::PropertyValue> aVector;
1575
1576 sal_uInt16 nViewID( GetViewFrame()->GetCurViewId());
1577 aVector.push_back(comphelper::makePropertyValue("ViewId", "view" + OUString::number(nViewID)));
1578
1579 aVector.push_back(comphelper::makePropertyValue("ViewLeft", convertTwipToMm100 ( rRect.Left() )));
1580
1581 aVector.push_back(comphelper::makePropertyValue("ViewTop", convertTwipToMm100 ( rRect.Top() )));
1582
1583 auto visibleLeft = convertTwipToMm100 ( rVis.Left() );
1584 aVector.push_back(comphelper::makePropertyValue("VisibleLeft", visibleLeft));
1585
1586 auto visibleTop = convertTwipToMm100 ( rVis.Top() );
1587 aVector.push_back(comphelper::makePropertyValue("VisibleTop", visibleTop));
1588
1589 // We don't read VisibleRight and VisibleBottom anymore, but write them,
1590 // because older versions rely on their presence to restore position
1591
1592 auto visibleRight = rVis.IsWidthEmpty() ? visibleLeft : convertTwipToMm100 ( rVis.Right() );
1593 aVector.push_back(comphelper::makePropertyValue("VisibleRight", visibleRight));
1594
1595 auto visibleBottom = rVis.IsHeightEmpty() ? visibleTop : convertTwipToMm100 ( rVis.Bottom() );
1596 aVector.push_back(comphelper::makePropertyValue("VisibleBottom", visibleBottom));
1597
1598 const sal_Int16 nZoomType = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetZoomType());
1599 aVector.push_back(comphelper::makePropertyValue("ZoomType", nZoomType));
1600
1601 const sal_Int16 nViewLayoutColumns = static_cast< sal_Int16 >(m_pWrtShell->GetViewOptions()->GetViewLayoutColumns());
1602 aVector.push_back(comphelper::makePropertyValue("ViewLayoutColumns", nViewLayoutColumns));
1603
1604 aVector.push_back(comphelper::makePropertyValue("ViewLayoutBookMode", m_pWrtShell->GetViewOptions()->IsViewLayoutBookMode()));
1605
1606 aVector.push_back(comphelper::makePropertyValue("ZoomFactor", static_cast < sal_Int16 > (m_pWrtShell->GetViewOptions()->GetZoom())));
1607
1608 aVector.push_back(comphelper::makePropertyValue("IsSelectedFrame", FrameTypeFlags::NONE != m_pWrtShell->GetSelFrameType()));
1609
1610 aVector.push_back(
1611 comphelper::makePropertyValue("KeepRatio", m_pWrtShell->GetViewOptions()->IsKeepRatio()));
1612
1613 aVector.push_back(comphelper::makePropertyValue(
1614 "HideWhitespace", m_pWrtShell->GetViewOptions()->IsHideWhitespaceMode()));
1615
1616 rSequence = comphelper::containerToSequence(aVector);
1617
1618 // Common SdrModel processing
1620}
1621
1622void SwView::ShowCursor( bool bOn )
1623{
1624 //don't scroll the cursor into the visible area
1625 bool bUnlockView = !m_pWrtShell->IsViewLocked();
1626 m_pWrtShell->LockView( true ); //lock visible section
1627
1628 if( !bOn )
1629 m_pWrtShell->HideCursor();
1630 else if( !m_pWrtShell->IsFrameSelected() && !m_pWrtShell->IsObjSelected() )
1631 m_pWrtShell->ShowCursor();
1632
1633 if( bUnlockView )
1634 m_pWrtShell->LockView( false );
1635}
1636
1637ErrCode SwView::DoVerb(sal_Int32 nVerb)
1638{
1639 if ( !GetViewFrame()->GetFrame().IsInPlace() )
1640 {
1641 SwWrtShell &rSh = GetWrtShell();
1642 const SelectionType nSel = rSh.GetSelectionType();
1643 if ( nSel & SelectionType::Ole )
1644 rSh.LaunchOLEObj( nVerb );
1645 }
1646 return ERRCODE_NONE;
1647}
1648
1649// only return true for a text selection
1650
1651bool SwView::HasSelection( bool bText ) const
1652{
1653 return bText ? GetWrtShell().SwCursorShell::HasSelection()
1655}
1656
1657OUString SwView::GetSelectionText( bool bCompleteWrds, bool /*bOnlyASample*/ )
1658{
1659 return GetSelectionTextParam( bCompleteWrds, true );
1660}
1661
1662OUString SwView::GetSelectionTextParam( bool bCompleteWrds, bool bEraseTrail )
1663{
1664 OUString sReturn;
1665 if( bCompleteWrds && !GetWrtShell().HasSelection() )
1666 GetWrtShell().SelWrd();
1667
1668 GetWrtShell().GetSelectedText( sReturn );
1669 if( bEraseTrail )
1670 sReturn = comphelper::string::stripEnd(sReturn, ' ');
1671 return sReturn;
1672}
1673
1675{
1676 if(!m_pGlosHdl)
1677 m_pGlosHdl.reset(new SwGlossaryHdl(GetViewFrame(), m_pWrtShell.get()));
1678 return m_pGlosHdl.get();
1679}
1680
1681void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
1682{
1683 bool bCallBase = true;
1684 if(auto pChangedHint = dynamic_cast<const FmDesignModeChangedHint*>(&rHint))
1685 {
1686 bool bDesignMode = pChangedHint->GetDesignMode();
1687 if (!bDesignMode && GetDrawFuncPtr())
1688 {
1690 SetDrawFuncPtr(nullptr);
1692 AttrChangedNotify(nullptr);
1693 }
1694 }
1695 else
1696 {
1697 SfxHintId nId = rHint.GetId();
1698
1699 switch ( nId )
1700 {
1701 // sub shells will be destroyed by the
1702 // dispatcher, if the view frame is dying. Thus, reset member <pShell>.
1703 case SfxHintId::Dying:
1704 {
1705 if ( &rBC == GetViewFrame() )
1706 {
1707 ResetSubShell();
1708 }
1709 }
1710 break;
1711 case SfxHintId::ModeChanged:
1712 {
1713 // Modal mode change-over?
1714 bool bModal = GetDocShell()->IsInModalMode();
1715 m_pHRuler->SetActive( !bModal );
1716 m_pVRuler->SetActive( !bModal );
1717 }
1718
1719 [[fallthrough]];
1720
1721 case SfxHintId::TitleChanged:
1722 if ( GetDocShell()->IsReadOnly() != GetWrtShell().GetViewOptions()->IsReadonly() )
1723 {
1724 SwWrtShell &rSh = GetWrtShell();
1726
1727 if ( rSh.GetViewOptions()->IsViewVRuler() )
1728 CreateVRuler();
1729 else
1730 KillVRuler();
1731 if ( rSh.GetViewOptions()->IsViewHRuler() )
1732 CreateTab();
1733 else
1734 KillTab();
1735 bool bReadonly = GetDocShell()->IsReadOnly();
1736 // if document is to be opened in alive-mode then this has to be
1737 // regarded while switching from readonly-mode to edit-mode
1738 if( !bReadonly )
1739 {
1741 if (pDrawDoc)
1742 {
1743 if( !pDrawDoc->GetOpenInDesignMode() )
1744 break;// don't touch the design mode
1745 }
1746 }
1747 SfxBoolItem aItem( SID_FM_DESIGN_MODE, !bReadonly);
1748 GetDispatcher().ExecuteList(SID_FM_DESIGN_MODE,
1749 SfxCallMode::ASYNCHRON, { &aItem });
1750 }
1751 break;
1752
1753 case SfxHintId::SwDrawViewsCreated:
1754 {
1755 bCallBase = false;
1756 if ( GetFormShell() )
1757 {
1758 GetFormShell()->SetView(dynamic_cast<FmFormView*>(GetWrtShell().GetDrawView()));
1759 SfxBoolItem aItem( SID_FM_DESIGN_MODE, !GetDocShell()->IsReadOnly());
1760 GetDispatcher().ExecuteList(SID_FM_DESIGN_MODE,
1761 SfxCallMode::SYNCHRON, { &aItem });
1762 }
1763 }
1764 break;
1765 case SfxHintId::RedlineChanged:
1766 {
1767 static sal_uInt16 const aSlotRedLine[] = {
1774 0
1775 };
1776 GetViewFrame()->GetBindings().Invalidate(aSlotRedLine);
1777 }
1778 break;
1779 default: break;
1780 }
1781 }
1782
1783 if ( bCallBase )
1784 SfxViewShell::Notify(rBC, rHint);
1785}
1786
1787#if defined(_WIN32) || defined UNX
1788
1790{
1791 uno::Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager();
1792 if( xScanMgr.is() )
1793 {
1794 const ScannerContext aContext( xScanMgr->getAvailableScanners().getConstArray()[ 0 ] );
1795 const ScanError eError = xScanMgr->getError( aContext );
1796
1797 if( ScanError_ScanErrorNone == eError )
1798 {
1799 const uno::Reference< awt::XBitmap > xBitmap( xScanMgr->getBitmap( aContext ) );
1800
1801 if( xBitmap.is() )
1802 {
1803 const BitmapEx aScanBmp( VCLUnoHelper::GetBitmap( xBitmap ) );
1804
1805 if( !aScanBmp.IsEmpty() )
1806 {
1807 Graphic aGrf(aScanBmp);
1808 m_pWrtShell->InsertGraphic( OUString(), OUString(), aGrf );
1809 }
1810 }
1811 }
1812 }
1813 SfxBindings& rBind = GetViewFrame()->GetBindings();
1814 rBind.Invalidate( SID_TWAIN_SELECT );
1815 rBind.Invalidate( SID_TWAIN_TRANSFER );
1816}
1817#endif
1818
1820{
1821 if(m_aTimer.IsActive())
1822 {
1823 m_aTimer.Stop();
1825 {
1826 GetViewFrame()->GetBindings().LEAVEREGISTRATIONS();
1828 }
1829 SelectShell();
1830 m_bAttrChgNotified = false;
1831 }
1832}
1833
1834bool SwView::PrepareClose( bool bUI )
1835{
1836 SfxViewFrame* pVFrame = GetViewFrame();
1837 pVFrame->SetChildWindow( SwInputChild::GetChildWindowId(), false );
1838 if( pVFrame->GetDispatcher()->IsLocked() )
1839 pVFrame->GetDispatcher()->Lock(false);
1840
1841 if ( m_pFormShell && !m_pFormShell->PrepareClose( bUI ) )
1842 {
1843 return false;
1844 }
1845 return SfxViewShell::PrepareClose( bUI );
1846}
1847
1848// status methods for clipboard.
1849// Status changes now notified from the clipboard.
1851{
1853 if( m_nLastPasteDestination != nPasteDestination )
1854 {
1855 TransferableDataHelper aDataHelper(
1857 &GetEditWin()) );
1858 if( aDataHelper.GetXTransferable().is() )
1859 {
1862 *m_pWrtShell, aDataHelper );
1863 }
1864 else
1866
1867 if( static_cast<SotExchangeDest>(0xFFFF) == m_nLastPasteDestination ) // the init value
1868 m_pViewImpl->AddClipboardListener();
1869 m_nLastPasteDestination = nPasteDestination;
1870 }
1871 return m_bPasteState;
1872}
1873
1875{
1877 return false;
1878
1880 if( m_nLastPasteDestination != nPasteDestination )
1881 {
1882 TransferableDataHelper aDataHelper(
1884 &GetEditWin()) );
1885 if( aDataHelper.GetXTransferable().is() )
1886 {
1889 *m_pWrtShell, aDataHelper );
1890 }
1891 else
1893
1894 if( static_cast<SotExchangeDest>(0xFFFF) == m_nLastPasteDestination ) // the init value
1895 m_pViewImpl->AddClipboardListener();
1896 }
1897 return m_bPasteSpecialState;
1898}
1899
1900bool SwView::IsPasteSpreadsheet(bool bHasOwnTableCopied)
1901{
1902 TransferableDataHelper aDataHelper(
1904 &GetEditWin()) );
1905 if( aDataHelper.GetXTransferable().is() )
1906 {
1907 if (bHasOwnTableCopied && SwTransferable::IsPasteOwnFormat( aDataHelper ))
1908 return true;
1909 return aDataHelper.HasFormat( SotClipboardFormatId::SYLK ) || aDataHelper.HasFormat( SotClipboardFormatId::SYLK_BIGCAPS );
1910 }
1911 return false;
1912}
1913
1915{
1917}
1918
1919// Printing
1920
1922{
1923 SwXTextView *const pTempImpl = GetViewImpl()->GetUNOObject_Impl();
1924 return pTempImpl->BuildTmpSelectionDoc();
1925}
1926
1928{
1929 GetViewImpl()->AddTransferable(rTransferable);
1930}
1931
1933{
1934 SwViewShell* pVwSh = GetWrtShellPtr();
1935 if (pVwSh)
1936 return pVwSh->getLOKVisibleArea();
1937 else
1938 return tools::Rectangle();
1939}
1940
1942{
1943 SwWrtShell* pSh = GetWrtShellPtr();
1944 assert(pSh);
1946}
1947
1948std::optional<OString> SwView::getLOKPayload(int nType, int nViewId) const
1949{
1950 SwWrtShell* pSh = GetWrtShellPtr();
1951 assert(pSh);
1952 return pSh->getLOKPayload(nType, nViewId);
1953}
1954
1956{
1957 uno::Reference<lang::XMultiServiceFactory> xFactory(GetDocShell()->GetModel(), uno::UNO_QUERY);
1958 uno::Reference<beans::XPropertySet> xSettings(
1959 xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
1960 OUString sDataSourceName = "";
1961 xSettings->getPropertyValue("CurrentDatabaseDataSource") >>= sDataSourceName;
1962
1963 return sDataSourceName;
1964}
1965
1966bool SwView::IsDataSourceAvailable(const OUString sDataSourceName)
1967{
1968 uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
1969 Reference< XDatabaseContext> xDatabaseContext = DatabaseContext::create(xContext);
1970
1971 return xDatabaseContext->hasByName(sDataSourceName);
1972}
1973
1974namespace sw {
1975
1976void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
1977{
1978 o_rData = *SW_MOD()->GetPrtOptions(bWeb);
1979}
1980
1981} // namespace sw
1982
1983/* 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 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:192
void PrtOLENotify(bool bAll)
Definition: docdesc.cxx:812
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:406
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:177
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:156
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:342
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:3368
static bool IsPasteSpecial(const SwWrtShell &rWrtShell, const TransferableDataHelper &)
Definition: swdtflvr.cxx:3359
static SotExchangeDest GetSotDestination(const SwWrtShell &rSh)
Definition: swdtflvr.cxx:2076
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:1090
bool IsViewHRuler(bool bDirect=false) const
Definition: viewopt.hxx:592
bool IsHideWhitespaceMode() const
Definition: viewopt.hxx:483
void SetHideWhitespaceMode(bool bMode)
Definition: viewopt.hxx:484
bool IsViewLayoutBookMode() const
Definition: viewopt.hxx:479
SvxZoomType GetZoomType() const
Definition: viewopt.hxx:546
bool IsShowHiddenField() const
Definition: viewopt.hxx:328
bool IsShowHiddenPara() const
Definition: viewopt.hxx:397
sal_uInt16 GetZoom() const
Definition: viewopt.hxx:505
void SetZoomType(SvxZoomType eZoom_)
Definition: viewopt.hxx:572
void SetZoom(sal_uInt16 n)
Definition: viewopt.hxx:506
sal_uInt16 GetViewLayoutColumns() const
Definition: viewopt.hxx:481
bool IsKeepRatio() const
Definition: viewopt.hxx:535
bool IsViewHScrollBar() const
Definition: viewopt.hxx:527
void SetKeepRatio(bool b)
Definition: viewopt.hxx:554
bool getBrowseMode() const
Definition: viewopt.hxx:472
bool IsShowHiddenChar(bool bHard=false) const
Definition: viewopt.hxx:321
void SetOnlineSpell(bool b)
Definition: viewopt.cxx:337
bool IsViewVRuler(bool bDirect=false) const
Definition: viewopt.hxx:606
bool IsCursorInProtectedArea() const
Definition: viewopt.hxx:409
void SetReadonly(bool bSet)
Definition: viewopt.hxx:464
bool IsViewVScrollBar() const
Definition: viewopt.hxx:519
bool IsFieldName() const
Definition: viewopt.hxx:269
void SetViewLayoutColumns(sal_uInt16 nNew)
Definition: viewopt.hxx:482
void SetViewLayoutBookMode(bool bNew)
Definition: viewopt.hxx:480
void setBrowseMode(bool bSet)
Definition: viewopt.hxx:473
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:436
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2214
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2819
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:221
SwXTextView * GetUNOObject_Impl()
Definition: uivwimp.cxx:94
Definition: view.hxx:146
virtual bool PrepareClose(bool bUI=true) override
Definition: view.cxx:1834
void ScannerEventHdl()
Definition: view.cxx:1789
virtual ErrCode DoVerb(sal_Int32 nVerb) override
Definition: view.cxx:1637
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:256
virtual void WriteUserData(OUString &, bool bBrowse=false) override
Definition: view.cxx:1168
bool m_bPasteState
Definition: view.hxx:253
virtual bool HasSelection(bool bText=true) const override
Definition: view.cxx:1651
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: view.cxx:1331
SfxDispatcher & GetDispatcher()
Definition: view.cxx:135
virtual void flushPendingLOKInvalidateTiles() override
Definition: view.cxx:1941
static SvxSearchItem * s_pSrchItem
Definition: view.hxx:165
SwWrtShell & GetWrtShell() const
Definition: view.hxx:413
SAL_DLLPRIVATE void CheckReadonlySelection()
Definition: view.cxx:688
SfxShell * m_pShell
Definition: view.hxx:197
void CreateVRuler()
Definition: viewmdi.cxx:662
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:1657
virtual SdrView * GetDrawView() const override
Definition: viewdraw.cxx:621
virtual std::optional< OString > getLOKPayload(int nType, int nViewId) const override
Definition: view.cxx:1948
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:1850
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:578
void GotFocus() const
Definition: view.cxx:166
void Execute(SfxRequest &)
Definition: view2.cxx:543
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:743
void CreateTab()
Definition: viewmdi.cxx:620
void SetViewLayout(sal_uInt16 nColumns, bool bBookMode, bool bViewOnly=false)
Definition: viewmdi.cxx:224
void ShowHScrollbar(bool bShow)
Definition: viewmdi.cxx:722
std::unique_ptr< SwFormatClipboard > m_pFormatClipboard
Definition: view.hxx:217
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:426
static std::unique_ptr< SearchAttrItemList > s_xReplaceList
Definition: view.hxx:175
virtual tools::Rectangle getLOKVisibleArea() const override
Definition: view.cxx:1932
SfxObjectShellLock CreateTmpSelectionDoc()
Definition: view.cxx:1921
virtual ~SwView() override
Definition: view.cxx:1107
bool m_bAttrChgNotified
Definition: view.hxx:245
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &) override
Definition: view.cxx:1569
bool m_bOldShellWasPagePreview
Definition: view.hxx:257
static std::unique_ptr< SearchAttrItemList > s_xSearchList
Definition: view.hxx:174
bool m_bPasteSpecialState
Definition: view.hxx:254
void StopShellTimer()
Definition: view.cxx:1819
OUString GetDataSourceName() const
Definition: view.cxx:1955
void ImpSetVerb(SelectionType nSelType)
Definition: view.cxx:140
virtual void ReadUserData(const OUString &, bool bBrowse=false) override
Definition: view.cxx:1212
SelectionType m_nSelectionType
Definition: view.hxx:221
void AddTransferable(SwTransferable &rTransferable)
Definition: view.cxx:1927
Size m_aDocSz
Definition: view.hxx:190
static bool s_bExtra
Definition: view.hxx:170
bool m_bInitOnceCompleted
Definition: view.hxx:261
bool IsPasteSpecialAllowed()
Definition: view.cxx:1874
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:414
SwDrawBase * GetDrawFuncPtr() const
Definition: view.hxx:526
SwGlossaryHdl * GetGlosHdl()
Definition: view.cxx:1674
virtual void ShowCursor(bool bOn=true) override
Definition: view.cxx:1622
void ResetSubShell()
Definition: view.hxx:582
SwEditWin & GetEditWin()
Definition: view.hxx:416
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:1681
static bool s_bFound
Definition: view.hxx:171
std::unique_ptr< SwViewGlueDocShell > m_xGlueDocShell
Definition: view.hxx:195
void KillTab()
Definition: viewmdi.cxx:628
SwDocShell * GetDocShell()
Definition: view.cxx:1160
SwView_Impl * GetViewImpl()
Definition: view.hxx:348
void DocSzChgd(const Size &rNewSize)
Definition: viewport.cxx:154
bool m_bAttrChgNotifiedWithRegistrations
Definition: view.hxx:246
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:671
bool m_bIsPreviewDoubleClick
Definition: view.hxx:258
void LeaveDrawCreate()
Definition: view.hxx:538
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:1966
void ShowVScrollbar(bool bShow)
Definition: viewmdi.cxx:734
bool m_bHScrollbarEnabled
Definition: view.hxx:205
const SwFrameFormat * m_pLastFlyFormat
Definition: view.hxx:215
bool IsPasteSpreadsheet(bool bHasOwnTableCopied)
Definition: view.cxx:1900
OUString m_sNewCursorPos
Definition: view.hxx:180
bool m_bVerbsActive
Definition: view.hxx:247
void SetZoom(SvxZoomType eZoomType, short nFactor=100, bool bViewOnly=false)
Definition: viewmdi.cxx:73
OUString GetSelectionTextParam(bool bCompleteWords, bool bEraseTrail)
Definition: view.cxx:1662
void NotifyDBChanged()
Definition: view.cxx:1914
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:1701
virtual void SetReadonlyOption(bool bSet) override
Definition: wrtsh1.cxx:2110
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:639
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getViewSettings() override
Definition: unotxvw.cxx:544
void NotifyDBChanged()
Definition: unotxvw.cxx:723
SfxObjectShellLock BuildTmpSelectionDoc()
Definition: unotxvw.cxx:676
void NotifySelChanged()
Definition: unotxvw.cxx:711
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:518
#define FN_REDLINE_ACCEPT_DIRECT
Definition: cmdid.h:141
#define FN_TABLE_PASTE_COL_BEFORE
Definition: cmdid.h:312
#define FN_FORMAT_DROPCAPS
Definition: cmdid.h:333
#define FN_INSERT_LINEBREAK
Definition: cmdid.h:215
#define FN_INSERT_BOOKMARK
Definition: cmdid.h:200
#define FN_INSERT_BREAK_DLG
Definition: cmdid.h:202
#define FN_INSERT_COMBO_BOX_CONTENT_CONTROL
Definition: cmdid.h:229
#define FN_INSERT_CONTENT_CONTROL
Definition: cmdid.h:217
#define FN_SET_SUPER_SCRIPT
Definition: cmdid.h:322
#define FN_BACKSPACE
Definition: cmdid.h:678
#define FN_INSERT_PLAIN_TEXT_CONTENT_CONTROL
Definition: cmdid.h:225
#define FN_DELETE_LINE
Definition: cmdid.h:683
#define FN_EDIT_REGION
Definition: cmdid.h:115
#define FN_REDLINE_ACCEPT_ALL
Definition: cmdid.h:147
#define FN_DELETE_BACK_LINE
Definition: cmdid.h:684
#define FN_JAVAEDIT
Definition: cmdid.h:286
#define FN_DELETE_SENT
Definition: cmdid.h:679
#define FN_SHIFT_BACKSPACE
Definition: cmdid.h:693
#define FN_GROW_FONT_SIZE
Definition: cmdid.h:319
#define FN_SELECT_PARA
Definition: cmdid.h:125
#define FN_POSTIT
Definition: cmdid.h:226
#define FN_SHRINK_FONT_SIZE
Definition: cmdid.h:320
#define FN_TXTATR_INET
Definition: cmdid.h:751
#define FN_INSERT_DROPDOWN_CONTENT_CONTROL
Definition: cmdid.h:221
#define FN_DELETE_BACK_PARA
Definition: cmdid.h:686
#define FN_DELETE_PARA
Definition: cmdid.h:685
#define FN_REDLINE_REJECT_DIRECT
Definition: cmdid.h:142
#define FN_DELETE_WORD
Definition: cmdid.h:681
#define FN_DELETE_BACK_WORD
Definition: cmdid.h:682
#define FN_INSERT_DATE_CONTENT_CONTROL
Definition: cmdid.h:224
#define FN_PASTE_NESTED_TABLE
Definition: cmdid.h:310
#define FN_REDLINE_NEXT_CHANGE
Definition: cmdid.h:145
#define FN_REDLINE_PREV_CHANGE
Definition: cmdid.h:146
#define FN_DELETE_WHOLE_LINE
Definition: cmdid.h:687
#define FN_SET_SUB_SCRIPT
Definition: cmdid.h:323
#define FN_INSERT_COLUMN_BREAK
Definition: cmdid.h:203
#define FN_INSERT_PICTURE_CONTENT_CONTROL
Definition: cmdid.h:223
#define FN_CALCULATE
Definition: cmdid.h:505
#define FN_INSERT_CHECKBOX_CONTENT_CONTROL
Definition: cmdid.h:218
#define FN_REDLINE_REJECT_ALL
Definition: cmdid.h:148
#define FN_TABLE_PASTE_ROW_BEFORE
Definition: cmdid.h:311
#define FN_DELETE_BACK_SENT
Definition: cmdid.h:680
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:1976
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:114
#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:1199
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