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) )
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  {
819  SfxItemPool* pEnginePool = EditEngine::CreatePool();
820  pEnginePool->FreezeIdRanges();
821  mpEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, 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  {
1023  SfxItemPool* pEnginePool = EditEngine::CreatePool();
1024  pEnginePool->FreezeIdRanges();
1025  pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool, 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  mpViewForwarder(nullptr),
1081  mpViewShell(pViewShell),
1082  mpDocSh(nullptr),
1083  mpEditObj(pEditObj),
1084  mbDataValid(false),
1085  meAdjust(eAdjust)
1086 {
1087  if (pViewShell)
1088  mpDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
1089  if (mpDocSh)
1090  mpDocSh->GetDocument().AddUnoObject(*this);
1091 }
1092 
1094 {
1095  SolarMutexGuard aGuard; // needed for EditEngine dtor
1096 
1097  if (mpDocSh)
1099  if (mpEditEngine)
1100  mpEditEngine->SetNotifyHdl(Link<EENotify&,void>());
1101  mpEditEngine.reset();
1102  mpForwarder.reset();
1103 }
1104 
1106 {
1108 }
1109 
1111 {
1112  if ( rHint.GetId() == SfxHintId::Dying )
1113  {
1114  mpViewShell = nullptr;// invalid now
1115  mpDocSh = nullptr;
1116  if (mpViewForwarder)
1118  }
1119 }
1120 
1122 {
1123  if (!mpEditEngine)
1124  {
1125  SfxItemPool* pEnginePool = EditEngine::CreatePool();
1126  pEnginePool->FreezeIdRanges();
1127  std::unique_ptr<ScHeaderEditEngine> pHdrEngine(new ScHeaderEditEngine( pEnginePool ));
1128 
1129  pHdrEngine->EnableUndo( false );
1130  pHdrEngine->SetRefMapMode(MapMode(MapUnit::MapTwip));
1131 
1132  // default font must be set, independently of document
1133  // -> use global pool from module
1134 
1135  SfxItemSet aDefaults( pHdrEngine->GetEmptyItemSet() );
1136  const ScPatternAttr& rPattern = SC_MOD()->GetPool().GetDefaultItem(ATTR_PATTERN);
1137  rPattern.FillEditItemSet( &aDefaults );
1138  // FillEditItemSet adjusts font height to 1/100th mm,
1139  // but for header/footer twips is needed, as in the PatternAttr:
1140  aDefaults.Put( rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT) );
1141  aDefaults.Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) );
1142  aDefaults.Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) );
1143  aDefaults.Put( SvxAdjustItem( meAdjust, EE_PARA_JUST ) );
1144  pHdrEngine->SetDefaults( aDefaults );
1145 
1147  if (mpViewShell)
1148  mpViewShell->FillFieldData(aData);
1149  else
1151  pHdrEngine->SetData( aData );
1152 
1153  mpEditEngine = std::move(pHdrEngine);
1155  }
1156 
1157  if (mbDataValid)
1158  return mpForwarder.get();
1159 
1160  if ( mpViewShell )
1161  {
1162  tools::Rectangle aVisRect;
1164  Size aSize(aVisRect.GetSize());
1165  vcl::Window* pWin = mpViewShell->GetWindow();
1166  if (pWin)
1167  aSize = pWin->PixelToLogic(aSize, mpEditEngine->GetRefMapMode());
1168  mpEditEngine->SetPaperSize(aSize);
1169  }
1170  if (mpEditObj)
1171  mpEditEngine->SetTextCurrentDefaults(*mpEditObj);
1172 
1173  mbDataValid = true;
1174  return mpForwarder.get();
1175 }
1176 
1178 {
1179  if (!mpViewForwarder)
1180  mpViewForwarder = new ScPreviewHeaderFooterViewForwarder(mpViewShell);
1181  return mpViewForwarder;
1182 }
1183 
1185  const OUString& sText, const ScAddress& aCellPos, bool bMarkNote)
1186  :
1187  mpViewForwarder(nullptr),
1188  mpViewShell(pViewShell),
1189  mpDocSh(nullptr),
1190  msText(sText),
1191  maCellPos(aCellPos),
1192  mbMarkNote(bMarkNote),
1193  mbDataValid(false)
1194 {
1195  if (pViewShell)
1196  mpDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
1197  if (mpDocSh)
1198  mpDocSh->GetDocument().AddUnoObject(*this);
1199 }
1200 
1202 {
1203  SolarMutexGuard aGuard; // needed for EditEngine dtor
1204 
1205  if (mpDocSh)
1207  if (mpEditEngine)
1208  mpEditEngine->SetNotifyHdl(Link<EENotify&,void>());
1209  mpEditEngine.reset();
1210  mpForwarder.reset();
1211 }
1212 
1214 {
1216 }
1217 
1219 {
1220  if ( rHint.GetId() == SfxHintId::Dying )
1221  {
1222  mpViewShell = nullptr;// invalid now
1223  mpDocSh = nullptr;
1224  if (mpViewForwarder)
1226  }
1227 }
1228 
1230 {
1231  if (!mpEditEngine)
1232  {
1233  if ( mpDocSh )
1234  {
1235  ScDocument& rDoc = mpDocSh->GetDocument();
1237  }
1238  else
1239  {
1240  SfxItemPool* pEnginePool = EditEngine::CreatePool();
1241  pEnginePool->FreezeIdRanges();
1242  mpEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true) );
1243  }
1244  mpEditEngine->EnableUndo( false );
1245  if (mpDocSh)
1246  mpEditEngine->SetRefDevice(mpDocSh->GetRefDevice());
1247  else
1248  mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
1250  }
1251 
1252  if (mbDataValid)
1253  return mpForwarder.get();
1254 
1255  if (!msText.isEmpty())
1256  {
1257 
1258  if ( mpViewShell )
1259  {
1260  Size aOutputSize;
1261  vcl::Window* pWindow = mpViewShell->GetWindow();
1262  if ( pWindow )
1263  aOutputSize = pWindow->GetOutputSizePixel();
1264  tools::Rectangle aVisRect( Point(), aOutputSize );
1266  if (pWindow)
1267  aSize = pWindow->PixelToLogic(aSize, mpEditEngine->GetRefMapMode());
1268  mpEditEngine->SetPaperSize(aSize);
1269  }
1270  mpEditEngine->SetTextCurrentDefaults( msText );
1271  }
1272 
1273  mbDataValid = true;
1274 
1275  mpEditEngine->SetNotifyHdl( LINK(this, ScAccessibleNoteTextData, NotifyHdl) );
1276 
1277  return mpForwarder.get();
1278 }
1279 
1281 {
1282  if (!mpViewForwarder)
1283  mpViewForwarder = new ScPreviewNoteViewForwarder(mpViewShell);
1284  return mpViewForwarder;
1285 }
1286 
1287 // CSV import =================================================================
1288 
1290 {
1292 
1293 public:
1294  explicit ScCsvViewForwarder( OutputDevice* pWindow );
1295 
1296  virtual bool IsValid() const override;
1297  virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
1298  virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
1299 
1300  void SetInvalid();
1301 };
1302 
1304  mpWindow( pWindow )
1305 {
1306 }
1307 
1309 {
1310  return mpWindow != nullptr;
1311 }
1312 
1313 Point ScCsvViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
1314 {
1315  if( !mpWindow ) return Point();
1316  return mpWindow->LogicToPixel( rPoint, rMapMode );
1317 }
1318 
1319 Point ScCsvViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const
1320 {
1321  if( !mpWindow ) return Point();
1322  return mpWindow->PixelToLogic( rPoint, rMapMode );
1323 }
1324 
1326 {
1327  mpWindow = nullptr;
1328 }
1329 
1331  OutputDevice* pWindow, EditEngine* pEditEngine,
1332  const OUString& rCellText, const Size& rCellSize ) :
1333  mpWindow( pWindow ),
1334  mpEditEngine( pEditEngine ),
1335  maCellText( rCellText ),
1336  maCellSize( rCellSize )
1337 {
1338 }
1339 
1341 {
1342 }
1343 
1345 {
1346  if ( rHint.GetId() == SfxHintId::Dying )
1347  {
1348  mpWindow = nullptr;
1349  mpEditEngine = nullptr;
1350  if (mpViewForwarder)
1351  mpViewForwarder->SetInvalid();
1352  }
1353  ScAccessibleTextData::Notify( rBC, rHint );
1354 }
1355 
1357 {
1359 }
1360 
1362 {
1363  if( mpEditEngine )
1364  {
1367  if( !mpTextForwarder )
1369  }
1370  else
1371  mpTextForwarder.reset();
1372  return mpTextForwarder.get();
1373 }
1374 
1376 {
1377  if( !mpViewForwarder )
1379  return mpViewForwarder.get();
1380 }
1381 
1383 {
1384  return nullptr;
1385 }
1386 
1387 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScAccessibleCell * mpAccessibleCell
Point TopLeft() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
bool GetValue() const
ScPreviewViewForwarder(ScPreviewShell *pViewShell)
ScDocShell * pDocShell
Definition: textuno.hxx:330
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
constexpr double nPPTY
const ScPreviewLocationData & GetLocationData()
Definition: prevwsh.cxx:1177
SvxCellHorJustify
VclPtr< OutputDevice > mpWindow
virtual ~ScAccessibleCellTextData() override
virtual Point LogicToPixel(const Point &rPoint, const MapMode &rMapMode) const override
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
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:262
virtual ScAccessibleTextData * Clone() const override
virtual SvxTextForwarder * GetTextForwarder() override
void setWidth(tools::Long nWidth)
const char aData[]
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
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
tools::Long getWidth() const
virtual bool IsValid() const override
virtual Point PixelToLogic(const Point &rPoint, const MapMode &rMapMode) const override
std::unique_ptr< SvxEditEngineForwarder > pForwarder
Definition: textuno.hxx:333
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:426
std::unique_ptr< ScPreviewViewForwarder > mpViewForwarder
sal_uInt16 GetValue() const
virtual void StartEditEngine() override
Definition: inputwin.cxx:1334
std::unique_ptr< ScViewForwarder > mpViewForwarder
double GetPPTX() const
Definition: viewdata.hxx:468
ScPreviewShell * mpViewShell
const MapMode & GetMapMode() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual SvxEditViewForwarder * GetEditViewForwarder(bool bCreate) override
ScAddress aCellPos
Definition: textuno.hxx:331
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:692
virtual SvxViewForwarder * GetViewForwarder() override
SfxBroadcaster & GetBroadcaster() const
virtual bool IsValid() const override
void FreezeIdRanges()
virtual const OUString & GetTextString() const override
Definition: inputwin.cxx:1900
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:45
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
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:2035
TextForwarderPtr mpTextForwarder
tools::Rectangle GetHeaderCellOutputRect(const tools::Rectangle &rVisRect, const ScAddress &rCellPos, bool bColHeader) const
Definition: prevloc.cxx:665
SCTAB Tab() const
Definition: address.hxx:271
ScTabViewShell * mpViewShell
virtual ~ScAccessiblePreviewHeaderCellTextData() override
virtual SvxTextForwarder * GetTextForwarder() override
virtual SvxTextForwarder * GetTextForwarder()
Definition: textuno.cxx:792
static void FillDummyFieldData(ScHeaderFieldData &rData)
Definition: textuno.cxx:296
ScViewData & GetViewData()
Definition: tabview.hxx:332
ScPreviewViewForwarder * mpViewForwarder
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4714
void SetNotifyHdl(const Link< EENotify &, void > &rLink)
std::unique_ptr< ScEditEngineDefaulter > mpEditEngine
ScViewForwarder(ScTabViewShell *pViewShell, ScSplitPos eSplitPos)
constexpr double nPPTX
virtual Point LogicToPixel(const Point &rPoint, const MapMode &rMapMode) const override
tools::Long getHeight() const
virtual EditView * GetEditView() override
Definition: inputwin.cxx:1236
virtual bool HasEditView() const override
Definition: inputwin.cxx:1243
ScAccessibleCsvTextData(OutputDevice *pWindow, EditEngine *pEditEngine, const OUString &rCellText, const Size &rCellSize)
vcl::Window * GetWindowByPos(ScSplitPos ePos) const
Definition: tabview.hxx:370
VclPtr< vcl::Window > mpWindow
VclPtr< OutputDevice > mpWindow
virtual SvxViewForwarder * GetViewForwarder() override
ScEditObjectViewForwarder(OutputDevice *pWindow, const EditView *_pEditView)
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
#define SC_MOD()
Definition: scmod.hxx:253
virtual SvxTextForwarder * GetTextForwarder() override
tools::Long Width() const
virtual SvxTextForwarder * GetTextForwarder() override
virtual SvxTextForwarder * GetTextForwarder() override
const tools::Rectangle & GetVisArea() const
IMPL_LINK(ScAccessibleTextData, NotifyHdl, EENotify &, aNotify, void)
virtual ScAccessibleTextData * Clone() const override
ScPreviewViewForwarder * mpViewForwarder
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
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:3765
virtual SvxViewForwarder * GetViewForwarder() override
sal_Int16 GetBottomMargin() const
Size GetSize() const
const long LONG_MAX
SCCOL Col() const
Definition: address.hxx:267
void SetOffset(const Point &rPoint)
virtual ~ScAccessiblePreviewCellTextData() override
ScAccessibleEditObjectTextData(EditView *pEditView, OutputDevice *pWin, bool isClone=false)
static SfxItemPool * CreatePool()
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:893
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
void SetPaperSize(const Size &rSize)
void SetRefMapMode(const MapMode &rMapMode)
bool IsInputActive() override
Definition: inputwin.cxx:1905
std::unique_ptr< ScFieldEditEngine > pEditEngine
Definition: textuno.hxx:332
void Broadcast(const SfxHint &rHint)
double GetPPTY() const
Definition: viewdata.hxx:469
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)
std::unique_ptr< ScFieldEditEngine > CreateFieldEditEngine()
Definition: documen2.cxx:1117
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:901
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
tools::Long Height() 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:1182
const ScDocument & GetDocument() const
Definition: docsh.hxx:216
bool GetMergeSizePixel(SCCOL nX, SCROW nY, tools::Long &rSizeXPix, tools::Long &rSizeYPix) const
Definition: viewdata.cxx:2641
virtual Point LogicToPixel(const Point &rPoint, const MapMode &rMapMode) const override
vcl::Window * GetWindow() const
virtual ~ScAccessibleHeaderTextData() override
void SetSelection(const ESelection &rNewSel)
void setHeight(tools::Long nHeight)
virtual void RemoveAccessibleTextData(ScAccessibleEditLineTextData &rTextData) override
Definition: inputwin.cxx:2042
ViewForwarderPtr mpViewForwarder
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
ScDocShell * GetDocShell() const
Definition: textuno.hxx:354
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1058
virtual Point LogicToPixel(const Point &rPoint, const MapMode &rMapMode) const override
void FillFieldData(ScHeaderFieldData &rData)
Definition: prevwsh.cxx:878
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
ESelection GetSelection() 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:465
bool GetHeaderPosition(tools::Rectangle &rHeaderRect) const
Definition: prevloc.cxx:333
ScAccessibleEditLineTextData(EditView *pEditView, OutputDevice *pWin, ScTextWnd *pTextWnd)
sal_Int16 GetTopMargin() const