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  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  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< 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  long nLeftM = ( pMarginItem ? static_cast< long >( ( pMarginItem->GetLeftMargin() + nIndent ) * nPPTX ) : 0 );
515  long nTopM = ( pMarginItem ? static_cast< long >( pMarginItem->GetTopMargin() * nPPTY ) : 0 );
516  long nRightM = ( pMarginItem ? static_cast< long >( pMarginItem->GetRightMargin() * nPPTX ) : 0 );
517  long nBottomM = ( pMarginItem ? static_cast< long >( pMarginItem->GetBottomMargin() * nPPTY ) : 0 );
518  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  long nTxtWidth = static_cast< 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  long nTxtWidth = static_cast< 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  long nTextWidth = aTextSize.Width();
571  long nTextHeight = aTextSize.Height();
572 
573  long nOffsetX = nLeftM;
574  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  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  :
752  ScAccessibleEditObjectTextData(pEditView, pWin),
753  mbEditEngineCreated(false)
754 {
755  ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>( pWin );
756 
757  if (pTxtWnd)
758  pTxtWnd->InsertAccessibleTextData( *this );
759 }
760 
762 {
763  ScTextWnd* pTxtWnd = dynamic_cast< ScTextWnd* >(mpWindow.get());
764 
765  if (pTxtWnd)
766  {
767  assert(!pTxtWnd->IsDisposed());
768  pTxtWnd->RemoveAccessibleTextData( *this );
769  }
770 
772  {
773  delete mpEditEngine;
774  mpEditEngine = nullptr; // don't access in ScAccessibleEditObjectTextData dtor!
775  }
776  else if (pTxtWnd && pTxtWnd->HasEditView() && pTxtWnd->GetEditView()->GetEditEngine())
777  {
778  // the NotifyHdl also has to be removed from the ScTextWnd's EditEngine
779  // (it's set in ScAccessibleEditLineTextData::GetTextForwarder, and mpEditEngine
780  // is reset there)
782  }
783 }
784 
786 {
787  ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow.get());
788 
789  if (pTxtWnd)
790  {
791  assert(!pTxtWnd->IsDisposed());
792  pTxtWnd->RemoveAccessibleTextData( *this );
793  }
794 
795  ResetEditMode();
796  mpWindow = nullptr;
797 }
798 
800 {
802 }
803 
805 {
806  ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow.get());
807 
808  if (pTxtWnd)
809  {
810  if (pTxtWnd->HasEditView())
811  {
812  mpEditView = pTxtWnd->GetEditView();
813 
815  ResetEditMode();
816  mbEditEngineCreated = false;
817 
818  mpEditView = pTxtWnd->GetEditView();
819  ScAccessibleEditObjectTextData::GetTextForwarder(); // fill the mpForwarder
820  mpEditEngine = nullptr;
821  }
822  else
823  {
824  mpEditView = nullptr;
825 
827  ResetEditMode();
828  if (!mpEditEngine)
829  {
830  SfxItemPool* pEnginePool = EditEngine::CreatePool();
831  pEnginePool->FreezeIdRanges();
832  mpEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true);
833  mbEditEngineCreated = true;
834  mpEditEngine->EnableUndo( false );
835  mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
837 
838  mpEditEngine->SetText(pTxtWnd->GetTextString());
839 
840  Size aSize(pTxtWnd->GetSizePixel());
841 
842  aSize = pTxtWnd->PixelToLogic(aSize, mpEditEngine->GetRefMapMode());
843 
844  mpEditEngine->SetPaperSize(aSize);
845 
847  }
848  }
849  }
850  return mpForwarder.get();
851 }
852 
854 {
855  ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow.get());
856 
857  if (pTxtWnd)
858  {
859  if (!pTxtWnd->HasEditView() && bCreate)
860  {
861  if ( !pTxtWnd->IsInputActive() )
862  {
863  pTxtWnd->StartEditEngine();
864  pTxtWnd->GrabFocus();
865 
866  mpEditView = pTxtWnd->GetEditView();
867  }
868  }
869  }
870 
872 }
873 
875 {
876  ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow.get());
877 
879  delete mpEditEngine;
880  else if (pTxtWnd && pTxtWnd->HasEditView() && pTxtWnd->GetEditView()->GetEditEngine())
882  mpEditEngine = nullptr;
883 
884  mpForwarder.reset();
885  mpEditViewForwarder.reset();
886  mpViewForwarder.reset();
887  mbEditEngineCreated = false;
888 }
889 
891 {
893  {
894  ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow.get());
895 
896  if (pTxtWnd)
897  mpEditEngine->SetText(pTxtWnd->GetTextString());
898  }
899 }
900 
902 {
903  ResetEditMode();
904  mpEditView = nullptr;
905 
906  // send SdrHintKind::BeginEdit
907  SdrHint aHint(SdrHintKind::BeginEdit);
908  GetBroadcaster().Broadcast( aHint );
909 }
910 
912 {
913  // send SdrHintKind::EndEdit
914  SdrHint aHint(SdrHintKind::EndEdit);
915  GetBroadcaster().Broadcast( aHint );
916 
917  ResetEditMode();
918  mpEditView = nullptr;
919 }
920 
921 // ScAccessiblePreviewCellTextData: shared data between sub objects of an accessible cell text object
922 
924  const ScAddress& rP)
925  : ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP),
926  mpViewShell(pViewShell)
927 {
928 }
929 
931 {
932  if (pEditEngine)
933  pEditEngine->SetNotifyHdl(Link<EENotify&,void>());
934  mpViewForwarder.reset();
935 }
936 
938 {
939  if ( rHint.GetId() == SfxHintId::Dying )
940  {
941  mpViewShell = nullptr; // invalid now
942  if (mpViewForwarder)
943  mpViewForwarder->SetInvalid();
944  }
946 }
947 
949 {
951 }
952 
954 {
955  bool bEditEngineBefore(pEditEngine != nullptr);
956 
957  ScCellTextData::GetTextForwarder(); // creates Forwarder and EditEngine
958 
959  if (!bEditEngineBefore && pEditEngine)
960  {
962  vcl::Window* pWin = mpViewShell->GetWindow();
963  if (pWin)
964  aSize = pWin->PixelToLogic(aSize, pEditEngine->GetRefMapMode());
965  pEditEngine->SetPaperSize(aSize);
966  }
967 
968  if (pEditEngine)
969  pEditEngine->SetNotifyHdl( LINK(this, ScAccessiblePreviewCellTextData, NotifyHdl) );
970 
971  return pForwarder.get();
972 }
973 
975 {
976  if (!mpViewForwarder)
977  mpViewForwarder.reset(new ScPreviewCellViewForwarder(mpViewShell));
978  return mpViewForwarder.get();
979 }
980 
982 {
983  ScDocShell* pDocSh = nullptr;
984  if (pViewShell)
985  pDocSh = static_cast<ScDocShell*>( pViewShell->GetDocument().GetDocumentShell());
986  return pDocSh;
987 }
988 
989 // ScAccessiblePreviewHeaderCellTextData: shared data between sub objects of an accessible cell text object
990 
992  const OUString& rText, const ScAddress& rP, bool bColHeader, bool bRowHeader)
993  : ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP),
994  mpViewShell(pViewShell),
995  maText(rText),
996  mbColHeader(bColHeader),
997  mbRowHeader(bRowHeader)
998 {
999 }
1000 
1002 {
1003  if (pEditEngine)
1004  pEditEngine->SetNotifyHdl(Link<EENotify&,void>());
1005  mpViewForwarder.reset();
1006 }
1007 
1009 {
1010  if ( rHint.GetId() == SfxHintId::Dying )
1011  {
1012  mpViewShell = nullptr; // invalid now
1013  if (mpViewForwarder)
1014  mpViewForwarder->SetInvalid();
1015  }
1017 }
1018 
1020 {
1022 }
1023 
1025 {
1026  if (!pEditEngine)
1027  {
1028  if ( pDocShell )
1029  {
1030  ScDocument& rDoc = pDocShell->GetDocument();
1032  }
1033  else
1034  {
1035  SfxItemPool* pEnginePool = EditEngine::CreatePool();
1036  pEnginePool->FreezeIdRanges();
1037  pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true) );
1038  }
1039  pEditEngine->EnableUndo( false );
1040  if (pDocShell)
1041  pEditEngine->SetRefDevice(pDocShell->GetRefDevice());
1042  else
1043  pEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
1045  }
1046 
1047  if (bDataValid)
1048  return pForwarder.get();
1049 
1050  if (!maText.isEmpty())
1051  {
1052  if ( mpViewShell )
1053  {
1054  Size aOutputSize;
1055  vcl::Window* pWindow = mpViewShell->GetWindow();
1056  if ( pWindow )
1057  aOutputSize = pWindow->GetOutputSizePixel();
1058  tools::Rectangle aVisRect( Point(), aOutputSize );
1060  if (pWindow)
1061  aSize = pWindow->PixelToLogic(aSize, pEditEngine->GetRefMapMode());
1062  pEditEngine->SetPaperSize(aSize);
1063  }
1064  pEditEngine->SetTextCurrentDefaults( maText );
1065  }
1066 
1067  bDataValid = true;
1068 
1069  pEditEngine->SetNotifyHdl( LINK(this, ScAccessiblePreviewHeaderCellTextData, NotifyHdl) );
1070 
1071  return pForwarder.get();
1072 }
1073 
1075 {
1076  if (!mpViewForwarder)
1077  mpViewForwarder.reset(new ScPreviewHeaderCellViewForwarder(mpViewShell));
1078  return mpViewForwarder.get();
1079 }
1080 
1082 {
1083  ScDocShell* pDocSh = nullptr;
1084  if (pViewShell)
1085  pDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
1086  return pDocSh;
1087 }
1088 
1090  const EditTextObject* pEditObj, SvxAdjust eAdjust)
1091  :
1092  mpViewForwarder(nullptr),
1093  mpViewShell(pViewShell),
1094  mpDocSh(nullptr),
1095  mpEditObj(pEditObj),
1096  mbDataValid(false),
1097  meAdjust(eAdjust)
1098 {
1099  if (pViewShell)
1100  mpDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
1101  if (mpDocSh)
1102  mpDocSh->GetDocument().AddUnoObject(*this);
1103 }
1104 
1106 {
1107  SolarMutexGuard aGuard; // needed for EditEngine dtor
1108 
1109  if (mpDocSh)
1111  if (mpEditEngine)
1112  mpEditEngine->SetNotifyHdl(Link<EENotify&,void>());
1113  mpEditEngine.reset();
1114  mpForwarder.reset();
1115 }
1116 
1118 {
1120 }
1121 
1123 {
1124  if ( rHint.GetId() == SfxHintId::Dying )
1125  {
1126  mpViewShell = nullptr;// invalid now
1127  mpDocSh = nullptr;
1128  if (mpViewForwarder)
1130  }
1131 }
1132 
1134 {
1135  if (!mpEditEngine)
1136  {
1137  SfxItemPool* pEnginePool = EditEngine::CreatePool();
1138  pEnginePool->FreezeIdRanges();
1139  std::unique_ptr<ScHeaderEditEngine> pHdrEngine(new ScHeaderEditEngine( pEnginePool ));
1140 
1141  pHdrEngine->EnableUndo( false );
1142  pHdrEngine->SetRefMapMode(MapMode(MapUnit::MapTwip));
1143 
1144  // default font must be set, independently of document
1145  // -> use global pool from module
1146 
1147  SfxItemSet aDefaults( pHdrEngine->GetEmptyItemSet() );
1148  const ScPatternAttr& rPattern = SC_MOD()->GetPool().GetDefaultItem(ATTR_PATTERN);
1149  rPattern.FillEditItemSet( &aDefaults );
1150  // FillEditItemSet adjusts font height to 1/100th mm,
1151  // but for header/footer twips is needed, as in the PatternAttr:
1152  aDefaults.Put( rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT) );
1153  aDefaults.Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) );
1154  aDefaults.Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) );
1155  aDefaults.Put( SvxAdjustItem( meAdjust, EE_PARA_JUST ) );
1156  pHdrEngine->SetDefaults( aDefaults );
1157 
1159  if (mpViewShell)
1160  mpViewShell->FillFieldData(aData);
1161  else
1163  pHdrEngine->SetData( aData );
1164 
1165  mpEditEngine = std::move(pHdrEngine);
1167  }
1168 
1169  if (mbDataValid)
1170  return mpForwarder.get();
1171 
1172  if ( mpViewShell )
1173  {
1174  tools::Rectangle aVisRect;
1176  Size aSize(aVisRect.GetSize());
1177  vcl::Window* pWin = mpViewShell->GetWindow();
1178  if (pWin)
1179  aSize = pWin->PixelToLogic(aSize, mpEditEngine->GetRefMapMode());
1180  mpEditEngine->SetPaperSize(aSize);
1181  }
1182  if (mpEditObj)
1183  mpEditEngine->SetTextCurrentDefaults(*mpEditObj);
1184 
1185  mbDataValid = true;
1186  return mpForwarder.get();
1187 }
1188 
1190 {
1191  if (!mpViewForwarder)
1192  mpViewForwarder = new ScPreviewHeaderFooterViewForwarder(mpViewShell);
1193  return mpViewForwarder;
1194 }
1195 
1197  const OUString& sText, const ScAddress& aCellPos, bool bMarkNote)
1198  :
1199  mpViewForwarder(nullptr),
1200  mpViewShell(pViewShell),
1201  mpDocSh(nullptr),
1202  msText(sText),
1203  maCellPos(aCellPos),
1204  mbMarkNote(bMarkNote),
1205  mbDataValid(false)
1206 {
1207  if (pViewShell)
1208  mpDocSh = static_cast<ScDocShell*>(pViewShell->GetDocument().GetDocumentShell());
1209  if (mpDocSh)
1210  mpDocSh->GetDocument().AddUnoObject(*this);
1211 }
1212 
1214 {
1215  SolarMutexGuard aGuard; // needed for EditEngine dtor
1216 
1217  if (mpDocSh)
1219  if (mpEditEngine)
1220  mpEditEngine->SetNotifyHdl(Link<EENotify&,void>());
1221  mpEditEngine.reset();
1222  mpForwarder.reset();
1223 }
1224 
1226 {
1228 }
1229 
1231 {
1232  if ( rHint.GetId() == SfxHintId::Dying )
1233  {
1234  mpViewShell = nullptr;// invalid now
1235  mpDocSh = nullptr;
1236  if (mpViewForwarder)
1238  }
1239 }
1240 
1242 {
1243  if (!mpEditEngine)
1244  {
1245  if ( mpDocSh )
1246  {
1247  ScDocument& rDoc = mpDocSh->GetDocument();
1249  }
1250  else
1251  {
1252  SfxItemPool* pEnginePool = EditEngine::CreatePool();
1253  pEnginePool->FreezeIdRanges();
1254  mpEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true) );
1255  }
1256  mpEditEngine->EnableUndo( false );
1257  if (mpDocSh)
1258  mpEditEngine->SetRefDevice(mpDocSh->GetRefDevice());
1259  else
1260  mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
1262  }
1263 
1264  if (mbDataValid)
1265  return mpForwarder.get();
1266 
1267  if (!msText.isEmpty())
1268  {
1269 
1270  if ( mpViewShell )
1271  {
1272  Size aOutputSize;
1273  vcl::Window* pWindow = mpViewShell->GetWindow();
1274  if ( pWindow )
1275  aOutputSize = pWindow->GetOutputSizePixel();
1276  tools::Rectangle aVisRect( Point(), aOutputSize );
1278  if (pWindow)
1279  aSize = pWindow->PixelToLogic(aSize, mpEditEngine->GetRefMapMode());
1280  mpEditEngine->SetPaperSize(aSize);
1281  }
1282  mpEditEngine->SetTextCurrentDefaults( msText );
1283  }
1284 
1285  mbDataValid = true;
1286 
1287  mpEditEngine->SetNotifyHdl( LINK(this, ScAccessibleNoteTextData, NotifyHdl) );
1288 
1289  return mpForwarder.get();
1290 }
1291 
1293 {
1294  if (!mpViewForwarder)
1295  mpViewForwarder = new ScPreviewNoteViewForwarder(mpViewShell);
1296  return mpViewForwarder;
1297 }
1298 
1299 // CSV import =================================================================
1300 
1302 {
1304 
1305 public:
1306  explicit ScCsvViewForwarder( OutputDevice* pWindow );
1307 
1308  virtual bool IsValid() const override;
1309  virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
1310  virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
1311 
1312  void SetInvalid();
1313 };
1314 
1316  mpWindow( pWindow )
1317 {
1318 }
1319 
1321 {
1322  return mpWindow != nullptr;
1323 }
1324 
1325 Point ScCsvViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
1326 {
1327  if( !mpWindow ) return Point();
1328  return mpWindow->LogicToPixel( rPoint, rMapMode );
1329 }
1330 
1331 Point ScCsvViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const
1332 {
1333  if( !mpWindow ) return Point();
1334  return mpWindow->PixelToLogic( rPoint, rMapMode );
1335 }
1336 
1338 {
1339  mpWindow = nullptr;
1340 }
1341 
1343  OutputDevice* pWindow, EditEngine* pEditEngine,
1344  const OUString& rCellText, const Size& rCellSize ) :
1345  mpWindow( pWindow ),
1346  mpEditEngine( pEditEngine ),
1347  maCellText( rCellText ),
1348  maCellSize( rCellSize )
1349 {
1350 }
1351 
1353 {
1354 }
1355 
1357 {
1358  if ( rHint.GetId() == SfxHintId::Dying )
1359  {
1360  mpWindow = nullptr;
1361  mpEditEngine = nullptr;
1362  if (mpViewForwarder)
1363  mpViewForwarder->SetInvalid();
1364  }
1365  ScAccessibleTextData::Notify( rBC, rHint );
1366 }
1367 
1369 {
1371 }
1372 
1374 {
1375  if( mpEditEngine )
1376  {
1379  if( !mpTextForwarder )
1381  }
1382  else
1383  mpTextForwarder.reset();
1384  return mpTextForwarder.get();
1385 }
1386 
1388 {
1389  if( !mpViewForwarder )
1391  return mpViewForwarder.get();
1392 }
1393 
1395 {
1396  return nullptr;
1397 }
1398 
1399 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScAccessibleCell * mpAccessibleCell
Point TopLeft() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
bool GetValue() const
long Width() 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
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
long Height() const
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:333
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
virtual Size GetSizePixel() const
std::unique_ptr< ScPreviewViewForwarder > mpViewForwarder
sal_uInt16 GetValue() const
virtual void StartEditEngine() override
Definition: inputwin.cxx:1391
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:2004
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)
ScAccessibleEditLineTextData(EditView *pEditView, OutputDevice *pWin)
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)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual ScAccessibleTextData * Clone() const override
ScTabViewShell * mpViewShell
VclPtr< OutputDevice > mpWindow
virtual SvxViewForwarder * GetViewForwarder() override
virtual void InsertAccessibleTextData(ScAccessibleEditLineTextData &rTextData) override
Definition: inputwin.cxx:2078
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:4717
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
virtual EditView * GetEditView() override
Definition: inputwin.cxx:1309
virtual bool HasEditView() const override
Definition: inputwin.cxx:1316
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
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:3768
void GrabFocus()
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:879
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:2009
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:887
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
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
virtual Point LogicToPixel(const Point &rPoint, const MapMode &rMapMode) const override
vcl::Window * GetWindow() const
bool IsDisposed() const
virtual ~ScAccessibleHeaderTextData() override
void SetSelection(const ESelection &rNewSel)
virtual void RemoveAccessibleTextData(ScAccessibleEditLineTextData &rTextData) override
Definition: inputwin.cxx:2085
ViewForwarderPtr mpViewForwarder
OutputDevice * get() const
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
long getHeight() const
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)
long getWidth() const
virtual bool IsValid() const override
void setWidth(long nWidth)
void Paste()
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
bool GetMergeSizePixel(SCCOL nX, SCROW nY, long &rSizeXPix, long &rSizeYPix) const
Definition: viewdata.cxx:2647
constexpr TypedWhichId< SvxMarginItem > ATTR_MARGIN(143)
OutputDevice * GetRefDevice()
Definition: docsh3.cxx:465
bool GetHeaderPosition(tools::Rectangle &rHeaderRect) const
Definition: prevloc.cxx:333
sal_Int16 GetTopMargin() const
void setHeight(long nHeight)