LibreOffice Module sc (master)  1
AccessibleText.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 <scitems.hxx>
21 #include <editeng/eeitem.hxx>
22 
23 #include <memory>
24 #include <AccessibleText.hxx>
25 #include <AccessibleCell.hxx>
26 #include <attrib.hxx>
27 #include <tabvwsh.hxx>
28 #include <editutil.hxx>
29 #include <document.hxx>
30 #include <scmod.hxx>
31 #include <prevwsh.hxx>
32 #include <docsh.hxx>
33 #include <prevloc.hxx>
34 #include <patattr.hxx>
35 #include <inputwin.hxx>
36 #include <editeng/unofored.hxx>
37 #include <editeng/editview.hxx>
38 #include <editeng/unoedhlp.hxx>
39 #include <editeng/fhgtitem.hxx>
40 #include <editeng/adjustitem.hxx>
41 #include <editeng/justifyitem.hxx>
42 #include <svx/svdmodel.hxx>
43 #include <svx/algitem.hxx>
44 #include <vcl/svapp.hxx>
45 
47 {
50 public:
51  ScViewForwarder(ScTabViewShell* pViewShell, ScSplitPos eSplitPos);
52 
53  virtual bool IsValid() const override;
54  virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
55  virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
56 
57  void SetInvalid();
58 };
59 
61  :
62  mpViewShell(pViewShell),
63  meSplitPos(eSplitPos)
64 {
65 }
66 
68 {
69  return mpViewShell != nullptr;
70 }
71 
72 Point ScViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
73 {
74  if (mpViewShell)
75  {
77  if (pWindow)
78  return pWindow->LogicToPixel( rPoint, rMapMode );
79  }
80  else
81  {
82  OSL_FAIL("this ViewForwarder is not valid");
83  }
84  return Point();
85 }
86 
87 Point ScViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const
88 {
89  if (mpViewShell)
90  {
92  if (pWindow)
93  return pWindow->PixelToLogic( rPoint, rMapMode );
94  }
95  else
96  {
97  OSL_FAIL("this ViewForwarder is not valid");
98  }
99  return Point();
100 }
101 
103 {
104  mpViewShell = nullptr;
105 }
106 
108 {
110  // #i49561# EditView needed for access to its visible area.
112 public:
114  const EditView* _pEditView);
115 
116  virtual bool IsValid() const override;
117  virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
118  virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
119 
120  void SetInvalid();
121 };
122 
124  const EditView* _pEditView )
125  : mpWindow(pWindow)
126  , mpEditView( _pEditView )
127 {
128 }
129 
131 {
132  return (mpWindow != nullptr);
133 }
134 
135 Point ScEditObjectViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
136 {
137  if (mpWindow)
138  {
139  // #i49561# - consider offset of the visible area
140  // of the EditView before converting point to pixel.
141  Point aPoint( rPoint );
142  if ( mpEditView )
143  {
144  tools::Rectangle aEditViewVisArea( mpEditView->GetVisArea() );
145  aPoint += aEditViewVisArea.TopLeft();
146  }
147  return mpWindow->LogicToPixel( aPoint, rMapMode );
148  }
149  else
150  {
151  OSL_FAIL("this ViewForwarder is not valid");
152  }
153  return Point();
154 }
155 
156 Point ScEditObjectViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const
157 {
158  if (mpWindow)
159  {
160  // #i49561# - consider offset of the visible area
161  // of the EditView after converting point to logic.
162  Point aPoint( mpWindow->PixelToLogic( rPoint, rMapMode ) );
163  if ( mpEditView )
164  {
165  tools::Rectangle aEditViewVisArea( mpEditView->GetVisArea() );
166  aPoint -= aEditViewVisArea.TopLeft();
167  }
168  return aPoint;
169  }
170  else
171  {
172  OSL_FAIL("this ViewForwarder is not valid");
173  }
174  return Point();
175 }
176 
178 {
179  mpWindow = nullptr;
180 }
181 
183 {
184 protected:
186 public:
187  explicit ScPreviewViewForwarder(ScPreviewShell* pViewShell);
188 
189  virtual bool IsValid() const override;
190  virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
191  virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
192 
193  void SetInvalid();
194 };
195 
197  : mpViewShell(pViewShell)
198 {
199 }
200 
202 {
203  return mpViewShell != nullptr;
204 }
205 
206 Point ScPreviewViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
207 {
208  if (mpViewShell)
209  {
210  vcl::Window* pWindow = mpViewShell->GetWindow();
211  if (pWindow)
212  {
213  MapMode aMapMode(pWindow->GetMapMode().GetMapUnit());
214  Point aPoint2( OutputDevice::LogicToLogic( rPoint, rMapMode, aMapMode) );
215  return pWindow->LogicToPixel(aPoint2);
216  }
217  }
218  else
219  {
220  OSL_FAIL("this ViewForwarder is not valid");
221  }
222  return Point();
223 }
224 
225 Point ScPreviewViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const
226 {
227  if (mpViewShell)
228  {
229  vcl::Window* pWindow = mpViewShell->GetWindow();
230  if (pWindow)
231  {
232  MapMode aMapMode(pWindow->GetMapMode());
233  aMapMode.SetOrigin(Point());
234  Point aPoint1( pWindow->PixelToLogic( rPoint ) );
235  Point aPoint2( OutputDevice::LogicToLogic( aPoint1,
236  MapMode(aMapMode.GetMapUnit()),
237  rMapMode ) );
238  return aPoint2;
239  }
240  }
241  else
242  {
243  OSL_FAIL("this ViewForwarder is not valid");
244  }
245  return Point();
246 }
247 
249 {
250  mpViewShell = nullptr;
251 }
252 
253 namespace {
254 
255 class ScPreviewHeaderFooterViewForwarder : public ScPreviewViewForwarder
256 {
257 public:
258  ScPreviewHeaderFooterViewForwarder(ScPreviewShell* pViewShell);
259 };
260 
261 }
262 
263 ScPreviewHeaderFooterViewForwarder::ScPreviewHeaderFooterViewForwarder(ScPreviewShell* pViewShell)
264  :
265  ScPreviewViewForwarder(pViewShell)
266 {
267 }
268 
269 namespace {
270 
271 class ScPreviewCellViewForwarder : public ScPreviewViewForwarder
272 {
273 public:
274  ScPreviewCellViewForwarder(ScPreviewShell* pViewShell);
275 };
276 
277 }
278 
279 ScPreviewCellViewForwarder::ScPreviewCellViewForwarder(ScPreviewShell* pViewShell)
280  :
281  ScPreviewViewForwarder(pViewShell)
282 {
283 }
284 
285 namespace {
286 
287 class ScPreviewHeaderCellViewForwarder : public ScPreviewViewForwarder
288 {
289 public:
290  ScPreviewHeaderCellViewForwarder(ScPreviewShell* pViewShell);
291 };
292 
293 }
294 
295 ScPreviewHeaderCellViewForwarder::ScPreviewHeaderCellViewForwarder(ScPreviewShell* pViewShell)
296  :
297  ScPreviewViewForwarder(pViewShell)
298 {
299 }
300 
301 namespace {
302 
303 class ScPreviewNoteViewForwarder : public ScPreviewViewForwarder
304 {
305 public:
306  ScPreviewNoteViewForwarder(ScPreviewShell* pViewShell);
307 };
308 
309 }
310 
311 ScPreviewNoteViewForwarder::ScPreviewNoteViewForwarder(ScPreviewShell* pViewShell)
312  :
313  ScPreviewViewForwarder(pViewShell)
314 {
315 }
316 
318 {
321 public:
322  ScEditViewForwarder(EditView* pEditView, OutputDevice* pWin);
323 
324  virtual bool IsValid() const override;
325  virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
326  virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
327  virtual bool GetSelection( ESelection& rSelection ) const override;
328  virtual bool SetSelection( const ESelection& rSelection ) override;
329  virtual bool Copy() override;
330  virtual bool Cut() override;
331  virtual bool Paste() override;
332 
333  void SetInvalid();
334 };
335 
337  : mpEditView(pEditView)
338  , mpWindow(pWin)
339 {
340 }
341 
343 {
344  return mpWindow && mpEditView;
345 }
346 
347 Point ScEditViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
348 {
349  if (mpWindow)
350  return mpWindow->LogicToPixel( rPoint, rMapMode );
351  else
352  {
353  OSL_FAIL("this ViewForwarder is not valid");
354  }
355  return Point();
356 }
357 
358 Point ScEditViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const
359 {
360  if (mpWindow)
361  return mpWindow->PixelToLogic( rPoint, rMapMode );
362  else
363  {
364  OSL_FAIL("this ViewForwarder is not valid");
365  }
366  return Point();
367 }
368 
370 {
371  bool bResult(false);
372  if (IsValid())
373  {
374  rSelection = mpEditView->GetSelection();
375  bResult = true;
376  }
377  else
378  {
379  OSL_FAIL("this ViewForwarder is not valid");
380  }
381  return bResult;
382 }
383 
385 {
386  bool bResult(false);
387  if (IsValid())
388  {
389  mpEditView->SetSelection(rSelection);
390  bResult = true;
391  }
392  else
393  {
394  OSL_FAIL("this ViewForwarder is not valid");
395  }
396  return bResult;
397 }
398 
400 {
401  bool bResult(false);
402  if (IsValid())
403  {
404  mpEditView->Copy();
405  bResult = true;
406  }
407  else
408  {
409  OSL_FAIL("this ViewForwarder is not valid");
410  }
411  return bResult;
412 }
413 
415 {
416  bool bResult(false);
417  if (IsValid())
418  {
419  mpEditView->Cut();
420  bResult = true;
421  }
422  else
423  {
424  OSL_FAIL("this ViewForwarder is not valid");
425  }
426  return bResult;
427 }
428 
430 {
431  bool bResult(false);
432  if (IsValid())
433  {
434  mpEditView->Paste();
435  bResult = true;
436  }
437  else
438  {
439  OSL_FAIL("this ViewForwarder is not valid");
440  }
441  return bResult;
442 }
443 
445 {
446  mpWindow = nullptr;
447  mpEditView = nullptr;
448 }
449 
450 // ScAccessibleCellTextData: shared data between sub objects of an accessible cell text object
451 
453  const ScAddress& rP, ScSplitPos eSplitPos, ScAccessibleCell* pAccCell)
454  : ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP),
455  mpViewShell(pViewShell),
456  meSplitPos(eSplitPos),
457  mpAccessibleCell( pAccCell )
458 {
459 }
460 
462 {
463  if (pEditEngine)
464  pEditEngine->SetNotifyHdl(Link<EENotify&,void>());
465  mpViewForwarder.reset();
466 }
467 
469 {
470  if ( rHint.GetId() == SfxHintId::Dying )
471  {
472  mpViewShell = nullptr; // invalid now
473  if (mpViewForwarder)
474  mpViewForwarder->SetInvalid();
475  }
477 }
478 
480 {
482 }
483 
485 {
486  ScCellTextData::GetTextForwarder(); // creates Forwarder and EditEngine
487 
488  if ( pDocShell && pEditEngine && mpViewShell )
489  {
490  ScDocument& rDoc = pDocShell->GetDocument();
491  tools::Long nSizeX, nSizeY;
493  aCellPos.Col(), aCellPos.Row(), nSizeX, nSizeY);
494 
495  Size aSize(nSizeX, nSizeY);
496 
497  // #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
498  tools::Long nIndent = 0;
499  const SvxHorJustifyItem* pHorJustifyItem = rDoc.GetAttr( aCellPos, ATTR_HOR_JUSTIFY );
500  SvxCellHorJustify eHorJust = pHorJustifyItem ? pHorJustifyItem->GetValue() : SvxCellHorJustify::Standard;
501  if ( eHorJust == SvxCellHorJustify::Left )
502  {
503  const ScIndentItem* pIndentItem = rDoc.GetAttr( aCellPos, ATTR_INDENT );
504  if ( pIndentItem )
505  {
506  nIndent = static_cast< tools::Long >( pIndentItem->GetValue() );
507  }
508  }
509 
510  const SvxMarginItem* pMarginItem = rDoc.GetAttr( aCellPos, ATTR_MARGIN );
511  ScViewData& rViewData = mpViewShell->GetViewData();
512  double nPPTX = rViewData.GetPPTX();
513  double nPPTY = rViewData.GetPPTY();
514  tools::Long nLeftM = ( pMarginItem ? static_cast< tools::Long >( ( pMarginItem->GetLeftMargin() + nIndent ) * nPPTX ) : 0 );
515  tools::Long nTopM = ( pMarginItem ? static_cast< tools::Long >( pMarginItem->GetTopMargin() * nPPTY ) : 0 );
516  tools::Long nRightM = ( pMarginItem ? static_cast< tools::Long >( pMarginItem->GetRightMargin() * nPPTX ) : 0 );
517  tools::Long nBottomM = ( pMarginItem ? static_cast< tools::Long >( pMarginItem->GetBottomMargin() * nPPTY ) : 0 );
518  tools::Long nWidth = aSize.getWidth() - nLeftM - nRightM;
519  aSize.setWidth( nWidth );
520  aSize.setHeight( aSize.getHeight() - nTopM - nBottomM );
521 
523  if ( pWin )
524  {
525  aSize = pWin->PixelToLogic( aSize, pEditEngine->GetRefMapMode() );
526  }
527 
528  /* #i19430# Gnopernicus reads text partly if it sticks out of the cell
529  boundaries. This leads to wrong results in cases where the cell text
530  is rotated, because rotation is not taken into account when calcu-
531  lating the visible part of the text. In these cases we will expand
532  the cell size passed as paper size to the edit engine. The function
533  accessibility::AccessibleStaticTextBase::GetParagraphBoundingBox()
534  (see svx/source/accessibility/AccessibleStaticTextBase.cxx) will
535  return the size of the complete text then, which is used to expand
536  the cell bounding box in ScAccessibleCell::GetBoundingBox()
537  (see sc/source/ui/Accessibility/AccessibleCell.cxx). */
538  const ScRotateValueItem* pItem = rDoc.GetAttr( aCellPos, ATTR_ROTATE_VALUE );
539  if( pItem && (pItem->GetValue() != 0_deg100) )
540  {
541  pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) );
542  tools::Long nTxtWidth = static_cast< tools::Long >( pEditEngine->CalcTextWidth() );
543  aSize.setWidth( std::max( aSize.getWidth(), nTxtWidth + 2 ) );
544  }
545  else
546  {
547  // #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
548  const ScLineBreakCell* pLineBreakItem = rDoc.GetAttr( aCellPos, ATTR_LINEBREAK );
549  bool bLineBreak = ( pLineBreakItem && pLineBreakItem->GetValue() );
550  if ( !bLineBreak )
551  {
552  tools::Long nTxtWidth = static_cast< tools::Long >( pEditEngine->CalcTextWidth() );
553  aSize.setWidth( ::std::max( aSize.getWidth(), nTxtWidth ) );
554  }
555  }
556 
557  pEditEngine->SetPaperSize( aSize );
558 
559  // #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
560  if ( eHorJust == SvxCellHorJustify::Standard && rDoc.HasValueData( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab() ) )
561  {
562  pEditEngine->SetDefaultItem( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) );
563  }
564 
565  Size aTextSize;
566  if ( pWin )
567  {
568  aTextSize = pWin->LogicToPixel( Size( pEditEngine->CalcTextWidth(), pEditEngine->GetTextHeight() ), pEditEngine->GetRefMapMode() );
569  }
570  tools::Long nTextWidth = aTextSize.Width();
571  tools::Long nTextHeight = aTextSize.Height();
572 
573  tools::Long nOffsetX = nLeftM;
574  tools::Long nDiffX = nTextWidth - nWidth;
575  if ( nDiffX > 0 )
576  {
577  switch ( eHorJust )
578  {
579  case SvxCellHorJustify::Right:
580  {
581  nOffsetX -= nDiffX;
582  }
583  break;
584  case SvxCellHorJustify::Center:
585  {
586  nOffsetX -= nDiffX / 2;
587  }
588  break;
589  default:
590  {
591  }
592  break;
593  }
594  }
595 
596  tools::Long nOffsetY = 0;
597  const SvxVerJustifyItem* pVerJustifyItem = rDoc.GetAttr( aCellPos, ATTR_VER_JUSTIFY );
598  SvxCellVerJustify eVerJust = ( pVerJustifyItem ? pVerJustifyItem->GetValue() : SvxCellVerJustify::Standard );
599  switch ( eVerJust )
600  {
601  case SvxCellVerJustify::Standard:
602  case SvxCellVerJustify::Bottom:
603  {
604  nOffsetY = nSizeY - nBottomM - nTextHeight;
605  }
606  break;
607  case SvxCellVerJustify::Center:
608  {
609  nOffsetY = ( nSizeY - nTopM - nBottomM - nTextHeight ) / 2 + nTopM;
610  }
611  break;
612  default:
613  {
614  nOffsetY = nTopM;
615  }
616  break;
617  }
618 
619  if ( mpAccessibleCell )
620  {
621  mpAccessibleCell->SetOffset( Point( nOffsetX, nOffsetY ) );
622  }
623 
624  pEditEngine->SetNotifyHdl( LINK(this, ScAccessibleCellTextData, NotifyHdl) );
625  }
626 
627  return pForwarder.get();
628 }
629 
631 {
632  if (!mpViewForwarder)
634  return mpViewForwarder.get();
635 }
636 
638 {
639  //#102219#; there should no EditViewForwarder be, because the cell is now readonly in this interface
640  return nullptr;
641 }
642 
643 IMPL_LINK(ScAccessibleTextData, NotifyHdl, EENotify&, aNotify, void)
644 {
645  ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( &aNotify );
646 
647  if (aHint)
648  GetBroadcaster().Broadcast(*aHint);
649 }
650 
652 {
653  ScDocShell* pDocSh = nullptr;
654  if (pViewShell)
655  pDocSh = pViewShell->GetViewData().GetDocShell();
656  return pDocSh;
657 }
658 
660  :
661  mpEditView(pEditView),
662  mpEditEngine(pEditView ? pEditView->GetEditEngine() : nullptr),
663  mpWindow(pWin)
664 {
665  // If the object is cloned, do NOT add notify hdl.
666  mbIsCloned = isClone;
667  if (mpEditEngine && !mbIsCloned)
669 }
670 
672 {
673  // If the object is cloned, do NOT set notify hdl.
674  if (mpEditEngine && !mbIsCloned)
676  mpViewForwarder.reset();
677  mpEditViewForwarder.reset();
678  mpForwarder.reset();
679 }
680 
682 {
683  if ( rHint.GetId() == SfxHintId::Dying )
684  {
685  mpWindow = nullptr;
686  mpEditView = nullptr;
687  mpEditEngine = nullptr;
688  mpForwarder.reset();
689  if (mpViewForwarder)
690  mpViewForwarder->SetInvalid();
692  mpEditViewForwarder->SetInvalid();
693  }
694  ScAccessibleTextData::Notify(rBC, rHint);
695 }
696 
698 {
699  // Add para to indicate the object is cloned
701 }
702 
704 {
705  if ((!mpForwarder && mpEditView) || (mpEditEngine && !mpEditEngine->GetNotifyHdl().IsSet()))
706  {
707  if (!mpEditEngine)
709  // If the object is cloned, do NOT add notify hdl.
710  if (mpEditEngine && !mpEditEngine->GetNotifyHdl().IsSet()&&!mbIsCloned)
712  if(!mpForwarder)
714  }
715  return mpForwarder.get();
716 }
717 
719 {
720  if (!mpViewForwarder)
721  {
722  // i#49561 Get right-aligned cell content to be read by screenreader.
724  }
725  return mpViewForwarder.get();
726 }
727 
729 {
732  if (bCreate)
733  {
735  {
736  mpEditViewForwarder.reset();
737  }
738  }
739  return mpEditViewForwarder.get();
740 }
741 
743 {
744  ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( &rNotify );
745 
746  if (aHint)
747  GetBroadcaster().Broadcast(*aHint);
748 }
749 
751  OutputDevice* pWin,
752  ScTextWnd* pTxtWnd)
753  : ScAccessibleEditObjectTextData(pEditView, pWin)
754  , mpTxtWnd(pTxtWnd)
755  , mbEditEngineCreated(false)
756 {
757  if (mpTxtWnd)
759 }
760 
762 {
763  if (mpTxtWnd)
765 
767  {
768  delete mpEditEngine;
769  mpEditEngine = nullptr; // don't access in ScAccessibleEditObjectTextData dtor!
770  }
772  {
773  // the NotifyHdl also has to be removed from the ScTextWnd's EditEngine
774  // (it's set in ScAccessibleEditLineTextData::GetTextForwarder, and mpEditEngine
775  // is reset there)
777  }
778 }
779 
781 {
782  if (mpTxtWnd)
784 
785  ResetEditMode();
786  mpWindow = nullptr;
787  mpTxtWnd = nullptr;
788 }
789 
791 {
793 }
794 
796 {
797  if (mpTxtWnd)
798  {
799  if (mpTxtWnd->HasEditView())
800  {
802 
804  ResetEditMode();
805  mbEditEngineCreated = false;
806 
808  ScAccessibleEditObjectTextData::GetTextForwarder(); // fill the mpForwarder
809  mpEditEngine = nullptr;
810  }
811  else
812  {
813  mpEditView = nullptr;
814 
816  ResetEditMode();
817  if (!mpEditEngine)
818  {
820  pEnginePool->FreezeIdRanges();
821  mpEditEngine = new ScFieldEditEngine(nullptr, pEnginePool.get(), nullptr, true);
822  mbEditEngineCreated = true;
823  mpEditEngine->EnableUndo( false );
824  mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
826 
828 
829 #if 0
830  Size aSize(pTxtWnd->GetSizePixel());
831  aSize = pTxtWnd->PixelToLogic(aSize, mpEditEngine->GetRefMapMode());
832  mpEditEngine->SetPaperSize(aSize);
833 #else
834  OutputDevice& rDevice = mpTxtWnd->GetDrawingArea()->get_ref_device();
835  Size aSize(rDevice.GetOutputSizePixel());
836  aSize = rDevice.PixelToLogic(aSize, mpEditEngine->GetRefMapMode());
837  mpEditEngine->SetPaperSize(aSize);
838 #endif
839 
841  }
842  }
843  }
844  return mpForwarder.get();
845 }
846 
848 {
849  if (mpTxtWnd)
850  {
851  if (!mpTxtWnd->HasEditView() && bCreate)
852  {
853  if ( !mpTxtWnd->IsInputActive() )
854  {
856  mpTxtWnd->GrabFocus();
857 
859  }
860  }
861  }
862 
864 }
865 
867 {
869  delete mpEditEngine;
872  mpEditEngine = nullptr;
873 
874  mpForwarder.reset();
875  mpEditViewForwarder.reset();
876  mpViewForwarder.reset();
877  mbEditEngineCreated = false;
878 }
879 
881 {
883  {
884  if (mpTxtWnd)
886  }
887 }
888 
890 {
891  ResetEditMode();
892  mpEditView = nullptr;
893 
894  // send SdrHintKind::BeginEdit
895  SdrHint aHint(SdrHintKind::BeginEdit);
896  GetBroadcaster().Broadcast( aHint );
897 }
898 
900 {
901  // send SdrHintKind::EndEdit
902  SdrHint aHint(SdrHintKind::EndEdit);
903  GetBroadcaster().Broadcast( aHint );
904 
905  ResetEditMode();
906  mpEditView = nullptr;
907 }
908 
909 // ScAccessiblePreviewCellTextData: shared data between sub objects of an accessible cell text object
910 
912  const ScAddress& rP)
913  : ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP),
914  mpViewShell(pViewShell)
915 {
916 }
917 
919 {
920  if (pEditEngine)
921  pEditEngine->SetNotifyHdl(Link<EENotify&,void>());
922  mpViewForwarder.reset();
923 }
924 
926 {
927  if ( rHint.GetId() == SfxHintId::Dying )
928  {
929  mpViewShell = nullptr; // invalid now
930  if (mpViewForwarder)
931  mpViewForwarder->SetInvalid();
932  }
934 }
935 
937 {
939 }
940 
942 {
943  bool bEditEngineBefore(pEditEngine != nullptr);
944 
945  ScCellTextData::GetTextForwarder(); // creates Forwarder and EditEngine
946 
947  if (!bEditEngineBefore && pEditEngine)
948  {
950  vcl::Window* pWin = mpViewShell->GetWindow();
951  if (pWin)
952  aSize = pWin->PixelToLogic(aSize, pEditEngine->GetRefMapMode());
953  pEditEngine->SetPaperSize(aSize);
954  }
955 
956  if (pEditEngine)
957  pEditEngine->SetNotifyHdl( LINK(this, ScAccessiblePreviewCellTextData, NotifyHdl) );
958 
959  return pForwarder.get();
960 }
961 
963 {
964  if (!mpViewForwarder)
965  mpViewForwarder.reset(new ScPreviewCellViewForwarder(mpViewShell));
966  return mpViewForwarder.get();
967 }
968 
970 {
971  ScDocShell* pDocSh = nullptr;
972  if (pViewShell)
973  pDocSh = static_cast<ScDocShell*>( pViewShell->GetDocument().GetDocumentShell());
974  return pDocSh;
975 }
976 
977 // ScAccessiblePreviewHeaderCellTextData: shared data between sub objects of an accessible cell text object
978 
980  const OUString& rText, const ScAddress& rP, bool bColHeader, bool bRowHeader)
981  : ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP),
982  mpViewShell(pViewShell),
983  maText(rText),
984  mbColHeader(bColHeader),
985  mbRowHeader(bRowHeader)
986 {
987 }
988 
990 {
991  if (pEditEngine)
992  pEditEngine->SetNotifyHdl(Link<EENotify&,void>());
993  mpViewForwarder.reset();
994 }
995 
997 {
998  if ( rHint.GetId() == SfxHintId::Dying )
999  {
1000  mpViewShell = nullptr; // invalid now
1001  if (mpViewForwarder)
1002  mpViewForwarder->SetInvalid();
1003  }
1005 }
1006 
1008 {
1010 }
1011 
1013 {
1014  if (!pEditEngine)
1015  {
1016  if ( pDocShell )
1017  {
1018  ScDocument& rDoc = pDocShell->GetDocument();
1020  }
1021  else
1022  {
1024  pEnginePool->FreezeIdRanges();
1025  pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool.get(), nullptr, true) );
1026  }
1027  pEditEngine->EnableUndo( false );
1028  if (pDocShell)
1029  pEditEngine->SetRefDevice(pDocShell->GetRefDevice());
1030  else
1031  pEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
1033  }
1034 
1035  if (bDataValid)
1036  return pForwarder.get();
1037 
1038  if (!maText.isEmpty())
1039  {
1040  if ( mpViewShell )
1041  {
1042  Size aOutputSize;
1043  vcl::Window* pWindow = mpViewShell->GetWindow();
1044  if ( pWindow )
1045  aOutputSize = pWindow->GetOutputSizePixel();
1046  tools::Rectangle aVisRect( Point(), aOutputSize );
1048  if (pWindow)
1049  aSize = pWindow->PixelToLogic(aSize, pEditEngine->GetRefMapMode());
1050  pEditEngine->SetPaperSize(aSize);
1051  }
1052  pEditEngine->SetTextCurrentDefaults( maText );
1053  }
1054 
1055  bDataValid = true;
1056 
1057  pEditEngine->SetNotifyHdl( LINK(this, ScAccessiblePreviewHeaderCellTextData, NotifyHdl) );
1058 
1059  return pForwarder.get();
1060 }
1061 
1063 {
1064  if (!mpViewForwarder)
1065  mpViewForwarder.reset(new ScPreviewHeaderCellViewForwarder(mpViewShell));
1066  return mpViewForwarder.get();
1067 }
1068 
1070 {
1071  ScDocShell* pDocSh = nullptr;
1072  if (pViewShell)
1073  pDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
1074  return pDocSh;
1075 }
1076 
1078  const EditTextObject* pEditObj, SvxAdjust eAdjust)
1079  :
1080  mpViewShell(pViewShell),
1081  mpDocSh(nullptr),
1082  mpEditObj(pEditObj),
1083  mbDataValid(false),
1084  meAdjust(eAdjust)
1085 {
1086  if (pViewShell)
1087  mpDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
1088  if (mpDocSh)
1089  mpDocSh->GetDocument().AddUnoObject(*this);
1090 }
1091 
1093 {
1094  SolarMutexGuard aGuard; // needed for EditEngine dtor
1095 
1096  if (mpDocSh)
1098  if (mpEditEngine)
1099  mpEditEngine->SetNotifyHdl(Link<EENotify&,void>());
1100  mpEditEngine.reset();
1101  mpForwarder.reset();
1102 }
1103 
1105 {
1107 }
1108 
1110 {
1111  if ( rHint.GetId() == SfxHintId::Dying )
1112  {
1113  mpViewShell = nullptr;// invalid now
1114  mpDocSh = nullptr;
1115  if (mxViewForwarder)
1116  mxViewForwarder->SetInvalid();
1117  }
1118 }
1119 
1121 {
1122  if (!mpEditEngine)
1123  {
1125  pEnginePool->FreezeIdRanges();
1126  std::unique_ptr<ScHeaderEditEngine> pHdrEngine(new ScHeaderEditEngine( pEnginePool.get() ));
1127 
1128  pHdrEngine->EnableUndo( false );
1129  pHdrEngine->SetRefMapMode(MapMode(MapUnit::MapTwip));
1130 
1131  // default font must be set, independently of document
1132  // -> use global pool from module
1133 
1134  SfxItemSet aDefaults( pHdrEngine->GetEmptyItemSet() );
1135  const ScPatternAttr& rPattern = SC_MOD()->GetPool().GetDefaultItem(ATTR_PATTERN);
1136  rPattern.FillEditItemSet( &aDefaults );
1137  // FillEditItemSet adjusts font height to 1/100th mm,
1138  // but for header/footer twips is needed, as in the PatternAttr:
1139  aDefaults.Put( rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT) );
1140  aDefaults.Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) );
1141  aDefaults.Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) );
1142  aDefaults.Put( SvxAdjustItem( meAdjust, EE_PARA_JUST ) );
1143  pHdrEngine->SetDefaults( aDefaults );
1144 
1146  if (mpViewShell)
1147  mpViewShell->FillFieldData(aData);
1148  else
1150  pHdrEngine->SetData( aData );
1151 
1152  mpEditEngine = std::move(pHdrEngine);
1154  }
1155 
1156  if (mbDataValid)
1157  return mpForwarder.get();
1158 
1159  if ( mpViewShell )
1160  {
1161  tools::Rectangle aVisRect;
1163  Size aSize(aVisRect.GetSize());
1164  vcl::Window* pWin = mpViewShell->GetWindow();
1165  if (pWin)
1166  aSize = pWin->PixelToLogic(aSize, mpEditEngine->GetRefMapMode());
1167  mpEditEngine->SetPaperSize(aSize);
1168  }
1169  if (mpEditObj)
1170  mpEditEngine->SetTextCurrentDefaults(*mpEditObj);
1171 
1172  mbDataValid = true;
1173  return mpForwarder.get();
1174 }
1175 
1177 {
1178  if (!mxViewForwarder)
1179  mxViewForwarder = std::make_unique<ScPreviewHeaderFooterViewForwarder>(mpViewShell);
1180  return mxViewForwarder.get();
1181 }
1182 
1184  const OUString& sText, const ScAddress& aCellPos, bool bMarkNote)
1185  :
1186  mpViewShell(pViewShell),
1187  mpDocSh(nullptr),
1188  msText(sText),
1189  maCellPos(aCellPos),
1190  mbMarkNote(bMarkNote),
1191  mbDataValid(false)
1192 {
1193  if (pViewShell)
1194  mpDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
1195  if (mpDocSh)
1196  mpDocSh->GetDocument().AddUnoObject(*this);
1197 }
1198 
1200 {
1201  SolarMutexGuard aGuard; // needed for EditEngine dtor
1202 
1203  if (mpDocSh)
1205  if (mpEditEngine)
1206  mpEditEngine->SetNotifyHdl(Link<EENotify&,void>());
1207  mpEditEngine.reset();
1208  mpForwarder.reset();
1209 }
1210 
1212 {
1214 }
1215 
1217 {
1218  if ( rHint.GetId() == SfxHintId::Dying )
1219  {
1220  mpViewShell = nullptr;// invalid now
1221  mpDocSh = nullptr;
1222  if (mxViewForwarder)
1223  mxViewForwarder->SetInvalid();
1224  }
1225 }
1226 
1228 {
1229  if (!mpEditEngine)
1230  {
1231  if ( mpDocSh )
1232  {
1233  ScDocument& rDoc = mpDocSh->GetDocument();
1235  }
1236  else
1237  {
1239  pEnginePool->FreezeIdRanges();
1240  mpEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool.get(), nullptr, true) );
1241  }
1242  mpEditEngine->EnableUndo( false );
1243  if (mpDocSh)
1244  mpEditEngine->SetRefDevice(mpDocSh->GetRefDevice());
1245  else
1246  mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
1248  }
1249 
1250  if (mbDataValid)
1251  return mpForwarder.get();
1252 
1253  if (!msText.isEmpty())
1254  {
1255 
1256  if ( mpViewShell )
1257  {
1258  Size aOutputSize;
1259  vcl::Window* pWindow = mpViewShell->GetWindow();
1260  if ( pWindow )
1261  aOutputSize = pWindow->GetOutputSizePixel();
1262  tools::Rectangle aVisRect( Point(), aOutputSize );
1264  if (pWindow)
1265  aSize = pWindow->PixelToLogic(aSize, mpEditEngine->GetRefMapMode());
1266  mpEditEngine->SetPaperSize(aSize);
1267  }
1268  mpEditEngine->SetTextCurrentDefaults( msText );
1269  }
1270 
1271  mbDataValid = true;
1272 
1273  mpEditEngine->SetNotifyHdl( LINK(this, ScAccessibleNoteTextData, NotifyHdl) );
1274 
1275  return mpForwarder.get();
1276 }
1277 
1279 {
1280  if (!mxViewForwarder)
1281  mxViewForwarder = std::make_unique<ScPreviewNoteViewForwarder>(mpViewShell);
1282  return mxViewForwarder.get();
1283 }
1284 
1285 // CSV import =================================================================
1286 
1288 {
1290 
1291 public:
1292  explicit ScCsvViewForwarder( OutputDevice* pWindow );
1293 
1294  virtual bool IsValid() const override;
1295  virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
1296  virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
1297 
1298  void SetInvalid();
1299 };
1300 
1302  mpWindow( pWindow )
1303 {
1304 }
1305 
1307 {
1308  return mpWindow != nullptr;
1309 }
1310 
1311 Point ScCsvViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
1312 {
1313  if( !mpWindow ) return Point();
1314  return mpWindow->LogicToPixel( rPoint, rMapMode );
1315 }
1316 
1317 Point ScCsvViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const
1318 {
1319  if( !mpWindow ) return Point();
1320  return mpWindow->PixelToLogic( rPoint, rMapMode );
1321 }
1322 
1324 {
1325  mpWindow = nullptr;
1326 }
1327 
1329  OutputDevice* pWindow, EditEngine* pEditEngine,
1330  const OUString& rCellText, const Size& rCellSize ) :
1331  mpWindow( pWindow ),
1332  mpEditEngine( pEditEngine ),
1333  maCellText( rCellText ),
1334  maCellSize( rCellSize )
1335 {
1336 }
1337 
1339 {
1340 }
1341 
1343 {
1344  if ( rHint.GetId() == SfxHintId::Dying )
1345  {
1346  mpWindow = nullptr;
1347  mpEditEngine = nullptr;
1348  if (mpViewForwarder)
1349  mpViewForwarder->SetInvalid();
1350  }
1351  ScAccessibleTextData::Notify( rBC, rHint );
1352 }
1353 
1355 {
1357 }
1358 
1360 {
1361  if( mpEditEngine )
1362  {
1365  if( !mpTextForwarder )
1367  }
1368  else
1369  mpTextForwarder.reset();
1370  return mpTextForwarder.get();
1371 }
1372 
1374 {
1375  if( !mpViewForwarder )
1377  return mpViewForwarder.get();
1378 }
1379 
1381 {
1382  return nullptr;
1383 }
1384 
1385 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScAccessibleCell * mpAccessibleCell
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
bool GetValue() const
ScPreviewViewForwarder(ScPreviewShell *pViewShell)
ScDocShell * pDocShell
Definition: textuno.hxx:329
std::unique_ptr< ScPreviewViewForwarder > mxViewForwarder
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
constexpr double nPPTY
const ScPreviewLocationData & GetLocationData()
Definition: prevwsh.cxx:1178
SvxCellHorJustify
VclPtr< OutputDevice > mpWindow
virtual ~ScAccessibleCellTextData() override
virtual Point LogicToPixel(const Point &rPoint, const MapMode &rMapMode) const override
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:353
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
constexpr TypedWhichId< ScPatternAttr > ATTR_PATTERN(156)
virtual Point LogicToPixel(const Point &rPoint, const MapMode &rMapMode) const override
std::unique_ptr< ScPreviewViewForwarder > mpViewForwarder
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Link< EENotify &, void > const & GetNotifyHdl() const
void Cut()
SCROW Row() const
Definition: address.hxx:261
virtual ScAccessibleTextData * Clone() const override
virtual SvxTextForwarder * GetTextForwarder() override
void setWidth(tools::Long nWidth)
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
std::unique_ptr< SvxEditEngineForwarder > mpForwarder
ScAccessiblePreviewCellTextData(ScPreviewShell *pViewShell, const ScAddress &rP)
std::unique_ptr< ScEditViewForwarder > mpEditViewForwarder
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
virtual ~ScAccessibleNoteTextData() override
MapMode const & GetRefMapMode() const
std::unique_ptr< ScEditEngineDefaulter > mpEditEngine
ScPreviewShell * mpViewShell
virtual ScAccessibleTextData * Clone() const override
virtual ScAccessibleTextData * Clone() const override
virtual bool IsValid() const override
virtual Point PixelToLogic(const Point &rPoint, const MapMode &rMapMode) const override
std::unique_ptr< SvxEditEngineForwarder > pForwarder
Definition: textuno.hxx:332
long Long
static::std::unique_ptr< SfxHint > EENotification2Hint(EENotify const *aNotify)
virtual bool IsValid() const override
tools::Rectangle GetNoteInRangeOutputRect(const tools::Rectangle &rVisiblePixel, bool bNoteMarks, const ScAddress &aCellPos) const
Definition: prevloc.cxx:427
std::unique_ptr< ScPreviewViewForwarder > mpViewForwarder
sal_uInt16 GetValue() const
virtual void StartEditEngine() override
Definition: inputwin.cxx:1441
std::unique_ptr< ScViewForwarder > mpViewForwarder
double GetPPTX() const
Definition: viewdata.hxx:467
ScPreviewShell * mpViewShell
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
ScAddress aCellPos
Definition: textuno.hxx:330
virtual Point PixelToLogic(const Point &rPoint, const MapMode &rMapMode) const override
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+15)
sal_Int16 GetRightMargin() const
constexpr TypedWhichId< ScLineBreakCell > ATTR_LINEBREAK(139)
const EditTextObject * mpEditObj
tools::Rectangle GetCellOutputRect(const ScAddress &rCellPos) const
Definition: prevloc.cxx:694
virtual SvxViewForwarder * GetViewForwarder() override
SfxBroadcaster & GetBroadcaster() const
virtual bool IsValid() const override
virtual const OUString & GetTextString() const override
Definition: inputwin.cxx:2018
virtual SvxViewForwarder * GetViewForwarder() override
virtual bool SetSelection(const ESelection &rSelection) override
std::unique_ptr< SvxEditEngineForwarder > mpForwarder
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
SfxHintId GetId() const
std::unique_ptr< SvxEditEngineForwarder > mpForwarder
ScSplitPos
Definition: viewdata.hxx:44
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
constexpr tools::Long Width() const
static rtl::Reference< SfxItemPool > CreatePool()
ScEditViewForwarder(EditView *pEditView, OutputDevice *pWin)
virtual ~ScAccessibleCsvTextData() override
constexpr TypedWhichId< ScRotateValueItem > ATTR_ROTATE_VALUE(135)
void Copy()
virtual bool Paste() override
SvxCellVerJustify
void SetText(const OUString &rStr)
virtual ScAccessibleTextData * Clone() const override
ScTabViewShell * mpViewShell
VclPtr< OutputDevice > mpWindow
virtual SvxViewForwarder * GetViewForwarder() override
virtual void InsertAccessibleTextData(ScAccessibleEditLineTextData &rTextData) override
Definition: inputwin.cxx:2150
TextForwarderPtr mpTextForwarder
tools::Rectangle GetHeaderCellOutputRect(const tools::Rectangle &rVisRect, const ScAddress &rCellPos, bool bColHeader) const
Definition: prevloc.cxx:667
SCTAB Tab() const
Definition: address.hxx:270
ScTabViewShell * mpViewShell
virtual ~ScAccessiblePreviewHeaderCellTextData() override
constexpr tools::Long getHeight() const
virtual SvxTextForwarder * GetTextForwarder() override
virtual SvxTextForwarder * GetTextForwarder()
Definition: textuno.cxx:780
static void FillDummyFieldData(ScHeaderFieldData &rData)
Definition: textuno.cxx:290
ScViewData & GetViewData()
Definition: tabview.hxx:333
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4746
void SetNotifyHdl(const Link< EENotify &, void > &rLink)
std::unique_ptr< ScEditEngineDefaulter > mpEditEngine
constexpr OUStringLiteral aData
ScViewForwarder(ScTabViewShell *pViewShell, ScSplitPos eSplitPos)
constexpr double nPPTX
virtual Point LogicToPixel(const Point &rPoint, const MapMode &rMapMode) const override
virtual bool HasEditView() const override
Definition: inputwin.cxx:1345
ScAccessibleCsvTextData(OutputDevice *pWindow, EditEngine *pEditEngine, const OUString &rCellText, const Size &rCellSize)
virtual EditView * GetEditView() const override
Definition: inputwin.cxx:1338
std::unique_ptr< ScPreviewViewForwarder > mxViewForwarder
vcl::Window * GetWindowByPos(ScSplitPos ePos) const
Definition: tabview.hxx:371
VclPtr< vcl::Window > mpWindow
VclPtr< OutputDevice > mpWindow
virtual SvxViewForwarder * GetViewForwarder() override
ScEditObjectViewForwarder(OutputDevice *pWindow, const EditView *_pEditView)
Point LogicToPixel(const Point &rLogicPt) const
virtual bool IsValid() const override
virtual SvxTextForwarder * GetTextForwarder() override
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CJK_FONT_HEIGHT(112)
virtual bool GetSelection(ESelection &rSelection) const override
SvxAdjust
virtual SvxViewForwarder * GetViewForwarder() override
virtual Point PixelToLogic(const Point &rPoint, const MapMode &rMapMode) const override
virtual ScAccessibleTextData * Clone() const override
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
EditEngine * GetEditEngine() const
const MapMode & GetMapMode() const
#define SC_MOD()
Definition: scmod.hxx:250
tools::Rectangle GetVisArea() const
virtual SvxTextForwarder * GetTextForwarder() override
virtual SvxTextForwarder * GetTextForwarder() override
virtual SvxTextForwarder * GetTextForwarder() override
IMPL_LINK(ScAccessibleTextData, NotifyHdl, EENotify &, aNotify, void)
virtual ScAccessibleTextData * Clone() const override
This base class provides an implementation of the AccessibleCell service.
virtual ~ScAccessibleEditLineTextData() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual Point PixelToLogic(const Point &rPoint, const MapMode &rMapMode) const override
virtual ~ScAccessibleEditObjectTextData() override
VclPtr< OutputDevice > mpWindow
Size GetOutputSizePixel() const
MapUnit GetMapUnit() const
virtual void Notify(SfxBroadcaster &, const SfxHint &) override
virtual SvxTextForwarder * GetTextForwarder() override
Point PixelToLogic(const Point &rDevicePt) const
VclPtr< OutputDevice > mpWindow
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CTL_FONT_HEIGHT(117)
SC_DLLPUBLIC bool HasValueData(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3797
virtual SvxViewForwarder * GetViewForwarder() override
sal_Int16 GetBottomMargin() const
const long LONG_MAX
SCCOL Col() const
Definition: address.hxx:266
void SetOffset(const Point &rPoint)
constexpr Point TopLeft() const
virtual ~ScAccessiblePreviewCellTextData() override
ScAccessibleEditObjectTextData(EditView *pEditView, OutputDevice *pWin, bool isClone=false)
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:898
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void SetPaperSize(const Size &rSize)
void SetRefMapMode(const MapMode &rMapMode)
bool IsInputActive() override
Definition: inputwin.cxx:2023
std::unique_ptr< ScFieldEditEngine > pEditEngine
Definition: textuno.hxx:331
void Broadcast(const SfxHint &rHint)
constexpr Size GetSize() const
double GetPPTY() const
Definition: viewdata.hxx:468
virtual ScAccessibleTextData * Clone() const override
virtual SvxTextForwarder * GetTextForwarder() override
Text maText
const OUString msText
virtual SvxViewForwarder * GetViewForwarder() override
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr tools::Long Height() const
std::unique_ptr< ScFieldEditEngine > CreateFieldEditEngine()
Definition: documen2.cxx:1122
void EnableUndo(bool bEnable)
virtual ScAccessibleTextData * Clone() const override
sal_Int16 GetLeftMargin() const
ScAccessiblePreviewHeaderCellTextData(ScPreviewShell *pViewShell, const OUString &rText, const ScAddress &rP, bool bColHeader, bool bRowHeader)
ScAccessibleHeaderTextData(ScPreviewShell *pViewShell, const EditTextObject *pEditObj, SvxAdjust eAdjust)
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:906
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
Degree100 GetValue() const
ScAccessibleNoteTextData(ScPreviewShell *pViewShell, const OUString &sText, const ScAddress &aCellPos, bool bMarkNote)
virtual bool Cut() override
virtual Point PixelToLogic(const Point &rPoint, const MapMode &rMapMode) const override
std::unique_ptr< ScEditObjectViewForwarder > mpViewForwarder
ScDocument & GetDocument()
Definition: prevwsh.cxx:1183
const ScDocument & GetDocument() const
Definition: docsh.hxx:216
bool GetMergeSizePixel(SCCOL nX, SCROW nY, tools::Long &rSizeXPix, tools::Long &rSizeYPix) const
Definition: viewdata.cxx:2703
virtual Point LogicToPixel(const Point &rPoint, const MapMode &rMapMode) const override
vcl::Window * GetWindow() const
virtual ~ScAccessibleHeaderTextData() override
Size GetOutputSizePixel() const
void SetSelection(const ESelection &rNewSel)
void setHeight(tools::Long nHeight)
virtual void RemoveAccessibleTextData(ScAccessibleEditLineTextData &rTextData) override
Definition: inputwin.cxx:2157
ViewForwarderPtr mpViewForwarder
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
ScDocShell * GetDocShell() const
Definition: textuno.hxx:353
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1056
virtual Point LogicToPixel(const Point &rPoint, const MapMode &rMapMode) const override
void FillFieldData(ScHeaderFieldData &rData)
Definition: prevwsh.cxx:879
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
ESelection GetSelection() const
constexpr tools::Long getWidth() const
ScSplitPos meSplitPos
virtual bool Copy() override
ScCsvViewForwarder(OutputDevice *pWindow)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
ScAccessibleCellTextData(ScTabViewShell *pViewShell, const ScAddress &rP, ScSplitPos eSplitPos, ScAccessibleCell *pAccCell)
virtual bool IsValid() const override
void Paste()
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
constexpr TypedWhichId< SvxMarginItem > ATTR_MARGIN(143)
OutputDevice * GetRefDevice()
Definition: docsh3.cxx:466
bool GetHeaderPosition(tools::Rectangle &rHeaderRect) const
Definition: prevloc.cxx:334
ScAccessibleEditLineTextData(EditView *pEditView, OutputDevice *pWin, ScTextWnd *pTextWnd)
sal_Int16 GetTopMargin() const