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