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