LibreOffice Module sd (master) 1
futext.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 <futext.hxx>
21#include <editeng/eeitem.hxx>
22#include <svx/sdrpagewindow.hxx>
24#include <tools/urlobj.hxx>
25#include <vcl/help.hxx>
26#include <editeng/fhgtitem.hxx>
27#include <svl/intitem.hxx>
28#include <svl/stritem.hxx>
29#include <svx/svdotext.hxx>
30#include <editeng/flditem.hxx>
31#include <svl/style.hxx>
32#include <svx/svdpagv.hxx>
33#include <svx/sdtmfitm.hxx>
34#include <svx/sdtagitm.hxx>
35#include <svx/sdtfsitm.hxx>
36#include <sfx2/viewfrm.hxx>
37#include <sfx2/dispatch.hxx>
38#include <sfx2/bindings.hxx>
39#include <sfx2/request.hxx>
40#include <editeng/editeng.hxx>
41#include <svx/svdoutl.hxx>
42#include <svx/svxids.hrc>
44#include <sfx2/docfile.hxx>
45#include <editeng/outlobj.hxx>
46#include <osl/diagnose.h>
47
49
50#include <svx/svdetc.hxx>
51#include <editeng/editview.hxx>
52
53#include <sdresid.hxx>
54#include <app.hrc>
55
56#include <ViewShell.hxx>
57#include <ViewShellBase.hxx>
58#include <View.hxx>
59#include <Window.hxx>
60#include <drawdoc.hxx>
61#include <sdpage.hxx>
62#include <FrameView.hxx>
63#include <ToolBarManager.hxx>
64#include <DrawDocShell.hxx>
65#include <strings.hrc>
66#include <pres.hxx>
67
68using namespace ::com::sun::star;
69using namespace ::com::sun::star::uno;
70using namespace ::com::sun::star::lang;
71using namespace ::com::sun::star::linguistic2;
72
73namespace sd {
74
75const sal_uInt16 SidArray[] = {
76 SID_STYLE_FAMILY2, // 5542
77 SID_STYLE_FAMILY5, // 5545
78 SID_REDO, // 5700
79 SID_UNDO, // 5701
80 SID_CUT, // 5710
81 SID_COPY, // 5711
82 SID_ATTR_TABSTOP, // 10002
83 SID_ATTR_CHAR_FONT, // 10007
84 SID_ATTR_CHAR_POSTURE, // 10008
85 SID_ATTR_CHAR_WEIGHT, // 10009
86 SID_ATTR_CHAR_SHADOWED, // 10010
87 SID_ATTR_CHAR_STRIKEOUT, // 10013
88 SID_ATTR_CHAR_UNDERLINE, // 10014
89 SID_ATTR_CHAR_FONTHEIGHT, // 10015
90 SID_ATTR_CHAR_COLOR, // 10017
91 SID_ATTR_CHAR_KERNING, // 10018
92 SID_ATTR_CHAR_CASEMAP, // 10019
93 SID_ATTR_PARA_ADJUST_LEFT, // 10028
94 SID_ATTR_PARA_ADJUST_RIGHT, // 10029
95 SID_ATTR_PARA_ADJUST_CENTER, // 10030
96 SID_ATTR_PARA_ADJUST_BLOCK, // 10031
97 SID_ATTR_PARA_LINESPACE_10, // 10034
98 SID_ATTR_PARA_LINESPACE_15, // 10035
99 SID_ATTR_PARA_LINESPACE_20, // 10036
100 SID_ATTR_PARA_ULSPACE, // 10042
101 SID_ATTR_PARA_LRSPACE, // 10043
102 SID_ATTR_TRANSFORM_POS_X, // 10088
103 SID_ATTR_TRANSFORM_POS_Y, // 10089
104 SID_ATTR_TRANSFORM_WIDTH, // 10090
105 SID_ATTR_TRANSFORM_HEIGHT, // 10091
106 SID_ATTR_TRANSFORM_ROT_X, // 10093
107 SID_ATTR_TRANSFORM_ROT_Y, // 10094
108 SID_ATTR_TRANSFORM_ANGLE, // 10095 //Added
109 SID_OUTLINE_UP, // 10150
110 SID_OUTLINE_DOWN, // 10151
111 SID_OUTLINE_LEFT, // 10152
112 SID_OUTLINE_RIGHT, // 10153
113 SID_ATTR_TRANSFORM_PROTECT_POS, // 10236
114 SID_ATTR_TRANSFORM_PROTECT_SIZE, // 10237 //Added
115 SID_FORMTEXT_STYLE, // 10257
116 SID_SET_SUPER_SCRIPT, // 10294
117 SID_SET_SUB_SCRIPT, // 10295
118 SID_ATTR_TRANSFORM_AUTOWIDTH, // 10310
119 SID_ATTR_TRANSFORM_AUTOHEIGHT, // 10311 //Added
120 SID_HYPERLINK_GETLINK, // 10361
121 SID_DEC_INDENT, // 10461
122 SID_INC_INDENT, // 10462
123 SID_CHARMAP, // 10503
124 SID_TEXTDIRECTION_LEFT_TO_RIGHT, // 10907
125 SID_TEXTDIRECTION_TOP_TO_BOTTOM, // 10908
126 SID_ATTR_PARA_LEFT_TO_RIGHT, // 10950
127 SID_ATTR_PARA_RIGHT_TO_LEFT, // 10951
128 SID_PARASPACE_INCREASE, // 11145
129 SID_PARASPACE_DECREASE, // 11146
130 FN_NUM_BULLET_ON, // 20138
131 0 };
132
133
138: FuConstruct(pViewSh, pWin, pView, pDoc, rReq)
139, bFirstObjCreated(false)
140, bJustEndedEdit(false)
141, rRequest (rReq)
142{
143}
144
146{
147 rtl::Reference<FuPoor> xFunc( new FuText( pViewSh, pWin, pView, pDoc, rReq ) );
148 return xFunc;
149}
150
152{
153 if(mpView)
154 {
155 if(mpView->SdrEndTextEdit() == SdrEndTextEditKind::Deleted)
156 mxTextObj = nullptr;
157
158 // reset the RequestHandler of the used Outliner to the handler of the document
159 ::Outliner* pOutliner = mpView->GetTextEditOutliner();
160
161 if (pOutliner)
162 pOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(mpDoc->GetStyleSheetPool()));
163 }
164}
165
166/*************************************************************************
167|*
168|* Execute functionality of this class:
169|*
170|* #71422: Start the functionality of this class in this method
171|* and not in the ctor.
172|* If you construct an object of this class and you put the
173|* address of this object to pFuActual you've got a problem,
174|* because some methods inside DoExecute use the pFuActual-Pointer.
175|* If the code inside DoExecute is executed inside the ctor,
176|* the value of pFuActual is not right. And the value will not
177|* be right until the ctor finished !!!
178|*
179\************************************************************************/
181{
182 mpViewShell->GetViewShellBase().GetToolBarManager()->SetToolBarShell(
184 ToolbarId::Draw_Text_Toolbox_Sd);
185
186 mpView->SetCurrentObj(SdrObjKind::Text);
187 mpView->SetEditMode(SdrViewEditMode::Edit);
188
189 MouseEvent aMEvt(mpWindow->GetPointerPosPixel());
190
191 if (nSlotId == SID_TEXTEDIT)
192 {
193 // Try to select an object
195 SdrViewEvent aVEvt;
196 mpView->PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
197 mpView->MarkObj(aVEvt.mpRootObj, pPV);
198
200 }
201 else if (mpView->AreObjectsMarked())
202 {
203 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
204
205 if (rMarkList.GetMarkCount() == 1)
206 {
207 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
209 }
210 }
211
212 // check for table
214 {
215 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
216
217 if (rMarkList.GetMarkCount() == 1)
218 {
219 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
220 if( pObj && (pObj->GetObjInventor() == SdrInventor::Default ) && (pObj->GetObjIdentifier() == SdrObjKind::Table) )
221 {
222 mpViewShell->GetViewShellBase().GetToolBarManager()->AddToolBarShell(ToolBarManager::ToolBarGroup::Function, ToolbarId::Draw_Table_Toolbox);
223 }
224 }
225 }
226
227 bool bQuickDrag = true;
228
229 const SfxItemSet* pArgs = rRequest.GetArgs();
230
231 if (pArgs
232
233 // test for type before using
234 && SID_TEXTEDIT == nSlotId
235 && SfxItemState::SET == pArgs->GetItemState(SID_TEXTEDIT)
236
237 && pArgs->Get(SID_TEXTEDIT).GetValue() == 2)
238 {
239 // Selection by doubleclick -> don't allow QuickDrag
240 bQuickDrag = false;
241 }
242
243 SetInEditMode(aMEvt, bQuickDrag);
244}
245
247{
248 bMBDown = true;
249 bJustEndedEdit = false;
250
251 bool bReturn = FuDraw::MouseButtonDown(rMEvt);
252
253 SdrViewEvent aVEvt;
254 SdrHitKind eHit = mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
255
256 // handle URL also during the text editing
257 if (rMEvt.GetClicks() == 1 && rMEvt.IsLeft() && rMEvt.IsMod1())
258 {
260
261 if (mxTextObj.get().is() && pOLV && pOLV->GetFieldUnderMousePointer())
262 {
263 const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer();
264 if (pFieldItem)
265 {
266 const SvxFieldData* pField = pFieldItem->GetField();
267
268 if (auto pURLField = dynamic_cast< const SvxURLField *>( pField ))
269 {
270 eHit = SdrHitKind::MarkedObject;
271 aVEvt.meEvent = SdrEventKind::ExecuteUrl;
272 aVEvt.mpURLField = pURLField;
273 }
274 }
275 }
276 }
277
278 if (eHit == SdrHitKind::TextEdit)
279 {
280 // hit text -> SdrView handles event
281 if (mpView->MouseButtonDown(rMEvt, mpWindow->GetOutDev()))
282 return true;
283 }
284
285 if (rMEvt.GetClicks() == 1)
286 {
287 if (mpView->IsTextEdit() && eHit != SdrHitKind::MarkedObject && eHit != SdrHitKind::Handle)
288 {
289 // finish text input
290 if(mpView->SdrEndTextEdit() == SdrEndTextEditKind::Deleted)
291 {
292 /* Bugfix from MBA: during a double click onto the unused? area
293 in text mode, we get with the second click eHit =
294 SdrHitKind::TextEditObj since it goes to the TextObject which was
295 created with the first click. But this is removed by
296 SdrEndTextEdit since it is empty. But it is still in the mark
297 list. The call MarkObj further below accesses then the dead
298 object. As a simple fix, we determine eHit after
299 SdrEndTextEdit again, this returns then SdrHitKind::NONE. */
300 mxTextObj = nullptr;
301 eHit = mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
302 }
303
304 mpView->SetCurrentObj(SdrObjKind::Text);
305 mpView->SetEditMode(SdrViewEditMode::Edit);
306 }
307
308 if (rMEvt.IsLeft() || rMEvt.IsRight())
309 {
310 mpWindow->CaptureMouse();
312
313 if (eHit == SdrHitKind::TextEdit)
314 {
315 SetInEditMode(rMEvt, false);
316 }
317 else
318 {
319 // Don't remark table when clicking in it, mark change triggers a lot of updating
320 bool bMarkChanges = true;
322 if (eHit == SdrHitKind::TextEditObj && xSelectionController.is())
323 {
324 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
325 if (rMarkList.GetMarkCount() == 1 && rMarkList.GetMark(0)->GetMarkedSdrObj() == aVEvt.mpRootObj)
326 bMarkChanges = false;
327 }
328
329 if (eHit != SdrHitKind::Handle)
330 {
331 // deselect selection
332 if (!rMEvt.IsShift() && eHit == SdrHitKind::TextEditObj)
333 {
334 if(bMarkChanges)
335 {
336 mpView->UnmarkAll();
337 mpView->SetDragMode(SdrDragMode::Move);
338 }
339 }
340 }
341
342 if ( aVEvt.meEvent == SdrEventKind::ExecuteUrl ||
343 eHit == SdrHitKind::Handle ||
344 eHit == SdrHitKind::MarkedObject ||
345 eHit == SdrHitKind::TextEditObj ||
346 ( eHit == SdrHitKind::UnmarkedObject && bFirstObjCreated &&
347 !bPermanent ) )
348 {
349 // Handle, hit marked or unmarked object
350 if (eHit == SdrHitKind::TextEditObj)
351 {
352 /* hit text of unmarked object:
353 select object and set to EditMode */
354 if (bMarkChanges)
355 mpView->MarkObj(aVEvt.mpRootObj, pPV);
356
357 if (auto pSdrTextObj = DynCastSdrTextObj(aVEvt.mpObj))
358 {
359 mxTextObj = pSdrTextObj;
360 }
361
362 SetInEditMode(rMEvt, true);
363 }
364 else if (aVEvt.meEvent == SdrEventKind::ExecuteUrl && !rMEvt.IsMod2())
365 {
366 // execute URL
367 mpWindow->ReleaseMouse();
368
369 if (aVEvt.mpURLField)
370 {
371 SfxStringItem aStrItem(SID_FILE_NAME, aVEvt.mpURLField->GetURL());
372 SfxStringItem aReferer(SID_REFERER, mpDocSh->GetMedium()->GetName());
373 SfxBoolItem aBrowseItem( SID_BROWSE, true );
375
376 if (rMEvt.IsMod1())
377 {
378 // open in new frame
379 pFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
380 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
381 { &aStrItem, &aBrowseItem, &aReferer });
382 }
383 else
384 {
385 // open in current frame
386 SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
387 pFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
388 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
389 { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
390 }
391 }
392 }
393 else
394 {
395 // drag object or handle
396
397 // #i78748#
398 // do the EndTextEdit first, it will delete the handles and force a
399 // recreation. This will make aVEvt.mpHdl to point to a deleted handle,
400 // thus it is necessary to reset it and to get it again.
401
402 // #i112855#
403 // cl: I'm not sure why we checked here also for mxTextObj->GetOutlinerParaObject
404 // this caused SdrEndTextEdit() to be called also when not in text editing and
405 // this does not make sense and caused troubles. (see issue 112855)
406
407 if( mpView->IsTextEdit() )
408 {
410 bJustEndedEdit = true;
411
412 if(aVEvt.mpHdl)
413 {
414 // force new handle identification, the pointer will be dead here
415 // since SdrEndTextEdit has reset (deleted) the handles.
416 aVEvt.mpHdl = nullptr;
417 mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
418 }
419 }
420
421 if (!aVEvt.mpHdl)
422 {
423 if( eHit == SdrHitKind::UnmarkedObject )
424 {
425 if ( !rMEvt.IsShift() )
426 mpView->UnmarkAll();
427
428 mpView->MarkObj(aVEvt.mpRootObj, pPV);
429 }
430
431 // Drag object
432 bFirstMouseMove = true;
434 }
435
436 if ( ! rMEvt.IsRight())
437 {
438 // we need to pick again since SdrEndTextEdit can rebuild the handles list
439 eHit = mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
440 if( (eHit == SdrHitKind::Handle) || (eHit == SdrHitKind::MarkedObject) )
441 {
442 sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() );
443 mpView->BegDragObj(aMDPos, nullptr, aVEvt.mpHdl, nDrgLog);
444 }
445 }
446 bReturn = true;
447 }
448 }
449 else if ( nSlotId != SID_TEXTEDIT &&
451 {
452 // create object
453 mpView->SetCurrentObj(SdrObjKind::Text);
454 mpView->SetEditMode(SdrViewEditMode::Create);
455 sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() );
456 mpView->BegCreateObj(aMDPos, nullptr, nDrgLog);
457 }
458 else
459 {
460 // select
461 if( !rMEvt.IsShift() )
462 mpView->UnmarkAll();
463
465 }
466 }
467 }
468 }
469 else if ( rMEvt.GetClicks() == 2 && !mpView->IsTextEdit() )
470 {
471 MouseEvent aMEvt( mpWindow->GetPointerPosPixel() );
472 SetInEditMode( aMEvt, false );
473 }
474
475 if (!bIsInDragMode)
476 {
477 ForcePointer(&rMEvt);
479 }
480
481 return bReturn;
482}
483
485{
486 bool bReturn = FuDraw::MouseMove(rMEvt);
487
488 if (aDragTimer.IsActive() )
489 {
490 if( bFirstMouseMove )
491 bFirstMouseMove = false;
492 else
494 }
495
496 if (!bReturn && mpView->IsAction() && !mpDocSh->IsReadOnly())
497 {
498 Point aPix(rMEvt.GetPosPixel());
499 Point aPnt(mpWindow->PixelToLogic(aPix));
500
501 ForceScroll(aPix);
502 mpView->MovAction(aPnt);
503 }
504
505 ForcePointer(&rMEvt);
506
507 return bReturn;
508}
509
511{
512 if( nSlotId == SID_ATTR_CHAR )
513 {
517 pTxtObj->SetMergedItemSet(aSet);
519 const SfxViewShell* pCurrentViewShell = SfxViewShell::Current();
520 if (pCurrentViewShell && (pCurrentViewShell->isLOKMobilePhone() || pCurrentViewShell->isLOKTablet()))
521 pTxtObj->SetText(SdResId(STR_PRESOBJ_TEXT_EDIT_MOBILE));
522 }
523 else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
524 {
525 // draw text object, needs to be initialized when vertical text is used
527
530
531 // Set defaults for vertical click-n'drag text object, pool defaults are:
532 // SdrTextVertAdjustItem: SDRTEXTVERTADJUST_TOP
533 // SdrTextHorzAdjustItem: SDRTEXTHORZADJUST_BLOCK
534 // Analog to that:
537
538 pTxtObj->SetMergedItemSet(aSet);
540 }
541}
542
544{
545 // FitToSize (fit to frame)
547 aSet.Put(SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_PROPORTIONAL));
550 pTxtObj->SetMergedItemSet(aSet);
552}
553
555{
557 aSet.Put(SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_PROPORTIONAL));
560 pTxtObj->SetMergedItemSet(aSet);
562}
563
565{
566 bool bReturn = false;
567 if (aDragTimer.IsActive())
568 {
570 bIsInDragMode = false;
571 }
572
574
575 Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
576
577 if( (mpView && mpView->MouseButtonUp(rMEvt, mpWindow->GetOutDev())) || rMEvt.GetClicks() == 2 )
578 return true; // handle event from SdrView
579
580 bool bEmptyTextObj = false;
581
582 if (mxTextObj.get().is())
583 {
584 bool bReset = true;
585
586 if (mpView)
587 {
588 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
589
590 if (rMarkList.GetMarkCount() == 1
591 && ( rMarkList.GetMark(0)->GetMarkedSdrObj() == mxTextObj.get().get()) )
592 {
593 if (!GetTextObj()->GetOutlinerParaObject() )
594 bEmptyTextObj = true;
595 else
596 bFirstObjCreated = true;
597 bReset = false;
598 }
599 }
600
601 if (bReset)
602 {
603 mxTextObj = nullptr;
604 }
605 }
606
607 if (rMEvt.IsLeft() && !mxTextObj.get().is() && IsIgnoreUnexpectedMouseButtonUp())
608 return false;
609
610 if( mpView && mpView->IsDragObj())
611 {
612 // object was moved
613 FrameView* pFrameView = mpViewShell->GetFrameView();
614 bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
615
616 if (bDragWithCopy)
617 {
618 bDragWithCopy = !mpView->IsPresObjSelected(false);
619 }
620
621 mpView->SetDragWithCopy(bDragWithCopy);
624 mpView->SetCurrentObj(SdrObjKind::Text);
625
626 sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() );
627
628 if (bJustEndedEdit)
629 {
630 bJustEndedEdit = false;
632 }
633 if ((rMEvt.GetClicks() != 2) &&
634 !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsRight() &&
635 std::abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
636 std::abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
637 {
638 /*************************************************************
639 * From text mode, you don't want to rotate immediately.
640 **************************************************************/
641 SdrPageView* pPV;
642 SdrObject* pObj = mpView->PickObj(aMDPos, mpView->getHitTolLog(), pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK);
643 if (pObj && pPV->IsObjMarkable(pObj))
644 {
646 mpView->MarkObj(pObj,pPV);
647 return bReturn;
648 }
649 }
650 }
651 else if( mpView && mpView->IsCreateObj() && rMEvt.IsLeft())
652 {
653 // object was created
655 mxTextObj = pTextObj.get();
656
657 if( pTextObj )
658 {
659 //AW outliner needs to be set to vertical when there is no
660 // outliner object up to now; also it needs to be set back to not
661 // vertical when there was a vertical one used last time.
663 SdrOutliner& rOutl(pTextObj->getSdrModelFromSdrObject().GetDrawOutliner(GetTextObj()));
664 bool bVertical((pOPO && pOPO->IsEffectivelyVertical())
665 || nSlotId == SID_ATTR_CHAR_VERTICAL
666 || nSlotId == SID_TEXT_FITTOSIZE_VERTICAL);
667 rOutl.SetVertical(bVertical);
668
669 // Before ImpSetAttributesForNewTextObject the vertical writing mode
670 // needs to be set at the object. This is done here at the OutlinerParaObject
671 // directly to not mirror the layout text items involved. These items will be set
672 // from ImpSetAttributesForNewTextObject and below.
674
675 if(!pPara)
676 {
679 }
680
681 if(pPara && bVertical != pPara->IsEffectivelyVertical())
682 {
683 // set ParaObject orientation accordingly
684 pPara->SetVertical(bVertical);
685 }
686
688 }
689
690 if (!mpView->EndCreateObj(SdrCreateCmd::ForceEnd))
691 {
692 // it was not possible to create text object
693 mxTextObj = nullptr;
694 pTextObj = nullptr;
695 }
696 else if (nSlotId == SID_TEXT_FITTOSIZE)
697 {
699
700 SetInEditMode(rMEvt, false);
701 }
702 else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
703 {
705
706 SetInEditMode(rMEvt, false);
707 }
708 else
709 {
710 // thereby the handles and the gray frame are correct
712 mpView->PickHandle(aPnt);
713 SetInEditMode(rMEvt, false);
714 }
715 }
716 else if ( mpView && mpView->IsAction())
717 {
718 mpView->EndAction();
719 }
720
721 ForcePointer(&rMEvt);
722 mpWindow->ReleaseMouse();
723
724 if ( mpView && !mpView->AreObjectsMarked() )
725 {
726 sal_uInt16 nDrgLog1 = sal_uInt16 ( mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() );
727 if ( std::abs(aMDPos.X() - aPnt.X()) < nDrgLog1 &&
728 std::abs(aMDPos.Y() - aPnt.Y()) < nDrgLog1 &&
729 !rMEvt.IsShift() && !rMEvt.IsMod2() )
730 {
732 SdrViewEvent aVEvt;
733 mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
734 mpView->MarkObj(aVEvt.mpRootObj, pPV2);
735 }
736 }
737
738 if ( !mxTextObj.get().is() && mpView )
739 {
740 if ( ( (!bEmptyTextObj && bPermanent) ||
741 (!bFirstObjCreated && !bPermanent) ) &&
742 !mpDocSh->IsReadOnly() &&
743 nSlotId != SID_TEXTEDIT )
744 {
745 // text body (left-justified AutoGrow)
746 mpView->SetCurrentObj(SdrObjKind::Text);
747 mpView->SetEditMode(SdrViewEditMode::Create);
748 sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(mpView->GetDragThresholdPixels(),0)).Width() );
749 mpView->BegCreateObj(aMDPos, nullptr, nDrgLog);
750
751 bool bSnapEnabled = mpView->IsSnapEnabled();
752
753 if (bSnapEnabled)
754 mpView->SetSnapEnabled(false);
755
756 aPnt.AdjustX(nDrgLog + nDrgLog );
757 aPnt.AdjustY(nDrgLog + nDrgLog );
758 mpView->MovAction(aPnt);
759
761
762 if(mxTextObj.get().is())
763 {
765 }
766
767 if(!mpView->EndCreateObj(SdrCreateCmd::ForceEnd))
768 {
769 mxTextObj.clear();
770 }
771
772 if(bSnapEnabled)
773 mpView->SetSnapEnabled(bSnapEnabled);
774
775 if(mxTextObj.get().is())
776 {
782
783 if(nSlotId == SID_ATTR_CHAR_VERTICAL)
784 {
785 // Here, all items which need to be different from pool default need to be set
786 // again on the newly created text object.
787 // Since this is a simple click text object, it is first created, then SetVertical()
788 // is used, then ImpSetAttributesForNewTextObject is called and then the object is
789 // deleted again since not the minimum drag distance was travelled. Then, a new
790 // click text object is created and thus all that stuff needs to be set again here.
791
792 // Before using the new object the vertical writing mode
793 // needs to be set. This is done here at the OutlinerParaObject
794 // directly to not mirror the layout text items involved. These items will be set
795 // below.
797
798 if(!pPara)
799 {
802 }
803
804 if(pPara && !pPara->IsEffectivelyVertical())
805 {
806 // set ParaObject orientation accordingly
807 pPara->SetVertical(true);
808 }
809
811
812 // Analog to the else case below, for vertical simple click texts
813 // one of the default set items from ImpSetAttributesForNewTextObject
814 // needs to be adapted to non-block mode.
816 SvxFrameDirection eDirection = rSet.Get(EE_PARA_WRITINGDIR).GetValue();
817
818 if(SvxFrameDirection::Horizontal_RL_TB == eDirection || SvxFrameDirection::Vertical_RL_TB == eDirection)
819 {
821 }
822 else
823 {
825 }
826 }
827 else
828 {
829 // This is for Format/Page settings. Since this also leads
830 // to the object defaults to be changed, i think this code can be
831 // removed. CL. wanted to take a look before adding this.
832
833 // Look in the object defaults if left-to-right is wanted. If
834 // yes, set text anchoring to right to let the box grow to left.
836 SvxFrameDirection eDirection = rSet.Get(EE_PARA_WRITINGDIR).GetValue();
837
838 if(SvxFrameDirection::Horizontal_RL_TB == eDirection)
839 {
841 }
842 else
843 {
845 }
846 }
847
850 SetInEditMode(rMEvt, false);
851 }
852
853 bFirstObjCreated = true;
854 }
855 else
856 {
857 // switch to selection
858 if (mpView->SdrEndTextEdit() == SdrEndTextEditKind::Deleted)
859 {
860 mxTextObj = nullptr;
861 }
862
863 mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_OBJECT_SELECT,
864 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
865 }
866 }
867 if (bJustEndedEdit)
868 {
869 bJustEndedEdit = false;
871 }
872 bMBDown = false;
874 return bReturn;
875}
876
881bool FuText::KeyInput(const KeyEvent& rKEvt)
882{
883 bool bReturn = false;
884
885 vcl::KeyCode nCode = rKEvt.GetKeyCode();
886 bool bShift = nCode.IsShift();
887
888 if(mxTextObj.get().is())
889 {
890 // maybe object is deleted, test if it's equal to the selected object
891 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
892 SdrObject* pSelectedObj = nullptr;
893
894 if(1 == rMarkList.GetMarkCount())
895 {
896 SdrMark* pMark = rMarkList.GetMark(0);
897 pSelectedObj = pMark->GetMarkedSdrObj();
898 }
899
900 if(mxTextObj.get().get() != pSelectedObj)
901 {
902 mxTextObj = nullptr;
903 }
904 }
905
906 if (auto pTextObj = mxTextObj.get())
907 if ( pTextObj->GetObjInventor() == SdrInventor::Default && pTextObj->GetObjIdentifier() == SdrObjKind::TitleText && rKEvt.GetKeyCode().GetCode() == KEY_RETURN )
908 {
909 // title text object: always soft breaks
910 bShift = true;
911 }
912
913 sal_uInt16 nKey = nCode.GetCode();
914 vcl::KeyCode aKeyCode (nKey, bShift, nCode.IsMod1(), nCode.IsMod2(), nCode.IsMod3() );
915 KeyEvent aKEvt(rKEvt.GetCharCode(), aKeyCode);
916
917 bool bOK = true;
918
919 if (mpDocSh->IsReadOnly())
920 {
921 bOK = !EditEngine::DoesKeyChangeText(aKEvt);
922 }
923 if( aKeyCode.GetCode() == KEY_PAGEUP || aKeyCode.GetCode() == KEY_PAGEDOWN )
924 {
925 bOK = false; // default handling in base class
926 }
927
928 if (bOK && mpView->KeyInput(aKEvt, mpWindow) )
929 {
930 bReturn = true;
931
933
934 }
935 else if (aKeyCode == KEY_ESCAPE)
936 {
937 bReturn = cancel();
938 }
939
940 if( bPermanent )
941 {
942 mpView->SetCurrentObj(SdrObjKind::Text);
943 mpView->SetEditMode(SdrViewEditMode::Create);
944 }
945
946 if (!bReturn)
947 {
948 bReturn = FuDraw::KeyInput(aKEvt);
949 }
950
951 return bReturn;
952}
953
955{
957
958 // #i89661# it's no longer necessary to make it so big here, it's fine tuned
959 // for text objects in SdrMarkView::CheckSingleSdrObjectHit
961
963
964 if (pOLV)
965 pOLV->ShowCursor(/*bGotoCursor=*/true, /*bActivate=*/true);
966
968
969 if( pOLV )
970 mpView->SetEditMode(SdrViewEditMode::Edit);
971}
972
974{
976
977 if (pOLV)
978 pOLV->HideCursor(/*bDeactivate=*/true);
979
981
983}
984
988void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag)
989{
991 if( mxTextObj.get().is() && (mxTextObj.get()->getSdrPageFromSdrObject() == pPV->GetPage()) )
992 {
993 mpView->SetCurrentObj(SdrObjKind::Text);
994
995 if( bPermanent )
996 mpView->SetEditMode(SdrViewEditMode::Create);
997 else
998 mpView->SetEditMode(SdrViewEditMode::Edit);
999
1000 bool bEmptyOutliner = false;
1001
1002 if (!GetTextObj()->GetOutlinerParaObject() && mpView->GetTextEditOutliner())
1003 {
1005 sal_Int32 nParagraphCnt = pOutl->GetParagraphCount();
1006 Paragraph* p1stPara = pOutl->GetParagraph( 0 );
1007
1008 if (nParagraphCnt==1 && p1stPara)
1009 {
1010 // with only one paragraph
1011 if (pOutl->GetText(p1stPara).isEmpty())
1012 {
1013 bEmptyOutliner = true;
1014 }
1015 }
1016 }
1017
1018 if (GetTextObj() != mpView->GetTextEditObject() || bEmptyOutliner)
1019 {
1021 SdrInventor nInv = pTextObj->GetObjInventor();
1022 SdrObjKind nSdrObjKind = pTextObj->GetObjIdentifier();
1023
1024 if (nInv == SdrInventor::Default && GetTextObj()->HasTextEdit() &&
1025 (nSdrObjKind == SdrObjKind::Text ||
1026 nSdrObjKind == SdrObjKind::TitleText ||
1027 nSdrObjKind == SdrObjKind::OutlineText || !pTextObj->IsEmptyPresObj() ) )
1028 {
1029 // create new outliner (owned by SdrObjEditView)
1030 std::unique_ptr<SdrOutliner> pOutl = SdrMakeOutliner(OutlinerMode::OutlineObject, *mpDoc);
1031
1032 if (bEmptyOutliner)
1033 mpView->SdrEndTextEdit(true);
1034
1035 pTextObj = GetTextObj();
1036 if( pTextObj )
1037 {
1038 OutlinerParaObject* pOPO = pTextObj->GetOutlinerParaObject();
1039 if( pOPO && pOPO->IsEffectivelyVertical() )
1040 {
1041 pOutl->SetVertical(pOPO->GetVertical());
1042 pOutl->SetRotation(pOPO->GetRotation());
1043 }
1044 else if (nSlotId == SID_ATTR_CHAR_VERTICAL || nSlotId == SID_TEXT_FITTOSIZE_VERTICAL)
1045 pOutl->SetVertical( true );
1046
1047 if( pTextObj->getTextCount() > 1 )
1048 {
1049 Point aPix(rMEvt.GetPosPixel());
1050 Point aPnt(mpWindow->PixelToLogic(aPix));
1051 pTextObj->setActiveText( pTextObj->CheckTextHit(aPnt ) );
1052 }
1053
1054 if (mpView->SdrBeginTextEdit(pTextObj.get(), pPV, mpWindow, true, pOutl.release()) && mxTextObj.get()->GetObjInventor() == SdrInventor::Default)
1055 {
1056 //tdf#102293 flush overlay before going on to pass clicks down to
1057 //the outline view which will want to paint selections
1058 for (sal_uInt32 b = 0; b < pPV->PageWindowCount(); ++b)
1059 {
1060 const SdrPageWindow& rPageWindow = *pPV->GetPageWindow(b);
1061 if (!rPageWindow.GetPaintWindow().OutputToWindow())
1062 continue;
1064 if (!xManager.is())
1065 continue;
1066 xManager->flush();
1067 }
1068
1069 bFirstObjCreated = true;
1071
1073
1074 nSdrObjKind = mxTextObj.get()->GetObjIdentifier();
1075
1076 SdrViewEvent aVEvt;
1077 SdrHitKind eHit = mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
1078
1079 if (eHit == SdrHitKind::TextEdit)
1080 {
1081 // hit text
1082 if (nSdrObjKind == SdrObjKind::Text ||
1083 nSdrObjKind == SdrObjKind::TitleText ||
1084 nSdrObjKind == SdrObjKind::OutlineText ||
1085 nSdrObjKind == SdrObjKind::Table ||
1086 nSlotId == SID_TEXTEDIT ||
1087 !bQuickDrag)
1088 {
1089 pOLV->MouseButtonDown(rMEvt);
1090 pOLV->MouseMove(rMEvt);
1091 pOLV->MouseButtonUp(rMEvt);
1092 }
1093
1094 if (mpViewShell->GetFrameView()->IsQuickEdit() && bQuickDrag && GetTextObj()->GetOutlinerParaObject())
1095 {
1096 pOLV->MouseButtonDown(rMEvt);
1097 }
1098 }
1099 else
1100 {
1101 // Move cursor to end of text
1103 if (pOLV != nullptr)
1105 }
1106 }
1107 else
1108 {
1110 }
1111 }
1112 }
1113 }
1114 }
1115 else
1116 {
1117 mxTextObj = nullptr;
1118 }
1119}
1120
1125{
1126 if ( !(mxTextObj.get().is() && mxTextObj.get()->IsEmptyPresObj()) )
1127 return;
1128
1129 SdPage* pPage = static_cast<SdPage*>( mxTextObj.get()->getSdrPageFromSdrObject() );
1130
1131 if (!pPage)
1132 return;
1133
1134 PresObjKind ePresObjKind = pPage->GetPresObjKind(mxTextObj.get().get());
1135
1136 if ( !(ePresObjKind == PresObjKind::Title ||
1137 ePresObjKind == PresObjKind::Outline ||
1138 ePresObjKind == PresObjKind::Notes ||
1139 ePresObjKind == PresObjKind::Text ) ||
1140 pPage->IsMasterPage() )
1141 return;
1142
1143 ::Outliner* pOutliner = mpView->GetTextEditOutliner();
1144 SfxStyleSheet* pSheet = pOutliner->GetStyleSheet( 0 );
1145 bool bIsUndoEnabled = pOutliner->IsUndoEnabled();
1146 if( bIsUndoEnabled )
1147 pOutliner->EnableUndo(false);
1148
1149 pOutliner->SetText( OUString(), pOutliner->GetParagraph( 0 ) );
1150
1151 if( bIsUndoEnabled )
1152 pOutliner->EnableUndo(true);
1153
1154 if (pSheet &&
1155 (ePresObjKind == PresObjKind::Notes || ePresObjKind == PresObjKind::Text))
1156 pOutliner->SetStyleSheet(0, pSheet);
1157
1158 mxTextObj.get()->SetEmptyPresObj(true);
1159}
1160
1162{
1163 bool bReturn = false;
1164
1166
1168 mxTextObj.get().is() && pOLV && pOLV->GetFieldUnderMousePointer())
1169 {
1170 OUString aHelpText;
1171 const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer();
1172 const SvxFieldData* pField = pFieldItem->GetField();
1173
1174 if (auto pURLField = dynamic_cast< const SvxURLField *>( pField ))
1175 {
1176 // URL-Field
1177 aHelpText = INetURLObject::decode( pURLField->GetURL(), INetURLObject::DecodeMechanism::WithCharset );
1178 }
1179 if (!aHelpText.isEmpty())
1180 {
1181 ::tools::Rectangle aLogicPix = mpWindow->LogicToPixel(mxTextObj.get()->GetLogicRect());
1182 ::tools::Rectangle aScreenRect(mpWindow->OutputToScreenPixel(aLogicPix.TopLeft()),
1183 mpWindow->OutputToScreenPixel(aLogicPix.BottomRight()));
1184
1186 {
1187 Help::ShowBalloon( static_cast<vcl::Window*>(mpWindow), rHEvt.GetMousePosPixel(), aScreenRect, aHelpText);
1188 bReturn = true;
1189 }
1190 else if (Help::IsQuickHelpEnabled())
1191 {
1192 Help::ShowQuickHelp( static_cast<vcl::Window*>(mpWindow), aScreenRect, aHelpText);
1193 bReturn = true;
1194 }
1195 }
1196 }
1197
1198 if (!bReturn)
1199 {
1200 bReturn = FuConstruct::RequestHelp(rHEvt);
1201 }
1202
1203 return bReturn;
1204}
1205
1207{
1208 nSlotId = rReq.GetSlot();
1209
1210 // then we call the base class (besides others, nSlotId is NOT set there)
1212
1213 if (!(nSlotId == SID_TEXTEDIT || mpViewShell->GetFrameView()->IsQuickEdit() || SID_ATTR_CHAR == nSlotId))
1214 return;
1215
1216 MouseEvent aMEvt(mpWindow->GetPointerPosPixel());
1217
1218 mxTextObj = nullptr;
1219
1220 if (nSlotId == SID_TEXTEDIT)
1221 {
1222 // are we currently editing?
1224
1225 if (!mxTextObj.get().is())
1226 {
1227 // Try to select an object
1229 SdrViewEvent aVEvt;
1230 mpView->PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
1231 mpView->MarkObj(aVEvt.mpRootObj, pPV);
1232
1233 if (auto pSdrTextObj = DynCastSdrTextObj(aVEvt.mpObj))
1234 {
1235 mxTextObj = pSdrTextObj;
1236 }
1237 }
1238 }
1239 else if (mpView->AreObjectsMarked())
1240 {
1241 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
1242
1243 if (rMarkList.GetMarkCount() == 1)
1244 {
1245 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
1246
1247 if( auto pTextObj = DynCastSdrTextObj( pObj ))
1248 {
1249 mxTextObj = pTextObj;
1250 }
1251 }
1252 }
1253
1254 bool bQuickDrag = true;
1255
1256 const SfxItemSet* pArgs = rReq.GetArgs();
1257
1258 if (pArgs
1259
1260 // test for type before using
1261 && SID_TEXTEDIT == nSlotId
1262 && SfxItemState::SET == pArgs->GetItemState(SID_TEXTEDIT)
1263
1264 && pArgs->Get(SID_TEXTEDIT).GetValue() == 2)
1265 {
1266 // selection with double click -> do not allow QuickDrag
1267 bQuickDrag = false;
1268 }
1269
1270 SetInEditMode(aMEvt, bQuickDrag);
1271}
1272
1274{
1275 // Nothing to do
1276}
1277
1281rtl::Reference<SdrObject> FuText::CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle& rRectangle)
1282{
1287 nullptr) );
1288
1289 if(pObj)
1290 {
1291 if( auto pText = DynCastSdrTextObj( pObj.get() ) )
1292 {
1293 pText->SetLogicRect(rRectangle);
1294
1295 bool bVertical = (SID_ATTR_CHAR_VERTICAL == nID || SID_TEXT_FITTOSIZE_VERTICAL == nID);
1296 pText->SetVerticalWriting(bVertical);
1297
1299
1300 if (nSlotId == SID_TEXT_FITTOSIZE)
1301 {
1303 }
1304 else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
1305 {
1307 }
1308
1309 // Put text object into edit mode.
1311 mpView->SdrBeginTextEdit(pText, pPV);
1312 }
1313 else
1314 {
1315 OSL_FAIL("Object is NO text object");
1316 }
1317 }
1318
1319 return pObj;
1320}
1321
1329{
1330 if ( mpView->IsTextEdit() )
1331 {
1332 if(mpView->SdrEndTextEdit() == SdrEndTextEditKind::Deleted)
1333 mxTextObj = nullptr;
1334
1335 mpView->SetCurrentObj(SdrObjKind::Text);
1336 mpView->SetEditMode(SdrViewEditMode::Edit);
1337 return true;
1338 }
1339 else
1340 {
1341 return false;
1342 }
1343}
1344
1345void FuText::ChangeFontSize( bool bGrow, OutlinerView* pOLV, const FontList* pFontList, ::sd::View* pView )
1346{
1347 if( !pFontList || !pView )
1348 return;
1349
1350 if( pOLV )
1351 {
1352 pOLV->GetEditView().ChangeFontSize( bGrow, pFontList );
1353 }
1354 else
1355 {
1356
1357 pView->BegUndo(SdResId(bGrow ? STR_GROW_FONT_SIZE : STR_SHRINK_FONT_SIZE));
1358 const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
1359 for( size_t nMark = 0; nMark < rMarkList.GetMarkCount(); ++nMark )
1360 {
1361 SdrTextObj* pTextObj = DynCastSdrTextObj( rMarkList.GetMark(nMark)->GetMarkedSdrObj() );
1362 if( pTextObj )
1363 {
1365 if (xSelectionController.is() && xSelectionController->ChangeFontSize(bGrow, pFontList))
1366 {
1367 continue;
1368 }
1369 for( sal_Int32 nText = 0; nText < pTextObj->getTextCount(); nText++ )
1370 {
1371 pTextObj->setActiveText( nText );
1372
1373 // Put text object into edit mode.
1374 SdrPageView* pPV = pView->GetSdrPageView();
1375 pView->SdrBeginTextEdit(pTextObj, pPV);
1376
1377 pOLV = pView->GetTextEditOutlinerView();
1378 if( pOLV )
1379 {
1380 EditEngine* pEditEngine = pOLV->GetEditView().GetEditEngine();
1381 if( pEditEngine )
1382 {
1383 ESelection aSel;
1384 aSel.nEndPara = pEditEngine->GetParagraphCount()-1;
1385 aSel.nEndPos = pEditEngine->GetTextLen(aSel.nEndPara);
1386 pOLV->SetSelection(aSel);
1387 }
1388
1389 ChangeFontSize( bGrow, pOLV, pFontList, pView );
1390 }
1391
1392 pView->SdrEndTextEdit();
1393 }
1394
1395 SfxItemSet aShapeSet( pTextObj->GetMergedItemSet() );
1396 if( EditView::ChangeFontSize( bGrow, aShapeSet, pFontList ) )
1397 {
1398 pTextObj->SetObjectItemNoBroadcast( aShapeSet.Get( EE_CHAR_FONTHEIGHT ) );
1399 pTextObj->SetObjectItemNoBroadcast( aShapeSet.Get( EE_CHAR_FONTHEIGHT_CJK ) );
1400 pTextObj->SetObjectItemNoBroadcast( aShapeSet.Get( EE_CHAR_FONTHEIGHT_CTL ) );
1401 }
1402 }
1403 }
1404 pView->EndUndo();
1405 }
1406}
1407
1409{
1411}
1412
1413
1414} // end of namespace sd
1415
1416/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr) override
virtual void MovAction(const Point &rPnt) override
sal_Int32 GetParagraphCount() const
sal_Int32 GetTextLen() const
static bool DoesKeyChangeText(const KeyEvent &rKeyEvent)
void ChangeFontSize(bool bGrow, const FontList *pList)
EditEngine * GetEditEngine() const
bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
virtual bool MouseButtonDown(const MouseEvent &_rMEvt, OutputDevice *_pWin) override
const Point & GetMousePosPixel() const
static bool IsQuickHelpEnabled()
static bool IsBalloonHelpEnabled()
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
bool IsMod1() const
bool IsMod2() const
sal_uInt16 GetClicks() const
bool IsRight() const
const Point & GetPosPixel() const
bool IsLeft() const
bool IsShift() const
bool GetVertical() const
void SetVertical(bool bNew)
bool IsEffectivelyVertical() const
TextRotation GetRotation() const
bool MouseMove(const MouseEvent &)
void SetSelection(const ESelection &)
bool MouseButtonUp(const MouseEvent &)
void HideCursor(bool bDeactivate=false)
const SvxFieldItem * GetFieldUnderMousePointer() const
bool MouseButtonDown(const MouseEvent &)
EditView & GetEditView() const
void ShowCursor(bool bGotoCursor=true, bool bActivate=false)
void SetText(const OutlinerParaObject &)
OUString GetText(Paragraph const *pPara, sal_Int32 nParaCount=1) const
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
bool IsUndoEnabled() const
void SetStyleSheetPool(SfxStyleSheetPool *pSPool)
SfxStyleSheet * GetStyleSheet(sal_Int32 nPara)
void EnableUndo(bool bEnable)
sal_Int32 GetParagraphCount() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
PresObjKind GetPresObjKind(SdrObject *pObj) const
Definition: sdpage.cxx:2309
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
bool IsCreateObj() const
void SetEditMode(SdrViewEditMode eMode)
bool EndCreateObj(SdrCreateCmd eCmd)
SdrInventor GetCurrentObjInventor() const
SdrObjKind GetCurrentObjIdentifier() const
virtual bool IsAction() const override
void SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent=SdrInventor::Default)
SdrObject * GetCreateObj() const
virtual void EndAction() override
bool EndDragObj(bool bCopy=false)
sal_Int32 GetDragThresholdPixels() const
bool IsDragWithCopy() const
void SetDragWithCopy(bool bOn)
bool IsDragObj() const
void BegUndo()
void ForceMarkedToAnotherPage()
void EndUndo()
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
void SetDragMode(SdrDragMode eMode)
SdrHdl * PickHandle(const Point &rPnt) const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
SfxStyleSheetBasePool * GetStyleSheetPool() const
SdrTextObj * GetTextEditObject() const
const OutlinerView * GetTextEditOutlinerView() const
const rtl::Reference< sdr::SelectionController > & getSelectionController() const
virtual bool IsTextEdit() const final override
void SetQuickTextEditMode(bool bOn)
const SdrOutliner * GetTextEditOutliner() const
static rtl::Reference< SdrObject > MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
virtual SdrInventor GetObjInventor() const
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
virtual SdrObjKind GetObjIdentifier() const
const SfxItemSet & GetMergedItemSet() const
bool IsObjMarkable(SdrObject const *pObj) const
sal_uInt32 PageWindowCount() const
SdrPage * GetPage() const
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
SdrPaintWindow & GetPaintWindow() const
bool IsMasterPage() const
const SfxItemSet & GetDefaultAttr() const
SdrModel & getSdrModelFromSdrView() const
void SetHitTolerancePixel(sal_uInt16 nVal)
SdrPageView * GetSdrPageView() const
sal_uInt16 getHitTolLog() const
bool OutputToWindow() const
void SetSnapEnabled(bool bOn)
bool IsSnapEnabled() const
virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle &rR, bool bHgt=true, bool bWdt=true) const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
void SetText(const OUString &rStr)
virtual sal_Int32 getTextCount() const override
virtual void setActiveText(sal_Int32 nIndex)
void ForceOutlinerParaObject()
void SetDisableAutoWidthOnDragging(bool bOn)
void SetObjectItemNoBroadcast(const SfxPoolItem &rItem)
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
SdrHitKind PickAnything(const MouseEvent &rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent &rVEvt) const
void UnmarkAll()
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
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 * >())
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const OUString & GetName() const
bool IsReadOnly() const
SfxMedium * GetMedium() const
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
SfxItemPool & GetPool() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
bool isLOKMobilePhone() const
bool isLOKTablet() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
const SvxFieldData * GetField() const
const OUString & GetURL() const
bool IsActive() const
void Stop()
virtual void Start(bool bStartTimer=true) override
View for MDIFrame.
Definition: FrameView.hxx:36
bool IsQuickEdit() const
Definition: FrameView.hxx:124
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: fuconstr.cxx:128
virtual void Deactivate() override
deactivates the function
Definition: fuconstr.cxx:227
virtual void Activate() override
activates the function
Definition: fuconstr.cxx:221
bool IsIgnoreUnexpectedMouseButtonUp()
Definition: fuconstr.cxx:233
virtual bool KeyInput(const KeyEvent &rKEvt) override
Process keyboard input.
Definition: fudraw.cxx:317
bool bPermanent
Definition: fudraw.hxx:76
virtual bool RequestHelp(const HelpEvent &rHEvt) override
Definition: fudraw.cxx:681
bool bMBDown
Definition: fudraw.hxx:73
virtual bool MouseMove(const MouseEvent &rMEvt) override
Definition: fudraw.cxx:214
virtual void ForcePointer(const MouseEvent *pMEvt=nullptr)
Toggle mouse-pointer.
Definition: fudraw.cxx:450
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: fudraw.cxx:141
SdDrawDocument * mpDoc
Definition: fupoor.hxx:148
VclPtr< ::sd::Window > mpWindow
Definition: fupoor.hxx:146
Point aMDPos
position of MouseButtonDown
Definition: fupoor.hxx:159
ViewShell * mpViewShell
Definition: fupoor.hxx:145
sal_uInt16 nSlotId
Definition: fupoor.hxx:150
void ForceScroll(const Point &aPixPos)
scroll when approached the border of the window; is called by MouseMove
Definition: fupoor.cxx:121
virtual void ReceiveRequest(SfxRequest &rReq)
Definition: fupoor.cxx:1008
bool bIsInDragMode
Definition: fupoor.hxx:158
Timer aDragTimer
for Drag&Drop
Definition: fupoor.hxx:156
DrawDocShell * mpDocSh
Definition: fupoor.hxx:147
::sd::View * mpView
Definition: fupoor.hxx:144
virtual bool cancel()
is called when the current function should be aborted.
Definition: fupoor.cxx:1070
static const int HITPIX
Definition: fupoor.hxx:50
bool bFirstMouseMove
Definition: fupoor.hxx:168
SdrTextObj * GetTextObj()
Definition: futext.hxx:55
virtual void DoubleClick(const MouseEvent &rMEvt) override
Response of doubleclick.
Definition: futext.cxx:1273
void InvalidateBindings()
Definition: futext.cxx:1408
void ImpSetAttributesFitToSizeVertical(SdrTextObj *pTxtObj)
Definition: futext.cxx:554
virtual rtl::Reference< SdrObject > CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle &rRectangle) override
Removed the insertion of default text and putting a new text object directly into edit mode.
Definition: futext.cxx:1281
virtual void Activate() override
activates the function
Definition: futext.cxx:954
SfxRequest & rRequest
Definition: futext.hxx:87
virtual void disposing() override
Definition: futext.cxx:151
void ImpSetAttributesFitToSize(SdrTextObj *pTxtObj)
Definition: futext.cxx:543
virtual bool MouseMove(const MouseEvent &rMEvt) override
Definition: futext.cxx:484
bool bFirstObjCreated
Definition: futext.hxx:84
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: futext.cxx:246
void SetInEditMode(const MouseEvent &rMEvt, bool bQuickDrag)
Sets the object into the edit mode.
Definition: futext.cxx:988
bool bJustEndedEdit
Definition: futext.hxx:85
void ImpSetAttributesForNewTextObject(SdrTextObj *pTxtObj)
Definition: futext.cxx:510
::unotools::WeakReference< SdrTextObj > mxTextObj
Definition: futext.hxx:83
virtual bool RequestHelp(const HelpEvent &rHEvt) override
Definition: futext.cxx:1161
virtual bool KeyInput(const KeyEvent &rKEvt) override
handle keyboard events
Definition: futext.cxx:881
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: futext.cxx:564
virtual void Deactivate() override
deactivates the function
Definition: futext.cxx:973
virtual void ReceiveRequest(SfxRequest &rReq) override
Definition: futext.cxx:1206
virtual void DoExecute(SfxRequest &rReq) override
Definition: futext.cxx:180
static void ChangeFontSize(bool, OutlinerView *, const FontList *, ::sd::View *)
Definition: futext.cxx:1345
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: futext.cxx:145
void DeleteDefaultText()
Text entry is started, if necessary delete the default text.
Definition: futext.cxx:1124
FuText(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
base class for text functions
Definition: futext.cxx:137
virtual bool cancel() override
is called when the current function should be aborted.
Definition: futext.cxx:1328
std::shared_ptr< ToolBarManager > const & GetToolBarManager() const
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
FrameView * GetFrameView()
Definition: ViewShell.hxx:221
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
Definition: viewshel.cxx:1397
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
bool IsPresObjSelected(bool bOnPage=true, bool bOnMasterPage=true, bool bCheckPresObjListOnly=false, bool bCheckLayoutOnly=false) const
Is a presentation object selected?
Definition: sdview.cxx:523
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true) override
Definition: sdview.cxx:657
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
Definition: sdview.cxx:772
bool RestoreDefaultText(SdrTextObj *pTextObj)
restores the default text if the given text object is currently in edit mode and no text has been ent...
Definition: sdview.cxx:828
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
constexpr Point TopLeft() const
constexpr Point BottomRight() const
rtl::Reference< interface_type > SAL_CALL get() const
bool IsMod1() const
sal_uInt16 GetCode() const
bool IsShift() const
bool IsMod2() const
bool IsMod3() const
ESelection aNewSelection(GetSelection())
#define EE_PARA_NOT_FOUND
#define EE_INDEX_NOT_FOUND
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
SvxFrameDirection
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_PAGEUP
const sal_uInt16 SidArray[]
Definition: fuoltext.cxx:43
PresObjKind
Definition: pres.hxx:22
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
SDRTEXTVERTADJUST_BOTTOM
SDRTEXTVERTADJUST_BLOCK
SDRTEXTVERTADJUST_TOP
SDRTEXTHORZADJUST_LEFT
SDRTEXTHORZADJUST_RIGHT
SdrMetricItem makeSdrTextMinFrameHeightItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextMinFrameWidthItem(tools::Long mnWidth)
static SfxItemSet & rSet
sal_Int32 nEndPos
sal_Int32 nEndPara
SdrObject * mpObj
SdrHdl * mpHdl
const SvxURLField * mpURLField
SdrEventKind meEvent
SdrObject * mpRootObj
SVXCORE_DLLPUBLIC std::unique_ptr< SdrOutliner > SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel &rMod)
SdrHitKind
SdrInventor
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
SdrObjKind