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