LibreOffice Module svx (master)  1
cell.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 
21 #include <com/sun/star/drawing/BitmapMode.hpp>
22 #include <com/sun/star/style/XStyle.hpp>
23 #include <com/sun/star/text/WritingMode.hpp>
24 #include <com/sun/star/table/TableBorder.hpp>
25 #include <com/sun/star/table/BorderLine2.hpp>
26 #include <com/sun/star/lang/Locale.hpp>
27 
28 #include <comphelper/sequence.hxx>
29 #include <o3tl/any.hxx>
30 #include <svl/style.hxx>
31 #include <svl/itemset.hxx>
32 
33 #include <vcl/svapp.hxx>
34 #include <libxml/xmlwriter.h>
35 
37 #include <editeng/outlobj.hxx>
39 #include <svx/svdotable.hxx>
40 #include <svx/svdoutl.hxx>
41 #include <svx/unoshtxt.hxx>
42 #include <svx/svdmodel.hxx>
43 #include <svx/sdooitm.hxx>
44 #include <svx/sdtagitm.hxx>
45 #include <svx/sdmetitm.hxx>
46 #include <svx/xit.hxx>
47 #include <getallcharpropids.hxx>
48 #include "tableundo.hxx"
49 #include <cell.hxx>
50 #include <svx/unoshprp.hxx>
51 #include <svx/unoshape.hxx>
52 #include <editeng/editobj.hxx>
53 #include <editeng/borderline.hxx>
54 #include <editeng/boxitem.hxx>
56 #include <svx/xflbstit.hxx>
57 #include <svx/xflbmtit.hxx>
58 #include <svx/svdpool.hxx>
59 #include <tools/diagnose_ex.h>
60 
61 
62 using ::editeng::SvxBorderLine;
63 using namespace ::com::sun::star::uno;
64 using namespace ::com::sun::star::beans;
65 using namespace ::com::sun::star::lang;
66 using namespace ::com::sun::star::text;
67 using namespace ::com::sun::star::table;
68 using namespace ::com::sun::star::drawing;
69 using namespace ::com::sun::star::style;
70 using namespace ::com::sun::star::container;
71 
72 
74 {
75  // property map for an outliner text
76  static const SfxItemPropertyMapEntry aSvxCellPropertyMap[] =
77  {
79 // { "HasLevels", OWN_ATTR_HASLEVELS, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY, 0},
80  { u"Style", OWN_ATTR_STYLE, cppu::UnoType< css::style::XStyle >::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
83  { u"" UNO_NAME_TEXT_LEFTDIST, SDRATTR_TEXT_LEFTDIST, cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
84  { u"" UNO_NAME_TEXT_LOWERDIST, SDRATTR_TEXT_LOWERDIST, cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
85  { u"" UNO_NAME_TEXT_RIGHTDIST, SDRATTR_TEXT_RIGHTDIST, cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
86  { u"" UNO_NAME_TEXT_UPPERDIST, SDRATTR_TEXT_UPPERDIST, cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
89 
90  { u"TableBorder", OWN_ATTR_TABLEBORDER, cppu::UnoType<TableBorder>::get(), 0, 0 },
96 
100  { u"", 0, css::uno::Type(), 0, 0 }
101  };
102 
103  static SvxItemPropertySet aSvxCellPropertySet( aSvxCellPropertyMap, SdrObject::GetGlobalDrawObjectItemPool() );
104  return &aSvxCellPropertySet;
105 }
106 
107 namespace
108 {
109 
110 class CellTextProvider : public svx::ITextProvider
111 {
112 public:
113  explicit CellTextProvider(const sdr::table::CellRef& rCell);
114  virtual ~CellTextProvider();
115 
116 private:
117  virtual sal_Int32 getTextCount() const override;
118  virtual SdrText* getText(sal_Int32 nIndex) const override;
119 
120 private:
121  const sdr::table::CellRef m_xCell;
122 };
123 
124 CellTextProvider::CellTextProvider(const sdr::table::CellRef& rCell)
125  : m_xCell(rCell)
126 {
127 }
128 
129 CellTextProvider::~CellTextProvider()
130 {
131 }
132 
133 sal_Int32 CellTextProvider::getTextCount() const
134 {
135  return 1;
136 }
137 
138 SdrText* CellTextProvider::getText(sal_Int32 nIndex) const
139 {
140  (void) nIndex;
141  assert(nIndex == 0);
142  return m_xCell.get();
143 }
144 
145 }
146 
147 namespace sdr::properties
148 {
150  {
151  protected:
152  // create a new itemset
154 
155  const svx::ITextProvider& getTextProvider() const override;
156 
157  public:
158  // basic constructor
159  CellProperties(SdrObject& rObj, sdr::table::Cell* pCell );
160 
161  // constructor for copying, but using new object
162  CellProperties(const CellProperties& rProps, SdrObject& rObj, sdr::table::Cell* pCell);
163 
164  // Clone() operator, normally just calls the local copy constructor
165  std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override;
166 
167  void ForceDefaultAttributes() override;
168 
169  void ItemSetChanged(const SfxItemSet*) override;
170 
171  void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override;
172 
174 
175  private:
176  const CellTextProvider maTextProvider;
177  };
178 
179  // create a new itemset
181  {
182  return SfxItemSet(rPool,
183 
184  // range from SdrAttrObj
188 
189  // range for SdrTableObj
191 
192  // range from SdrTextObj
194  }
195 
197  {
198  return maTextProvider;
199  }
200 
201  CellProperties::CellProperties(SdrObject& rObj, sdr::table::Cell* pCell)
202  : TextProperties(rObj)
203  , mxCell(pCell)
204  , maTextProvider(mxCell)
205  {
206  }
207 
208  CellProperties::CellProperties(const CellProperties& rProps, SdrObject& rObj, sdr::table::Cell* pCell)
209  : TextProperties(rProps, rObj)
210  , mxCell( pCell )
211  , maTextProvider(mxCell)
212  {
213  }
214 
215  std::unique_ptr<BaseProperties> CellProperties::Clone(SdrObject& rObj) const
216  {
217  OSL_FAIL("CellProperties::Clone(), does not work yet!");
218  return std::unique_ptr<BaseProperties>(new CellProperties(*this, rObj,nullptr));
219  }
220 
222  {
223  }
224 
226  {
227  SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject());
228 
229  if( mxCell.is() )
230  {
231  std::optional<OutlinerParaObject> pParaObj = mxCell->CreateEditOutlinerParaObject();
232 
233  if( !pParaObj && mxCell->GetOutlinerParaObject())
234  pParaObj = *mxCell->GetOutlinerParaObject();
235 
236  if(pParaObj)
237  {
238  // handle outliner attributes
239  Outliner* pOutliner = nullptr;
240 
241  if(mxCell->IsTextEditActive())
242  {
243  pOutliner = rObj.GetTextEditOutliner();
244  }
245  else
246  {
247  pOutliner = &rObj.ImpGetDrawOutliner();
248  pOutliner->SetText(*pParaObj);
249  }
250 
251  sal_Int32 nParaCount(pOutliner->GetParagraphCount());
252 
253  // if the user sets character attributes to the complete
254  // cell we want to remove all hard set character attributes
255  // with same which ids from the text
256  std::vector<sal_uInt16> aCharWhichIds(GetAllCharPropIds(*pSet));
257 
258  for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
259  {
260  SfxItemSet aSet(pOutliner->GetParaAttribs(nPara));
261  aSet.Put(*pSet);
262 
263  for (const auto& rWhichId : aCharWhichIds)
264  {
265  pOutliner->RemoveCharAttribs(nPara, rWhichId);
266  }
267 
268  pOutliner->SetParaAttribs(nPara, aSet);
269  }
270 
271  if(!mxCell->IsTextEditActive())
272  {
273  if(nParaCount)
274  {
275  // force ItemSet
277 
278  SfxItemSet aNewSet(pOutliner->GetParaAttribs(0));
279  mxItemSet->Put(aNewSet);
280  }
281 
282  std::optional<OutlinerParaObject> pTemp = pOutliner->CreateParaObject(0, nParaCount);
283  pOutliner->Clear();
284  mxCell->SetOutlinerParaObject(std::move(pTemp));
285  }
286 
287  }
288  }
289 
290  // call parent
292 
293  if( mxCell.is() )
294  mxCell->notifyModified();
295  }
296 
297  void CellProperties::ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem)
298  {
299  if(pNewItem && (SDRATTR_TEXTDIRECTION == nWhich))
300  {
301  bool bVertical(css::text::WritingMode_TB_RL == static_cast<const SvxWritingModeItem*>(pNewItem)->GetValue());
302 
304  rObj.SetVerticalWriting(bVertical);
305 
306  // Set a cell vertical property
307  std::optional<OutlinerParaObject> pParaObj = mxCell->CreateEditOutlinerParaObject();
308 
309  if( !pParaObj && mxCell->GetOutlinerParaObject() )
310  pParaObj = *mxCell->GetOutlinerParaObject();
311 
312  if(pParaObj)
313  {
314  pParaObj->SetVertical(bVertical);
315  }
316  }
317 
318  if (pNewItem && (SDRATTR_TABLE_TEXT_ROTATION == nWhich))
319  {
320  const SvxTextRotateItem* pRotateItem = static_cast<const SvxTextRotateItem*>(pNewItem);
321 
322  // Set a cell vertical property
323  std::optional<OutlinerParaObject> pParaObj = mxCell->CreateEditOutlinerParaObject();
324 
325  if (!pParaObj && mxCell->GetOutlinerParaObject())
326  pParaObj = *mxCell->GetOutlinerParaObject();
327 
328  if (pParaObj)
329  {
330  if(pRotateItem->IsVertical() && pRotateItem->IsTopToBottom())
331  pParaObj->SetRotation(TextRotation::TOPTOBOTTOM);
332  else if (pRotateItem->IsVertical())
333  pParaObj->SetRotation(TextRotation::BOTTOMTOTOP);
334  else
335  pParaObj->SetRotation(TextRotation::NONE);
336  }
337 
338  // Change autogrow direction
339  SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject());
340 
341  // rescue object size
342  tools::Rectangle aObjectRect = rObj.GetSnapRect();
343 
344  const SfxItemSet& rSet = rObj.GetObjectItemSet();
345  bool bAutoGrowWidth = rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue();
346  bool bAutoGrowHeight = rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue();
347 
348  // prepare ItemSet to set exchanged width and height items
349  SfxItemSet aNewSet(*rSet.GetPool(),
350  svl::Items<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT>);
351 
352  aNewSet.Put(rSet);
353  aNewSet.Put(makeSdrTextAutoGrowWidthItem(bAutoGrowHeight));
354  aNewSet.Put(makeSdrTextAutoGrowHeightItem(bAutoGrowWidth));
355  rObj.SetObjectItemSet(aNewSet);
356 
357  // restore object size
358  rObj.SetSnapRect(aObjectRect);
359  }
360 
361  // call parent
362  AttributeProperties::ItemChange( nWhich, pNewItem );
363  }
364 
365 } // end of namespace sdr::properties
366 
367 namespace sdr::table {
368 
369 
370 // Cell
371 
372 
373 rtl::Reference< Cell > Cell::create( SdrTableObj& rTableObj )
374 {
375  rtl::Reference< Cell > xCell( new Cell( rTableObj ) );
376  if( xCell->mxTable.is() )
377  {
378  xCell->mxTable->addEventListener( xCell );
379  }
380  return xCell;
381 }
382 
383 
384 Cell::Cell(
385  SdrTableObj& rTableObj)
386 : SdrText(rTableObj)
388  ,mpPropSet( ImplGetSvxCellPropertySet() )
389  ,mpProperties( new sdr::properties::CellProperties( rTableObj, this ) )
390  ,mnCellContentType( CellContentType_EMPTY )
391  ,mfValue( 0.0 )
392  ,mnError( 0 )
393  ,mbMerged( false )
394  ,mnRowSpan( 1 )
395  ,mnColSpan( 1 )
396  ,mxTable( rTableObj.getTable() )
397 {
398  // Caution: Old SetModel() indirectly did a very necessary thing here,
399  // it created a valid SvxTextEditSource which is needed to bind contained
400  // Text to the UNO API and thus to save/load and more. Added version without
401  // model change.
402  // Also done was (not needed, for reference):
403  // SetStyleSheet( nullptr, true );
404  // ForceOutlinerParaObject( OutlinerMode::TextObject );
405  if(nullptr == GetEditSource())
406  {
407  SetEditSource(new SvxTextEditSource(&GetObject(), this));
408  }
409 }
410 
411 Cell::~Cell() COVERITY_NOEXCEPT_FALSE
412 {
413  dispose();
414 }
415 
416 void Cell::dispose()
417 {
418  if( mxTable.is() )
419  {
420  try
421  {
422  Reference< XEventListener > xThis( this );
423  mxTable->removeEventListener( xThis );
424  }
425  catch( Exception& )
426  {
427  TOOLS_WARN_EXCEPTION("svx.table", "");
428  }
429  mxTable.clear();
430  }
431 
432  // tdf#118199 avoid double dispose, detect by using mpProperties
433  // as indicator. Only use SetOutlinerParaObject once
434  if( mpProperties )
435  {
436  mpProperties.reset();
437  SetOutlinerParaObject( std::nullopt );
438  }
439 }
440 
441 void Cell::merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan )
442 {
443  if ((mnColSpan != nColumnSpan) || (mnRowSpan != nRowSpan) || mbMerged)
444  {
445  mnColSpan = nColumnSpan;
446  mnRowSpan = nRowSpan;
447  mbMerged = false;
448  notifyModified();
449  }
450 }
451 
452 
453 void Cell::mergeContent( const CellRef& xSourceCell )
454 {
455  SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
456 
457  if( !xSourceCell->hasText() )
458  return;
459 
460  SdrOutliner& rOutliner=rTableObj.ImpGetDrawOutliner();
461  rOutliner.SetUpdateLayout(true);
462 
463  if( hasText() )
464  {
465  rOutliner.SetText(*GetOutlinerParaObject());
466  rOutliner.AddText(*xSourceCell->GetOutlinerParaObject());
467  }
468  else
469  {
470  rOutliner.SetText(*xSourceCell->GetOutlinerParaObject());
471  }
472 
473  SetOutlinerParaObject( rOutliner.CreateParaObject() );
474  rOutliner.Clear();
475  xSourceCell->SetOutlinerParaObject(rOutliner.CreateParaObject());
476  rOutliner.Clear();
477  SetStyleSheet( GetStyleSheet(), true );
478 }
479 
480 
481 void Cell::cloneFrom( const CellRef& xCell )
482 {
483  if( xCell.is() )
484  {
485  replaceContentAndFormatting( xCell );
486 
487  mnCellContentType = xCell->mnCellContentType;
488 
489  msFormula = xCell->msFormula;
490  mfValue = xCell->mfValue;
491  mnError = xCell->mnError;
492 
493  mbMerged = xCell->mbMerged;
494  mnRowSpan = xCell->mnRowSpan;
495  mnColSpan = xCell->mnColSpan;
496 
497  }
498  notifyModified();
499 }
500 
501 void Cell::replaceContentAndFormatting( const CellRef& xSourceCell )
502 {
503  if( !(xSourceCell.is() && mpProperties) )
504  return;
505 
506  mpProperties->SetMergedItemSet( xSourceCell->GetObjectItemSet() );
507 
508  // tdf#118354 OutlinerParaObject may be nullptr, do not dereference when
509  // not set (!)
510  if(xSourceCell->GetOutlinerParaObject())
511  {
512  SetOutlinerParaObject( *xSourceCell->GetOutlinerParaObject() );
513  }
514 
515  SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
516  SdrTableObj& rSourceTableObj = dynamic_cast< SdrTableObj& >( xSourceCell->GetObject() );
517 
518  if(&rSourceTableObj.getSdrModelFromSdrObject() != &rTableObj.getSdrModelFromSdrObject())
519  {
520  // TTTT should not happen - if, then a clone may be needed
521  // Maybe add an assertion here later
522  SetStyleSheet( nullptr, true );
523  }
524 }
525 
526 
527 void Cell::setMerged()
528 {
529  if( !mbMerged )
530  {
531  mbMerged = true;
532  notifyModified();
533  }
534 }
535 
536 
537 void Cell::copyFormatFrom( const CellRef& xSourceCell )
538 {
539  if( !(xSourceCell.is() && mpProperties) )
540  return;
541 
542  mpProperties->SetMergedItemSet( xSourceCell->GetObjectItemSet() );
543  SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
544  SdrTableObj& rSourceTableObj = dynamic_cast< SdrTableObj& >( xSourceCell->GetObject() );
545 
546  if(&rSourceTableObj.getSdrModelFromSdrObject() != &rTableObj.getSdrModelFromSdrObject())
547  {
548  // TTTT should not happen - if, then a clone may be needed
549  // Maybe add an assertion here later
550  SetStyleSheet( nullptr, true );
551  }
552 
553  notifyModified();
554 }
555 
556 
557 void Cell::notifyModified()
558 {
559  if( mxTable.is() )
560  mxTable->setModified( true );
561 }
562 
563 
564 // SdrTextShape proxy
565 
566 
567 bool Cell::IsActiveCell() const
568 {
569  bool isActive = false;
570  SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
571  if( rTableObj.getActiveCell().get() == this )
572  isActive = true;
573 
574  return isActive;
575 }
576 
577 bool Cell::IsTextEditActive() const
578 {
579  bool isActive = false;
580  SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
581  if(rTableObj.getActiveCell().get() == this )
582  {
583  if( rTableObj.CanCreateEditOutlinerParaObject() )
584  {
585  isActive = true;
586  }
587  }
588  return isActive;
589 }
590 
591 
592 bool Cell::hasText() const
593 {
594  const OutlinerParaObject* pParaObj = GetOutlinerParaObject();
595  if( pParaObj )
596  {
597  const EditTextObject& rTextObj = pParaObj->GetTextObject();
598  if( rTextObj.GetParagraphCount() >= 1 )
599  {
600  if( rTextObj.GetParagraphCount() == 1 )
601  {
602  if( rTextObj.GetText(0).isEmpty() )
603  return false;
604  }
605  return true;
606  }
607  }
608 
609  return false;
610 }
611 
612 bool Cell::CanCreateEditOutlinerParaObject() const
613 {
614  SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
615  if( rTableObj.getActiveCell().get() == this )
616  return rTableObj.CanCreateEditOutlinerParaObject();
617  return false;
618 }
619 
620 std::optional<OutlinerParaObject> Cell::CreateEditOutlinerParaObject() const
621 {
622  SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
623  if( rTableObj.getActiveCell().get() == this )
624  return rTableObj.CreateEditOutlinerParaObject();
625  return std::nullopt;
626 }
627 
628 
629 void Cell::SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr )
630 {
631  // only allow cell styles for cells
632  if( pStyleSheet && pStyleSheet->GetFamily() != SfxStyleFamily::Frame )
633  return;
634 
635  if( mpProperties && (mpProperties->GetStyleSheet() != pStyleSheet) )
636  {
637  mpProperties->SetStyleSheet( pStyleSheet, bDontRemoveHardAttr );
638  }
639 }
640 
641 
642 const SfxItemSet& Cell::GetObjectItemSet()
643 {
644  if( mpProperties )
645  {
646  return mpProperties->GetObjectItemSet();
647  }
648  else
649  {
650  OSL_FAIL("Cell::GetObjectItemSet(), called without properties!");
651  return GetObject().GetObjectItemSet();
652  }
653 }
654 
655 void Cell::SetObjectItem(const SfxPoolItem& rItem)
656 {
657  if( mpProperties )
658  {
659  mpProperties->SetObjectItem( rItem );
660  notifyModified();
661  }
662 }
663 
664 void Cell::SetMergedItem(const SfxPoolItem& rItem)
665 {
666  SetObjectItem(rItem);
667 }
668 
669 SfxStyleSheet* Cell::GetStyleSheet() const
670 {
671  if( mpProperties )
672  return mpProperties->GetStyleSheet();
673  else
674  return nullptr;
675 }
676 
677 void Cell::TakeTextAnchorRect(tools::Rectangle& rAnchorRect) const
678 {
679  rAnchorRect.SetLeft( maCellRect.Left() + GetTextLeftDistance() );
680  rAnchorRect.SetRight( maCellRect.Right() - GetTextRightDistance() );
681  rAnchorRect.SetTop( maCellRect.Top() + GetTextUpperDistance() );
682  rAnchorRect.SetBottom( maCellRect.Bottom() - GetTextLowerDistance() );
683 }
684 
685 
686 void Cell::SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems)
687 {
688  if( mpProperties )
689  {
690  mpProperties->SetMergedItemSetAndBroadcast(rSet, bClearAllItems);
691  notifyModified();
692  }
693 }
694 
695 
696 sal_Int32 Cell::calcPreferredWidth( const Size aSize )
697 {
698  if ( !hasText() )
699  return getMinimumWidth();
700 
701  Outliner& rOutliner=static_cast< SdrTableObj& >( GetObject() ).ImpGetDrawOutliner();
702  rOutliner.SetPaperSize(aSize);
703  rOutliner.SetUpdateLayout(true);
704  ForceOutlinerParaObject( OutlinerMode::TextObject );
705 
706  if( GetOutlinerParaObject() )
707  rOutliner.SetText(*GetOutlinerParaObject());
708 
709  sal_Int32 nPreferredWidth = const_cast<EditEngine&>(rOutliner.GetEditEngine()).CalcTextWidth();
710  rOutliner.Clear();
711 
712  return GetTextLeftDistance() + GetTextRightDistance() + nPreferredWidth;
713 }
714 
715 sal_Int32 Cell::getMinimumWidth() const
716 {
717  return GetTextLeftDistance() + GetTextRightDistance() + 100;
718 }
719 
720 
721 sal_Int32 Cell::getMinimumHeight()
722 {
723  if( !mpProperties )
724  return 0;
725 
726  SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
727  sal_Int32 nMinimumHeight = 0;
728 
729  tools::Rectangle aTextRect;
730  TakeTextAnchorRect( aTextRect );
731  Size aSize( aTextRect.GetSize() );
732  aSize.setHeight(0x0FFFFFFF );
733 
734  SdrOutliner* pEditOutliner = rTableObj.GetCellTextEditOutliner( *this );
735  if(pEditOutliner)
736  {
737  pEditOutliner->SetMaxAutoPaperSize(aSize);
738  nMinimumHeight = pEditOutliner->GetTextHeight()+1;
739  }
740  else
741  {
742  Outliner& rOutliner=rTableObj.ImpGetDrawOutliner();
743  rOutliner.SetPaperSize(aSize);
744  rOutliner.SetUpdateLayout(true);
745  ForceOutlinerParaObject( OutlinerMode::TextObject );
746 
747  if( GetOutlinerParaObject() )
748  {
749  rOutliner.SetText(*GetOutlinerParaObject());
750  }
751  nMinimumHeight=rOutliner.GetTextHeight()+1;
752  rOutliner.Clear();
753  }
754 
755  nMinimumHeight += GetTextUpperDistance() + GetTextLowerDistance();
756  return nMinimumHeight;
757 }
758 
759 
760 tools::Long Cell::GetTextLeftDistance() const
761 {
762  return GetItemSet().Get(SDRATTR_TEXT_LEFTDIST).GetValue();
763 }
764 
765 
766 tools::Long Cell::GetTextRightDistance() const
767 {
768  return GetItemSet().Get(SDRATTR_TEXT_RIGHTDIST).GetValue();
769 }
770 
771 
772 tools::Long Cell::GetTextUpperDistance() const
773 {
774  return GetItemSet().Get(SDRATTR_TEXT_UPPERDIST).GetValue();
775 }
776 
777 
778 tools::Long Cell::GetTextLowerDistance() const
779 {
780  return GetItemSet().Get(SDRATTR_TEXT_LOWERDIST).GetValue();
781 }
782 
783 
784 SdrTextVertAdjust Cell::GetTextVerticalAdjust() const
785 {
786  return GetItemSet().Get(SDRATTR_TEXT_VERTADJUST).GetValue();
787 }
788 
789 
790 SdrTextHorzAdjust Cell::GetTextHorizontalAdjust() const
791 {
792  return GetItemSet().Get(SDRATTR_TEXT_HORZADJUST).GetValue();
793 }
794 
795 
796 void Cell::SetOutlinerParaObject( std::optional<OutlinerParaObject> pTextObject )
797 {
798  bool bNullTextObject = !pTextObject;
799  SdrText::SetOutlinerParaObject( std::move(pTextObject) );
800  maSelection.nStartPara = EE_PARA_MAX_COUNT;
801 
802  if( bNullTextObject )
803  ForceOutlinerParaObject( OutlinerMode::TextObject );
804 }
805 
806 
807 void Cell::AddUndo()
808 {
809  SdrObject& rObj = GetObject();
810 
811  if( rObj.IsInserted() && rObj.getSdrModelFromSdrObject().IsUndoEnabled() )
812  {
813  CellRef xCell( this );
814  rObj.getSdrModelFromSdrObject().AddUndo( std::make_unique<CellUndo>( &rObj, xCell ) );
815 
816  // Undo action for the after-text-edit-ended stack.
817  SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(&rObj);
818  if (pTableObj && pTableObj->IsTextEditActive())
819  pTableObj->AddUndo(new CellUndo(pTableObj, xCell));
820  }
821 }
822 
823 
824 sdr::properties::TextProperties* Cell::CloneProperties( sdr::properties::TextProperties const * pProperties, SdrObject& rNewObj, Cell& rNewCell )
825 {
826  if( pProperties )
827  return new sdr::properties::CellProperties( *static_cast<sdr::properties::CellProperties const *>(pProperties), rNewObj, &rNewCell );
828  else
829  return nullptr;
830 }
831 
832 
833 sdr::properties::TextProperties* Cell::CloneProperties( SdrObject& rNewObj, Cell& rNewCell )
834 {
835  return CloneProperties(mpProperties.get(),rNewObj,rNewCell);
836 }
837 
838 
839 // XInterface
840 
841 
842 Any SAL_CALL Cell::queryInterface( const Type & rType )
843 {
844  if( rType == cppu::UnoType<XMergeableCell>::get() )
845  return Any( Reference< XMergeableCell >( this ) );
846 
847  if( rType == cppu::UnoType<XCell>::get() )
848  return Any( Reference< XCell >( this ) );
849 
851  return Any( Reference< XLayoutConstrains >( this ) );
852 
853  if( rType == cppu::UnoType<XEventListener>::get() )
854  return Any( Reference< XEventListener >( this ) );
855 
856  Any aRet( SvxUnoTextBase::queryAggregation( rType ) );
857  if( aRet.hasValue() )
858  return aRet;
859 
860  return ::cppu::OWeakObject::queryInterface( rType );
861 }
862 
863 
864 void SAL_CALL Cell::acquire() noexcept
865 {
867 }
868 
869 
870 void SAL_CALL Cell::release() noexcept
871 {
873 }
874 
875 
876 // XTypeProvider
877 
878 
879 Sequence< Type > SAL_CALL Cell::getTypes( )
880 {
882  Sequence {
885 }
886 
887 
888 Sequence< sal_Int8 > SAL_CALL Cell::getImplementationId( )
889 {
890  return css::uno::Sequence<sal_Int8>();
891 }
892 
893 // XLayoutConstrains
894 css::awt::Size SAL_CALL Cell::getMinimumSize()
895 {
896  return css::awt::Size( getMinimumWidth(), getMinimumHeight() );
897 }
898 
899 
900 css::awt::Size SAL_CALL Cell::getPreferredSize()
901 {
902  return getMinimumSize();
903 }
904 
905 
906 css::awt::Size SAL_CALL Cell::calcAdjustedSize( const css::awt::Size& aNewSize )
907 {
908  return aNewSize;
909 }
910 
911 
912 // XMergeableCell
913 
914 
915 sal_Int32 SAL_CALL Cell::getRowSpan()
916 {
917  return mnRowSpan;
918 }
919 
920 
921 sal_Int32 SAL_CALL Cell::getColumnSpan()
922 {
923  return mnColSpan;
924 }
925 
926 
927 sal_Bool SAL_CALL Cell::isMerged()
928 {
929  return mbMerged;
930 }
931 
932 
933 // XCell
934 
935 
936 OUString SAL_CALL Cell::getFormula( )
937 {
938  return msFormula;
939 }
940 
941 
942 void SAL_CALL Cell::setFormula( const OUString& aFormula )
943 {
944  if( msFormula != aFormula )
945  {
946  msFormula = aFormula;
947  }
948 }
949 
950 
951 double SAL_CALL Cell::getValue( )
952 {
953  return mfValue;
954 }
955 
956 
957 void SAL_CALL Cell::setValue( double nValue )
958 {
959  if( mfValue != nValue )
960  {
961  mfValue = nValue;
962  mnCellContentType = CellContentType_VALUE;
963  }
964 }
965 
966 
967 CellContentType SAL_CALL Cell::getType()
968 {
969  return mnCellContentType;
970 }
971 
972 
973 sal_Int32 SAL_CALL Cell::getError( )
974 {
975  return mnError;
976 }
977 
978 
979 // XPropertySet
980 
981 
982 Any Cell::GetAnyForItem( SfxItemSet const & aSet, const SfxItemPropertyMapEntry* pMap )
983 {
984  Any aAny( SvxItemPropertySet_getPropertyValue( pMap, aSet ) );
985 
986  if( pMap->aType != aAny.getValueType() )
987  {
988  // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here
989  if( ( pMap->aType == ::cppu::UnoType<sal_Int16>::get()) && aAny.getValueType() == ::cppu::UnoType<sal_Int32>::get() )
990  {
991  sal_Int32 nValue = 0;
992  aAny >>= nValue;
993  aAny <<= static_cast<sal_Int16>(nValue);
994  }
995  else
996  {
997  OSL_FAIL("GetAnyForItem() Returnvalue has wrong Type!" );
998  }
999  }
1000 
1001  return aAny;
1002 }
1003 
1004 Reference< XPropertySetInfo > SAL_CALL Cell::getPropertySetInfo()
1005 {
1006  return mpPropSet->getPropertySetInfo();
1007 }
1008 
1009 
1010 void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any& rValue )
1011 {
1012  ::SolarMutexGuard aGuard;
1013 
1014  if(mpProperties == nullptr)
1015  throw DisposedException();
1016 
1017  const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(rPropertyName);
1018  if( pMap )
1019  {
1020  if( (pMap->nFlags & PropertyAttribute::READONLY ) != 0 )
1021  throw PropertyVetoException();
1022 
1023  switch( pMap->nWID )
1024  {
1025  case OWN_ATTR_STYLE:
1026  {
1027  Reference< XStyle > xStyle;
1028  if( !( rValue >>= xStyle ) )
1029  throw IllegalArgumentException();
1030 
1032  SetStyleSheet( pStyle, true );
1033  return;
1034  }
1035  case OWN_ATTR_TABLEBORDER:
1036  {
1037  auto pBorder = o3tl::tryAccess<TableBorder>(rValue);
1038  if(!pBorder)
1039  break;
1040 
1043  SvxBorderLine aLine;
1044 
1045  bool bSet = SvxBoxItem::LineToSvxLine(pBorder->TopLine, aLine, false);
1046  aBox.SetLine(bSet ? &aLine : nullptr, SvxBoxItemLine::TOP);
1047  aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::TOP, pBorder->IsTopLineValid);
1048 
1049  bSet = SvxBoxItem::LineToSvxLine(pBorder->BottomLine, aLine, false);
1050  aBox.SetLine(bSet ? &aLine : nullptr, SvxBoxItemLine::BOTTOM);
1051  aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::BOTTOM, pBorder->IsBottomLineValid);
1052 
1053  bSet = SvxBoxItem::LineToSvxLine(pBorder->LeftLine, aLine, false);
1054  aBox.SetLine(bSet ? &aLine : nullptr, SvxBoxItemLine::LEFT);
1055  aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::LEFT, pBorder->IsLeftLineValid);
1056 
1057  bSet = SvxBoxItem::LineToSvxLine(pBorder->RightLine, aLine, false);
1058  aBox.SetLine(bSet ? &aLine : nullptr, SvxBoxItemLine::RIGHT);
1059  aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::RIGHT, pBorder->IsRightLineValid);
1060 
1061  bSet = SvxBoxItem::LineToSvxLine(pBorder->HorizontalLine, aLine, false);
1062  aBoxInfo.SetLine(bSet ? &aLine : nullptr, SvxBoxInfoItemLine::HORI);
1063  aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::HORI, pBorder->IsHorizontalLineValid);
1064 
1065  bSet = SvxBoxItem::LineToSvxLine(pBorder->VerticalLine, aLine, false);
1066  aBoxInfo.SetLine(bSet ? &aLine : nullptr, SvxBoxInfoItemLine::VERT);
1067  aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::VERT, pBorder->IsVerticalLineValid);
1068 
1069  aBox.SetAllDistances(pBorder->Distance); //TODO
1070  aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::DISTANCE, pBorder->IsDistanceValid);
1071 
1072  mpProperties->SetObjectItem(aBox);
1073  mpProperties->SetObjectItem(aBoxInfo);
1074  return;
1075  }
1076  case OWN_ATTR_FILLBMP_MODE:
1077  {
1078  BitmapMode eMode;
1079  if(!(rValue >>= eMode) )
1080  {
1081  sal_Int32 nMode = 0;
1082  if(!(rValue >>= nMode))
1083  throw IllegalArgumentException();
1084 
1085  eMode = static_cast<BitmapMode>(nMode);
1086  }
1087 
1088  mpProperties->SetObjectItem( XFillBmpStretchItem( eMode == BitmapMode_STRETCH ) );
1089  mpProperties->SetObjectItem( XFillBmpTileItem( eMode == BitmapMode_REPEAT ) );
1090  return;
1091  }
1093  {
1094  sal_Int32 nRotVal = 0;
1095  if (!(rValue >>= nRotVal))
1096  throw IllegalArgumentException();
1097 
1098  if (nRotVal != 27000 && nRotVal != 9000 && nRotVal != 0)
1099  throw IllegalArgumentException();
1100 
1101  mpProperties->SetObjectItem(SvxTextRotateItem(Degree10(nRotVal/10), SDRATTR_TABLE_TEXT_ROTATION));
1102  return;
1103  }
1104  default:
1105  {
1106  SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
1107  aSet.Put(mpProperties->GetItem(pMap->nWID));
1108 
1109  bool bSpecial = false;
1110 
1111  switch( pMap->nWID )
1112  {
1113  case XATTR_FILLBITMAP:
1114  case XATTR_FILLGRADIENT:
1115  case XATTR_FILLHATCH:
1117  case XATTR_LINEEND:
1118  case XATTR_LINESTART:
1119  case XATTR_LINEDASH:
1120  {
1121  if( pMap->nMemberId == MID_NAME )
1122  {
1123  OUString aApiName;
1124  if( rValue >>= aApiName )
1125  {
1126  if(SvxShape::SetFillAttribute(pMap->nWID, aApiName, aSet, &GetObject().getSdrModelFromSdrObject()))
1127  bSpecial = true;
1128  }
1129  }
1130  }
1131  break;
1132  }
1133 
1134  if( !bSpecial )
1135  {
1136 
1137  if( !SvxUnoTextRangeBase::SetPropertyValueHelper( pMap, rValue, aSet ))
1138  {
1139  if( aSet.GetItemState( pMap->nWID ) != SfxItemState::SET )
1140  {
1141  // fetch the default from ItemPool
1142  if(SfxItemPool::IsWhich(pMap->nWID))
1143  aSet.Put(GetObject().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
1144  }
1145 
1146  if( aSet.GetItemState( pMap->nWID ) == SfxItemState::SET )
1147  {
1148  SvxItemPropertySet_setPropertyValue( pMap, rValue, aSet );
1149  }
1150  }
1151  }
1152 
1153  GetObject().getSdrModelFromSdrObject().SetChanged();
1154  mpProperties->SetMergedItemSetAndBroadcast( aSet );
1155  return;
1156  }
1157  }
1158  }
1159  throw UnknownPropertyException( rPropertyName, static_cast<cppu::OWeakObject*>(this));
1160 }
1161 
1162 
1163 Any SAL_CALL Cell::getPropertyValue( const OUString& PropertyName )
1164 {
1165  ::SolarMutexGuard aGuard;
1166 
1167  if(mpProperties == nullptr)
1168  throw DisposedException();
1169 
1170  const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
1171  if( pMap )
1172  {
1173  switch( pMap->nWID )
1174  {
1175  case OWN_ATTR_STYLE:
1176  {
1177  return Any( Reference< XStyle >( dynamic_cast< SfxUnoStyleSheet* >( GetStyleSheet() ) ) );
1178  }
1179  case OWN_ATTR_TABLEBORDER:
1180  {
1181  const SvxBoxInfoItem& rBoxInfoItem = mpProperties->GetItem(SDRATTR_TABLE_BORDER_INNER);
1182  const SvxBoxItem& rBox = mpProperties->GetItem(SDRATTR_TABLE_BORDER);
1183 
1184  TableBorder aTableBorder;
1185  aTableBorder.TopLine = SvxBoxItem::SvxLineToLine(rBox.GetTop(), false);
1186  aTableBorder.IsTopLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::TOP);
1187  aTableBorder.BottomLine = SvxBoxItem::SvxLineToLine(rBox.GetBottom(), false);
1188  aTableBorder.IsBottomLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::BOTTOM);
1189  aTableBorder.LeftLine = SvxBoxItem::SvxLineToLine(rBox.GetLeft(), false);
1190  aTableBorder.IsLeftLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::LEFT);
1191  aTableBorder.RightLine = SvxBoxItem::SvxLineToLine(rBox.GetRight(), false);
1192  aTableBorder.IsRightLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::RIGHT );
1193  aTableBorder.HorizontalLine = SvxBoxItem::SvxLineToLine(rBoxInfoItem.GetHori(), false);
1194  aTableBorder.IsHorizontalLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::HORI);
1195  aTableBorder.VerticalLine = SvxBoxItem::SvxLineToLine(rBoxInfoItem.GetVert(), false);
1196  aTableBorder.IsVerticalLineValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::VERT);
1197  aTableBorder.Distance = rBox.GetSmallestDistance();
1198  aTableBorder.IsDistanceValid = rBoxInfoItem.IsValid(SvxBoxInfoItemValidFlags::DISTANCE);
1199 
1200  return Any( aTableBorder );
1201  }
1202  case OWN_ATTR_FILLBMP_MODE:
1203  {
1204  const XFillBmpStretchItem& rStretchItem = mpProperties->GetItem(XATTR_FILLBMP_STRETCH);
1205  const XFillBmpTileItem& rTileItem = mpProperties->GetItem(XATTR_FILLBMP_TILE);
1206  if( rTileItem.GetValue() )
1207  {
1208  return Any( BitmapMode_REPEAT );
1209  }
1210  else if( rStretchItem.GetValue() )
1211  {
1212  return Any( BitmapMode_STRETCH );
1213  }
1214  else
1215  {
1216  return Any( BitmapMode_NO_REPEAT );
1217  }
1218  }
1220  {
1221  const SvxTextRotateItem& rTextRotate = mpProperties->GetItem(SDRATTR_TABLE_TEXT_ROTATION);
1222  return Any(sal_Int32(rTextRotate.GetValue().get() * 10));
1223  }
1224  default:
1225  {
1226  SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
1227  aSet.Put(mpProperties->GetItem(pMap->nWID));
1228 
1229  Any aAny;
1230  if(!SvxUnoTextRangeBase::GetPropertyValueHelper( aSet, pMap, aAny ))
1231  {
1232  if(!aSet.Count())
1233  {
1234  // fetch the default from ItemPool
1235  if(SfxItemPool::IsWhich(pMap->nWID))
1236  aSet.Put(GetObject().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
1237  }
1238 
1239  if( aSet.Count() )
1240  aAny = GetAnyForItem( aSet, pMap );
1241  }
1242 
1243  return aAny;
1244  }
1245  }
1246  }
1247  throw UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
1248 }
1249 
1250 
1251 void SAL_CALL Cell::addPropertyChangeListener( const OUString& /*aPropertyName*/, const Reference< XPropertyChangeListener >& /*xListener*/ )
1252 {
1253 }
1254 
1255 
1256 void SAL_CALL Cell::removePropertyChangeListener( const OUString& /*aPropertyName*/, const Reference< XPropertyChangeListener >& /*aListener*/ )
1257 {
1258 }
1259 
1260 
1261 void SAL_CALL Cell::addVetoableChangeListener( const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener >& /*aListener*/ )
1262 {
1263 }
1264 
1265 
1266 void SAL_CALL Cell::removeVetoableChangeListener( const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener >& /*aListener*/ )
1267 {
1268 }
1269 
1270 
1271 // XMultiPropertySet
1272 
1273 
1274 void SAL_CALL Cell::setPropertyValues( const Sequence< OUString >& aPropertyNames, const Sequence< Any >& aValues )
1275 {
1276  ::SolarMutexGuard aSolarGuard;
1277 
1278  if(mpProperties == nullptr)
1279  throw DisposedException();
1280 
1281  const sal_Int32 nCount = aPropertyNames.getLength();
1282 
1283  const OUString* pNames = aPropertyNames.getConstArray();
1284  const Any* pValues = aValues.getConstArray();
1285 
1286  for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++, pNames++, pValues++ )
1287  {
1288  try
1289  {
1290  setPropertyValue( *pNames, *pValues );
1291  }
1292  catch( UnknownPropertyException& )
1293  {
1294  TOOLS_WARN_EXCEPTION("svx.table", "unknown property!");
1295  }
1296  catch( Exception& )
1297  {
1298  TOOLS_WARN_EXCEPTION("svx.table", "");
1299  }
1300  }
1301 }
1302 
1303 
1304 Sequence< Any > SAL_CALL Cell::getPropertyValues( const Sequence< OUString >& aPropertyNames )
1305 {
1306  ::SolarMutexGuard aSolarGuard;
1307 
1308  if(mpProperties == nullptr)
1309  throw DisposedException();
1310 
1311  const sal_Int32 nCount = aPropertyNames.getLength();
1312  Sequence< Any > aRet( nCount );
1313  Any* pValue = aRet.getArray();
1314 
1315  for( const OUString& rName : aPropertyNames )
1316  {
1317  try
1318  {
1319  *pValue = getPropertyValue( rName );
1320  }
1321  catch( UnknownPropertyException& )
1322  {
1323  TOOLS_WARN_EXCEPTION("svx.table", "unknown property!");
1324  }
1325  catch( Exception& )
1326  {
1327  TOOLS_WARN_EXCEPTION("svx.table", "");
1328  }
1329  pValue++;
1330  }
1331 
1332  return aRet;
1333 }
1334 
1335 
1336 void SAL_CALL Cell::addPropertiesChangeListener( const Sequence< OUString >& /*aPropertyNames*/, const Reference< XPropertiesChangeListener >& /*xListener*/ )
1337 {
1338 }
1339 
1340 
1341 void SAL_CALL Cell::removePropertiesChangeListener( const Reference< XPropertiesChangeListener >& /*xListener*/ )
1342 {
1343 }
1344 
1345 
1346 void SAL_CALL Cell::firePropertiesChangeEvent( const Sequence< OUString >& /*aPropertyNames*/, const Reference< XPropertiesChangeListener >& /*xListener*/ )
1347 {
1348 }
1349 
1350 
1351 // XPropertyState
1352 
1353 
1354 PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName )
1355 {
1356  ::SolarMutexGuard aGuard;
1357 
1358  if(mpProperties == nullptr)
1359  throw DisposedException();
1360 
1361  const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
1362 
1363  if( pMap )
1364  {
1365  PropertyState eState;
1366  switch( pMap->nWID )
1367  {
1368  case OWN_ATTR_FILLBMP_MODE:
1369  {
1370  const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
1371 
1372  const bool bStretch = rSet.GetItemState( XATTR_FILLBMP_STRETCH, false ) == SfxItemState::SET;
1373  const bool bTile = rSet.GetItemState( XATTR_FILLBMP_TILE, false ) == SfxItemState::SET;
1374  if( bStretch || bTile )
1375  {
1376  eState = PropertyState_DIRECT_VALUE;
1377  }
1378  else
1379  {
1380  eState = PropertyState_DEFAULT_VALUE;
1381  }
1382  break;
1383  }
1384  case OWN_ATTR_STYLE:
1385  {
1386  return PropertyState_DIRECT_VALUE;
1387  }
1388  case OWN_ATTR_TABLEBORDER:
1389  {
1390  const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
1391  if( (rSet.GetItemState( SDRATTR_TABLE_BORDER_INNER, false ) == SfxItemState::DEFAULT) && (rSet.GetItemState( SDRATTR_TABLE_BORDER, false ) == SfxItemState::DEFAULT) )
1392  return PropertyState_DEFAULT_VALUE;
1393 
1394  return PropertyState_DIRECT_VALUE;
1395  }
1396  default:
1397  {
1398  const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
1399 
1400  switch( rSet.GetItemState( pMap->nWID, false ) )
1401  {
1402  case SfxItemState::SET:
1403  eState = PropertyState_DIRECT_VALUE;
1404  break;
1405  case SfxItemState::DEFAULT:
1406  eState = PropertyState_DEFAULT_VALUE;
1407  break;
1408  default:
1409  eState = PropertyState_AMBIGUOUS_VALUE;
1410  break;
1411  }
1412 
1413  // if an item is set, this doesn't mean we want it :)
1414  if( PropertyState_DIRECT_VALUE == eState )
1415  {
1416  switch( pMap->nWID )
1417  {
1418  // the following items are disabled by changing the
1419  // fill style or the line style. so there is no need
1420  // to export items without names which should be empty
1421  case XATTR_FILLBITMAP:
1422  case XATTR_FILLGRADIENT:
1423  case XATTR_FILLHATCH:
1424  case XATTR_LINEDASH:
1425  {
1426  const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>(pMap->nWID);
1427  if( ( pItem == nullptr ) || pItem->GetName().isEmpty() )
1428  eState = PropertyState_DEFAULT_VALUE;
1429  }
1430  break;
1431 
1432  // #i36115#
1433  // If e.g. the LineStart is on NONE and thus the string has length 0, it still
1434  // may be a hard attribute covering the set LineStart of the parent (Style).
1435  // #i37644#
1436  // same is for fill float transparency
1437  case XATTR_LINEEND:
1438  case XATTR_LINESTART:
1440  {
1441  const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>(pMap->nWID);
1442  if( pItem == nullptr )
1443  eState = PropertyState_DEFAULT_VALUE;
1444  }
1445  break;
1446  }
1447  }
1448  }
1449  }
1450  return eState;
1451  }
1452  throw UnknownPropertyException(PropertyName);
1453 }
1454 
1455 
1456 Sequence< PropertyState > SAL_CALL Cell::getPropertyStates( const Sequence< OUString >& aPropertyName )
1457 {
1458  ::SolarMutexGuard aGuard;
1459 
1460  if(mpProperties == nullptr)
1461  throw DisposedException();
1462 
1463  const sal_Int32 nCount = aPropertyName.getLength();
1464  Sequence< PropertyState > aRet( nCount );
1465 
1466  std::transform(aPropertyName.begin(), aPropertyName.end(), aRet.begin(),
1467  [this](const OUString& rName) -> PropertyState {
1468  try
1469  {
1470  return getPropertyState( rName );
1471  }
1472  catch( Exception& )
1473  {
1474  return PropertyState_AMBIGUOUS_VALUE;
1475  }
1476  });
1477 
1478  return aRet;
1479 }
1480 
1481 
1482 void SAL_CALL Cell::setPropertyToDefault( const OUString& PropertyName )
1483 {
1484  ::SolarMutexGuard aGuard;
1485 
1486  if(mpProperties == nullptr)
1487  throw DisposedException();
1488 
1489  const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
1490  if( pMap )
1491  {
1492  switch( pMap->nWID )
1493  {
1494  case OWN_ATTR_FILLBMP_MODE:
1495  {
1496  mpProperties->ClearObjectItem( XATTR_FILLBMP_STRETCH );
1497  mpProperties->ClearObjectItem( XATTR_FILLBMP_TILE );
1498  break;
1499  }
1500  case OWN_ATTR_STYLE:
1501  break;
1502 
1503  case OWN_ATTR_TABLEBORDER:
1504  {
1505  mpProperties->ClearObjectItem( SDRATTR_TABLE_BORDER_INNER );
1506  mpProperties->ClearObjectItem( SDRATTR_TABLE_BORDER );
1507  break;
1508  }
1509 
1510  default:
1511  {
1512  mpProperties->ClearObjectItem( pMap->nWID );
1513  }
1514  }
1515 
1516  GetObject().getSdrModelFromSdrObject().SetChanged();
1517  return;
1518  }
1519  throw UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
1520 }
1521 
1522 
1523 Any SAL_CALL Cell::getPropertyDefault( const OUString& aPropertyName )
1524 {
1525  ::SolarMutexGuard aGuard;
1526 
1527  if(mpProperties == nullptr)
1528  throw DisposedException();
1529 
1530  const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(aPropertyName);
1531  if( pMap )
1532  {
1533  switch( pMap->nWID )
1534  {
1535  case OWN_ATTR_FILLBMP_MODE:
1536  return Any( BitmapMode_NO_REPEAT );
1537 
1538  case OWN_ATTR_STYLE:
1539  {
1540  Reference< XStyle > xStyle;
1541  return Any( xStyle );
1542  }
1543 
1544  case OWN_ATTR_TABLEBORDER:
1545  {
1546  TableBorder aBorder;
1547  return Any( aBorder );
1548  }
1549 
1550  default:
1551  {
1552  if( SfxItemPool::IsWhich(pMap->nWID) )
1553  {
1554  SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
1555  aSet.Put(GetObject().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
1556  return GetAnyForItem( aSet, pMap );
1557  }
1558  }
1559  }
1560  }
1561  throw UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this));
1562 }
1563 
1564 
1565 // XMultiPropertyStates
1566 
1567 
1568 void SAL_CALL Cell::setAllPropertiesToDefault()
1569 {
1570  mpProperties.reset(new sdr::properties::CellProperties( static_cast< SdrTableObj& >( GetObject() ), this ));
1571 
1572  SdrOutliner& rOutliner = GetObject().ImpGetDrawOutliner();
1573 
1574  OutlinerParaObject* pParaObj = GetOutlinerParaObject();
1575  if( !pParaObj )
1576  return;
1577 
1578  rOutliner.SetText(*pParaObj);
1579  sal_Int32 nParaCount(rOutliner.GetParagraphCount());
1580 
1581  if(nParaCount)
1582  {
1583  ESelection aSelection( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL);
1584  rOutliner.RemoveAttribs(aSelection, true, 0);
1585 
1586  std::optional<OutlinerParaObject> pTemp = rOutliner.CreateParaObject(0, nParaCount);
1587  rOutliner.Clear();
1588 
1589  SetOutlinerParaObject(std::move(pTemp));
1590  }
1591 }
1592 
1593 
1594 void SAL_CALL Cell::setPropertiesToDefault( const Sequence< OUString >& aPropertyNames )
1595 {
1596  for(const OUString& rName : aPropertyNames)
1597  setPropertyToDefault( rName );
1598 }
1599 
1600 
1601 Sequence< Any > SAL_CALL Cell::getPropertyDefaults( const Sequence< OUString >& aPropertyNames )
1602 {
1603  sal_Int32 nCount = aPropertyNames.getLength();
1604  Sequence< Any > aDefaults( nCount );
1605 
1606  std::transform(aPropertyNames.begin(), aPropertyNames.end(), aDefaults.begin(),
1607  [this](const OUString& rName) -> Any { return getPropertyDefault(rName); });
1608 
1609  return aDefaults;
1610 }
1611 
1612 
1613 // XText
1614 
1615 
1616 void SAL_CALL Cell::insertTextContent( const Reference< XTextRange >& xRange, const Reference< XTextContent >& xContent, sal_Bool bAbsorb )
1617 {
1618  SvxUnoTextBase::insertTextContent( xRange, xContent, bAbsorb );
1619  notifyModified();
1620 }
1621 
1622 
1623 void SAL_CALL Cell::removeTextContent( const Reference< XTextContent >& xContent )
1624 {
1626  notifyModified();
1627 }
1628 
1629 
1630 // XSimpleText
1631 
1632 
1633 void SAL_CALL Cell::insertString( const Reference< XTextRange >& xRange, const OUString& aString, sal_Bool bAbsorb )
1634 {
1635  SvxUnoTextBase::insertString( xRange, aString, bAbsorb );
1636  notifyModified();
1637 }
1638 
1639 
1640 void SAL_CALL Cell::insertControlCharacter( const Reference< XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb )
1641 {
1642  SvxUnoTextBase::insertControlCharacter( xRange, nControlCharacter, bAbsorb );
1643  notifyModified();
1644 }
1645 
1646 
1647 // XTextRange
1648 
1649 
1650 OUString SAL_CALL Cell::getString( )
1651 {
1652  maSelection.nStartPara = EE_PARA_MAX_COUNT;
1653  return SvxUnoTextBase::getString();
1654 }
1655 
1656 
1657 void SAL_CALL Cell::setString( const OUString& aString )
1658 {
1659  SvxUnoTextBase::setString( aString );
1660  notifyModified();
1661 }
1662 
1663 // XEventListener
1664 void SAL_CALL Cell::disposing( const EventObject& /*Source*/ )
1665 {
1666  mxTable.clear();
1667  dispose();
1668 }
1669 
1670 void Cell::dumpAsXml(xmlTextWriterPtr pWriter, sal_Int32 nRow, sal_Int32 nCol) const
1671 {
1672  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("Cell"));
1673  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("row"), "%" SAL_PRIdINT32, nRow);
1674  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("col"), "%" SAL_PRIdINT32, nCol);
1675  SdrText::dumpAsXml(pWriter);
1676  //SvxUnoTextBase::dumpAsXml(pWriter);
1677  //mpPropSet->dumpAsXml(pWriter);
1678  mpProperties->dumpAsXml(pWriter);
1679  (void)xmlTextWriterEndElement(pWriter);
1680 }
1681 
1682 }
1683 
1684 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetValue() const
constexpr TypedWhichId< SvxTextRotateItem > SDRATTR_TABLE_TEXT_ROTATION(SDRATTR_TABLE_FIRST+4)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWHEIGHT(SDRATTR_MISC_FIRST+2)
Type
BitmapMode
uno::Any SvxItemPropertySet_getPropertyValue(const SfxItemPropertyMapEntry *pMap, const SfxItemSet &rSet)
Definition: unoshape.cxx:4015
#define UNO_NAME_TEXT_WORDWRAP
static css::table::BorderLine2 SvxLineToLine(const editeng::SvxBorderLine *pLine, bool bConvert)
constexpr TypedWhichId< SdrTextHorzAdjustItem > SDRATTR_TEXT_HORZADJUST(SDRATTR_MISC_FIRST+13)
constexpr TypedWhichId< XLineEndItem > XATTR_LINEEND(XATTR_LINE_FIRST+5)
constexpr sal_uInt16 SDRATTR_TABLE_FIRST(SDRATTR_CUSTOMSHAPE_LAST+1)
constexpr TypedWhichId< XLineStartItem > XATTR_LINESTART(XATTR_LINE_FIRST+4)
struct _xmlTextWriter * xmlTextWriterPtr
virtual void SAL_CALL insertTextContent(const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::text::XTextContent > &xContent, sal_Bool bAbsorb) override
#define UNO_NAME_TEXT_RIGHTDIST
static constexpr auto Items
virtual void SAL_CALL insertControlCharacter(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) override
std::string GetValue
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
void SetPaperSize(const Size &rSize)
SdrTextHorzAdjust
Definition: sdtaitm.hxx:53
long Long
const editeng::SvxBorderLine * GetVert() const
virtual void ItemSetChanged(const SfxItemSet *) override
#define UNO_NAME_TEXT_LOWERDIST
SvxBoxInfoItem & rBoxInfoItem
bool IsInserted() const
Definition: svdobj.hxx:742
static bool SetPropertyValueHelper(const SfxItemPropertyMapEntry *pMap, const css::uno::Any &aValue, SfxItemSet &rNewSet, const ESelection *pSelection=nullptr, SvxEditSource *pEditSource=nullptr)
sdr::table::CellRef mxCell
Definition: cell.cxx:173
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
void ItemSetChanged(const SfxItemSet *) override
Definition: cell.cxx:225
sal_uInt32 GetTextHeight() const
#define SVX_UNOEDIT_OUTLINER_PROPERTIES
sal_Int32 GetParagraphCount() const
virtual const SfxItemSet & GetObjectItemSet() const override
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual void SAL_CALL setString(const OUString &aString) override
constexpr TypedWhichId< XLineDashItem > XATTR_LINEDASH(XATTR_LINE_FIRST+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
static bool GetPropertyValueHelper(SfxItemSet const &rSet, const SfxItemPropertyMapEntry *pMap, css::uno::Any &aAny, const ESelection *pSelection=nullptr, SvxEditSource *pEditSource=nullptr)
#define UNO_NAME_TEXT_UPPERDIST
const editeng::SvxBorderLine * GetRight() const
SfxStyleFamily GetFamily() const
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CHAINNEXTNAME)
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdoattr.cxx:49
virtual sal_Int32 getTextCount() const =0
Return the number of texts available for this object.
#define OWN_ATTR_FILLBMP_MODE
Definition: unoshprp.hxx:114
const svx::ITextProvider & getTextProvider() const override
Get the TextProvider related to our SdrObject.
Definition: cell.cxx:196
#define LEFT_BORDER
constexpr sal_uInt16 SDRATTR_START(XATTR_START)
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
Definition: sdtagitm.hxx:25
Degree10 GetValue() const
sal_Int32 mnColSpan
#define OWN_ATTR_TABLEBORDER
Definition: unoshprp.hxx:145
rtl::Reference< Cell > CellRef
Definition: celltypes.hxx:33
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdmodel.cxx:500
int nCount
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1973
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_WORDWRAP(SDRATTR_MISC_FIRST+24)
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType)
void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich=0)
This interface provides access to text object(s) in an SdrObject.
Mode eMode
SfxItemSet const & GetParaAttribs(sal_Int32 nPara)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
Definition: sdtagitm.hxx:30
#define UNO_NAME_TEXT_WRITINGMODE
SVX_DLLPRIVATE SdrOutliner * GetTextEditOutliner() const
Definition: svdotext.hxx:145
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LOWERDIST(SDRATTR_MISC_FIRST+7)
void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &)
constexpr void SetLeft(tools::Long v)
void SetRotation(TextRotation nRotation)
constexpr TypedWhichId< SvxBoxInfoItem > SDRATTR_TABLE_BORDER_INNER(SDRATTR_TABLE_FIRST+1)
void RemoveAttribs(const ESelection &rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich)
std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
Definition: cell.cxx:215
css::uno::Type aType
const editeng::SvxBorderLine * GetHori() const
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
const editeng::SvxBorderLine * GetTop() const
std::vector< sal_uInt16 > GetAllCharPropIds(const SfxItemSet &rSet)
Definition: svdedtv1.cxx:1021
const EditTextObject & GetTextObject() const
UNDERLYING_TYPE get() const
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
void SetText(const OutlinerParaObject &)
const editeng::SvxBorderLine * GetLeft() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
bool IsUndoEnabled() const
returns true if undo is currently enabled This returns false if undo was disabled using EnableUndo( f...
Definition: svdmodel.cxx:531
void SetVertical(bool bNew)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
#define TOP_BORDER
constexpr TypedWhichId< SdrTextVertAdjustItem > SDRATTR_TEXT_VERTADJUST(SDRATTR_MISC_FIRST+8)
sal_uInt16 Count() const
virtual OUString GetText(sal_Int32 nPara) const =0
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LEFTDIST(SDRATTR_MISC_FIRST+4)
constexpr sal_uInt16 EE_ITEMS_START(OWN_ATTR_VALUE_END+1)
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
float u
unsigned char sal_Bool
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:279
void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) override
Definition: cell.cxx:297
virtual void SAL_CALL removeTextContent(const css::uno::Reference< css::text::XTextContent > &xContent) override
css::uno::Type const & get()
constexpr void SetRight(tools::Long v)
CellProperties(SdrObject &rObj, sdr::table::Cell *pCell)
Definition: cell.cxx:201
constexpr void SetBottom(tools::Long v)
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
bool setPropertyValue(uno::Sequence< beans::PropertyValue > &aProp, const OUString &aName, const uno::Any &aValue)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &...rSn)
Abstract DrawObject.
Definition: svdobj.hxx:259
SfxItemPool * GetPool() const
const EditEngine & GetEditEngine() const
constexpr void SetTop(tools::Long v)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_UPPERDIST(SDRATTR_MISC_FIRST+6)
bool IsValid(SvxBoxInfoItemValidFlags nValid) const
static SfxUnoStyleSheet * getUnoStyleSheet(const css::uno::Reference< css::style::XStyle > &xStyle)
constexpr TypedWhichId< SvxBoxItem > SDRATTR_TABLE_BORDER(SDRATTR_TABLE_FIRST+0)
const PropertyValue * pValues
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr sal_uInt16 SDRATTR_SHADOW_LAST(SDRATTR_SHADOWBLUR)
void AddUndo(SdrUndoAction *pUndo)
Add an undo action that should be on the undo stack after ending text edit.
Definition: svdotable.cxx:2049
static const SvxItemPropertySet * ImplGetSvxCellPropertySet()
Definition: cell.cxx:73
constexpr sal_uInt16 SDRATTR_TABLE_LAST(SDRATTR_TABLE_TEXT_ROTATION)
constexpr Size GetSize() const
void SetMaxAutoPaperSize(const Size &rSz)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
sal_Int32 mnRowSpan
#define BOTTOM_BORDER
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
static SdrItemPool & GetGlobalDrawObjectItemPool()
Definition: svdobj.cxx:571
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_RIGHTDIST(SDRATTR_MISC_FIRST+5)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual OUString SAL_CALL getString() override
void SetObjectItemSet(const SfxItemSet &rSet)
Definition: svdobj.cxx:1998
constexpr TypedWhichId< XFillBmpStretchItem > XATTR_FILLBMP_STRETCH(XATTR_FILL_FIRST+16)
virtual sal_Int32 GetParagraphCount() const =0
#define UNO_NAME_TEXT_LEFTDIST
#define SVX_UNOEDIT_PARA_PROPERTIES
bool isActive()
bool IsTopToBottom() const
#define FILL_PROPERTIES
Definition: unoshprp.hxx:275
void AddText(const OutlinerParaObject &, bool bAppend=false)
constexpr TypedWhichId< XFillBmpTileItem > XATTR_FILLBMP_TILE(XATTR_FILL_FIRST+7)
#define OWN_ATTR_STYLE
Definition: unoshprp.hxx:176
bool SetUpdateLayout(bool bUpdate)
void SvxItemPropertySet_setPropertyValue(const SfxItemPropertyMapEntry *pMap, const uno::Any &rVal, SfxItemSet &rSet)
Definition: unoshape.cxx:4025
const CellTextProvider maTextProvider
Definition: cell.cxx:176
std::optional< SfxItemSet > mxItemSet
void setHeight(tools::Long nHeight)
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1691
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdtext.cxx:147
#define UNO_NAME_TEXT_HORZADJUST
OUString const & GetName() const
Definition: xit.hxx:53
bool IsVertical() const
#define RIGHT_BORDER
const SdrObject & GetSdrObject() const
Definition: properties.cxx:59
virtual void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
Definition: svdtext.cxx:73
SfxItemSet CreateObjectSpecificItemSet(SfxItemPool &rPool) override
Definition: cell.cxx:180
bool SetFillAttribute(sal_uInt16 nWID, const OUString &rName)
Definition: unoshape.cxx:1379
const SvxItemPropertySet * ImplGetSvxUnoOutlinerTextCursorSvxPropertySet()
void Clear()
void dispose()
void ForceDefaultAttributes() override
Definition: cell.cxx:221
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
#define EE_PARA_MAX_COUNT
virtual void SetVerticalWriting(bool bVertical) override
Definition: svdotable.cxx:2014
sal_uInt16 GetSmallestDistance() const
constexpr sal_uInt16 SDRATTR_MISC_FIRST(SDRATTR_CAPTION_LAST+1)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
SdrOutliner & ImpGetDrawOutliner() const
Definition: svdotext.cxx:1164
const editeng::SvxBorderLine * GetBottom() const
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) override
SdrTextVertAdjust
Definition: sdtaitm.hxx:29
#define SVX_UNOEDIT_CHAR_PROPERTIES
static bool IsWhich(sal_uInt16 nId)
static bool LineToSvxLine(const css::table::BorderLine &rLine, editeng::SvxBorderLine &rSvxLine, bool bConvert)
sal_Int16 nValue
Definition: fmsrccfg.cxx:81
virtual SdrText * getText(sal_Int32 nIndex) const =0
Return the nth available text.
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo
#define UNO_NAME_TEXT_VERTADJUST