LibreOffice Module svx (master)  1
cell.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 
21 #include <com/sun/star/drawing/BitmapMode.hpp>
22 #include <com/sun/star/style/XStyle.hpp>
23 #include <com/sun/star/text/WritingMode.hpp>
24 #include <com/sun/star/table/TableBorder.hpp>
25 #include <com/sun/star/table/BorderLine2.hpp>
26 #include <com/sun/star/lang/Locale.hpp>
27 
28 #include <comphelper/sequence.hxx>
29 #include <o3tl/any.hxx>
30 #include <svl/style.hxx>
31 #include <svl/itemset.hxx>
32 
33 #include <vcl/svapp.hxx>
34 #include <libxml/xmlwriter.h>
35 
37 #include <editeng/outlobj.hxx>
39 #include <svx/svdotable.hxx>
40 #include <svx/svdoutl.hxx>
41 #include <svx/unoshtxt.hxx>
42 #include <svx/svdmodel.hxx>
43 #include <svx/sdooitm.hxx>
44 #include <svx/sdtagitm.hxx>
45 #include <svx/sdmetitm.hxx>
46 #include <svx/xit.hxx>
47 #include <getallcharpropids.hxx>
48 #include "tableundo.hxx"
49 #include <cell.hxx>
50 #include <svx/unoshprp.hxx>
51 #include <svx/unoshape.hxx>
52 #include <editeng/editobj.hxx>
53 #include <editeng/borderline.hxx>
54 #include <editeng/boxitem.hxx>
56 #include <svx/xflbstit.hxx>
57 #include <svx/xflbmtit.hxx>
58 #include <svx/svdpool.hxx>
59 #include <tools/diagnose_ex.h>
60 
61 
62 using ::editeng::SvxBorderLine;
63 using namespace ::com::sun::star::uno;
64 using namespace ::com::sun::star::beans;
65 using namespace ::com::sun::star::lang;
66 using namespace ::com::sun::star::text;
67 using namespace ::com::sun::star::table;
68 using namespace ::com::sun::star::drawing;
69 using namespace ::com::sun::star::style;
70 using namespace ::com::sun::star::container;
71 
72 
74 {
75  // property map for an outliner text
76  static const SfxItemPropertyMapEntry aSvxCellPropertyMap[] =
77  {
79 // { "HasLevels", OWN_ATTR_HASLEVELS, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY, 0},
80  { u"Style", OWN_ATTR_STYLE, cppu::UnoType< css::style::XStyle >::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
83  { u"" UNO_NAME_TEXT_LEFTDIST, SDRATTR_TEXT_LEFTDIST, cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
84  { u"" UNO_NAME_TEXT_LOWERDIST, SDRATTR_TEXT_LOWERDIST, cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
85  { u"" UNO_NAME_TEXT_RIGHTDIST, SDRATTR_TEXT_RIGHTDIST, cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
86  { u"" UNO_NAME_TEXT_UPPERDIST, SDRATTR_TEXT_UPPERDIST, cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
89 
90  { u"TableBorder", OWN_ATTR_TABLEBORDER, cppu::UnoType<TableBorder>::get(), 0, 0 },
96 
100  { u"", 0, css::uno::Type(), 0, 0 }
101  };
102 
103  static SvxItemPropertySet aSvxCellPropertySet( aSvxCellPropertyMap, SdrObject::GetGlobalDrawObjectItemPool() );
104  return &aSvxCellPropertySet;
105 }
106 
107 namespace
108 {
109 
110 class CellTextProvider : public svx::ITextProvider
111 {
112 public:
113  explicit CellTextProvider(const sdr::table::CellRef& rCell);
114  virtual ~CellTextProvider();
115 
116 private:
117  virtual sal_Int32 getTextCount() const override;
118  virtual SdrText* getText(sal_Int32 nIndex) const override;
119 
120 private:
121  const sdr::table::CellRef m_xCell;
122 };
123 
124 CellTextProvider::CellTextProvider(const sdr::table::CellRef& rCell)
125  : m_xCell(rCell)
126 {
127 }
128 
129 CellTextProvider::~CellTextProvider()
130 {
131 }
132 
133 sal_Int32 CellTextProvider::getTextCount() const
134 {
135  return 1;
136 }
137 
138 SdrText* CellTextProvider::getText(sal_Int32 nIndex) const
139 {
140  (void) nIndex;
141  assert(nIndex == 0);
142  return m_xCell.get();
143 }
144 
145 }
146 
147 namespace sdr::properties
148 {
150  {
151  protected:
152  // create a new itemset
154 
155  const svx::ITextProvider& getTextProvider() const override;
156 
157  public:
158  // basic constructor
159  CellProperties(SdrObject& rObj, sdr::table::Cell* pCell );
160 
161  // constructor for copying, but using new object
162  CellProperties(const CellProperties& rProps, SdrObject& rObj, sdr::table::Cell* pCell);
163 
164  // Clone() operator, normally just calls the local copy constructor
165  std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override;
166 
167  void ForceDefaultAttributes() override;
168 
169  void ItemSetChanged(const SfxItemSet& 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
181  {
182  return SfxItemSet(rPool,
183 
184  // range from SdrAttrObj
188 
189  // range for SdrTableObj
191 
192  // range from SdrTextObj
194  }
195 
197  {
198  return maTextProvider;
199  }
200 
201  CellProperties::CellProperties(SdrObject& rObj, sdr::table::Cell* pCell)
202  : TextProperties(rObj)
203  , mxCell(pCell)
204  , maTextProvider(mxCell)
205  {
206  }
207 
208  CellProperties::CellProperties(const CellProperties& rProps, SdrObject& rObj, sdr::table::Cell* pCell)
209  : TextProperties(rProps, rObj)
210  , mxCell( pCell )
211  , maTextProvider(mxCell)
212  {
213  }
214 
215  std::unique_ptr<BaseProperties> CellProperties::Clone(SdrObject& rObj) const
216  {
217  OSL_FAIL("CellProperties::Clone(), does not work yet!");
218  return std::unique_ptr<BaseProperties>(new CellProperties(*this, rObj,nullptr));
219  }
220 
222  {
223  }
224 
226  {
227  SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject());
228 
229  if( mxCell.is() )
230  {
231  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  mxItemSet->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  xCell->mxTable->addEventListener( xCell );
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() noexcept
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  TOOLS_WARN_EXCEPTION("svx.table", "");
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  return;
475 
476  SdrOutliner& rOutliner=rTableObj.ImpGetDrawOutliner();
477  rOutliner.SetUpdateMode(true);
478 
479  if( hasText() )
480  {
481  rOutliner.SetText(*GetOutlinerParaObject());
482  rOutliner.AddText(*xSourceCell->GetOutlinerParaObject());
483  }
484  else
485  {
486  rOutliner.SetText(*xSourceCell->GetOutlinerParaObject());
487  }
488 
489  SetOutlinerParaObject( rOutliner.CreateParaObject() );
490  rOutliner.Clear();
491  xSourceCell->SetOutlinerParaObject(rOutliner.CreateParaObject());
492  rOutliner.Clear();
493  SetStyleSheet( GetStyleSheet(), true );
494 }
495 
496 
497 void Cell::cloneFrom( const CellRef& xCell )
498 {
499  if( xCell.is() )
500  {
501  replaceContentAndFormatting( 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::replaceContentAndFormatting( const CellRef& xSourceCell )
518 {
519  if( !(xSourceCell.is() && mpProperties) )
520  return;
521 
522  mpProperties->SetMergedItemSet( xSourceCell->GetObjectItemSet() );
523 
524  // tdf#118354 OutlinerParaObject may be nullptr, do not dereference when
525  // not set (!)
526  if(nullptr != xSourceCell->GetOutlinerParaObject())
527  {
528  SetOutlinerParaObject( std::make_unique<OutlinerParaObject>(*xSourceCell->GetOutlinerParaObject()) );
529  }
530 
531  SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
532  SdrTableObj& rSourceTableObj = dynamic_cast< SdrTableObj& >( xSourceCell->GetObject() );
533 
534  if(&rSourceTableObj.getSdrModelFromSdrObject() != &rTableObj.getSdrModelFromSdrObject())
535  {
536  // TTTT should not happen - if, then a clone may be needed
537  // Maybe add an assertion here later
538  SetStyleSheet( nullptr, true );
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  return;
557 
558  mpProperties->SetMergedItemSet( xSourceCell->GetObjectItemSet() );
559  SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
560  SdrTableObj& rSourceTableObj = dynamic_cast< SdrTableObj& >( xSourceCell->GetObject() );
561 
562  if(&rSourceTableObj.getSdrModelFromSdrObject() != &rTableObj.getSdrModelFromSdrObject())
563  {
564  // TTTT should not happen - if, then a clone may be needed
565  // Maybe add an assertion here later
566  SetStyleSheet( nullptr, true );
567  }
568 
569  notifyModified();
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 tools::Long Cell::GetTextLeftDistance() const
777 {
778  return GetItemSet().Get(SDRATTR_TEXT_LEFTDIST).GetValue();
779 }
780 
781 
782 tools::Long Cell::GetTextRightDistance() const
783 {
784  return GetItemSet().Get(SDRATTR_TEXT_RIGHTDIST).GetValue();
785 }
786 
787 
788 tools::Long Cell::GetTextUpperDistance() const
789 {
790  return GetItemSet().Get(SDRATTR_TEXT_UPPERDIST).GetValue();
791 }
792 
793 
794 tools::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() noexcept
881 {
883 }
884 
885 
886 void SAL_CALL Cell::release() noexcept
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 SfxItemPropertyMapEntry* 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 SfxItemPropertyMapEntry* 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(Degree10(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 SfxItemPropertyMapEntry* 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().get() * 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  TOOLS_WARN_EXCEPTION("svx.table", "unknown property!");
1311  }
1312  catch( Exception& )
1313  {
1314  TOOLS_WARN_EXCEPTION("svx.table", "");
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  TOOLS_WARN_EXCEPTION("svx.table", "unknown property!");
1340  }
1341  catch( Exception& )
1342  {
1343  TOOLS_WARN_EXCEPTION("svx.table", "");
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 SfxItemPropertyMapEntry* 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::SET:
1419  eState = PropertyState_DIRECT_VALUE;
1420  break;
1421  case SfxItemState::DEFAULT:
1422  eState = PropertyState_DEFAULT_VALUE;
1423  break;
1424  default:
1425  eState = PropertyState_AMBIGUOUS_VALUE;
1426  break;
1427  }
1428 
1429  // if an item is set, this doesn't mean we want it :)
1430  if( PropertyState_DIRECT_VALUE == eState )
1431  {
1432  switch( pMap->nWID )
1433  {
1434  // the following items are disabled by changing the
1435  // fill style or the line style. so there is no need
1436  // to export items without names which should be empty
1437  case XATTR_FILLBITMAP:
1438  case XATTR_FILLGRADIENT:
1439  case XATTR_FILLHATCH:
1440  case XATTR_LINEDASH:
1441  {
1442  const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>(pMap->nWID);
1443  if( ( pItem == nullptr ) || pItem->GetName().isEmpty() )
1444  eState = PropertyState_DEFAULT_VALUE;
1445  }
1446  break;
1447 
1448  // #i36115#
1449  // If e.g. the LineStart is on NONE and thus the string has length 0, it still
1450  // may be a hard attribute covering the set LineStart of the parent (Style).
1451  // #i37644#
1452  // same is for fill float transparency
1453  case XATTR_LINEEND:
1454  case XATTR_LINESTART:
1456  {
1457  const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>(pMap->nWID);
1458  if( pItem == nullptr )
1459  eState = PropertyState_DEFAULT_VALUE;
1460  }
1461  break;
1462  }
1463  }
1464  }
1465  }
1466  return eState;
1467  }
1468  throw UnknownPropertyException(PropertyName);
1469 }
1470 
1471 
1472 Sequence< PropertyState > SAL_CALL Cell::getPropertyStates( const Sequence< OUString >& aPropertyName )
1473 {
1474  ::SolarMutexGuard aGuard;
1475 
1476  if(mpProperties == nullptr)
1477  throw DisposedException();
1478 
1479  const sal_Int32 nCount = aPropertyName.getLength();
1480  Sequence< PropertyState > aRet( nCount );
1481 
1482  std::transform(aPropertyName.begin(), aPropertyName.end(), aRet.begin(),
1483  [this](const OUString& rName) -> PropertyState {
1484  try
1485  {
1486  return getPropertyState( rName );
1487  }
1488  catch( Exception& )
1489  {
1490  return PropertyState_AMBIGUOUS_VALUE;
1491  }
1492  });
1493 
1494  return aRet;
1495 }
1496 
1497 
1498 void SAL_CALL Cell::setPropertyToDefault( const OUString& PropertyName )
1499 {
1500  ::SolarMutexGuard aGuard;
1501 
1502  if(mpProperties == nullptr)
1503  throw DisposedException();
1504 
1505  const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
1506  if( pMap )
1507  {
1508  switch( pMap->nWID )
1509  {
1510  case OWN_ATTR_FILLBMP_MODE:
1511  {
1512  mpProperties->ClearObjectItem( XATTR_FILLBMP_STRETCH );
1513  mpProperties->ClearObjectItem( XATTR_FILLBMP_TILE );
1514  break;
1515  }
1516  case OWN_ATTR_STYLE:
1517  break;
1518 
1519  case OWN_ATTR_TABLEBORDER:
1520  {
1521  mpProperties->ClearObjectItem( SDRATTR_TABLE_BORDER_INNER );
1522  mpProperties->ClearObjectItem( SDRATTR_TABLE_BORDER );
1523  break;
1524  }
1525 
1526  default:
1527  {
1528  mpProperties->ClearObjectItem( pMap->nWID );
1529  }
1530  }
1531 
1532  GetObject().getSdrModelFromSdrObject().SetChanged();
1533  return;
1534  }
1535  throw UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
1536 }
1537 
1538 
1539 Any SAL_CALL Cell::getPropertyDefault( const OUString& aPropertyName )
1540 {
1541  ::SolarMutexGuard aGuard;
1542 
1543  if(mpProperties == nullptr)
1544  throw DisposedException();
1545 
1546  const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(aPropertyName);
1547  if( pMap )
1548  {
1549  switch( pMap->nWID )
1550  {
1551  case OWN_ATTR_FILLBMP_MODE:
1552  return Any( BitmapMode_NO_REPEAT );
1553 
1554  case OWN_ATTR_STYLE:
1555  {
1556  Reference< XStyle > xStyle;
1557  return Any( xStyle );
1558  }
1559 
1560  case OWN_ATTR_TABLEBORDER:
1561  {
1562  TableBorder aBorder;
1563  return Any( aBorder );
1564  }
1565 
1566  default:
1567  {
1568  if( SfxItemPool::IsWhich(pMap->nWID) )
1569  {
1570  SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
1571  aSet.Put(GetObject().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
1572  return GetAnyForItem( aSet, pMap );
1573  }
1574  }
1575  }
1576  }
1577  throw UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this));
1578 }
1579 
1580 
1581 // XMultiPropertyStates
1582 
1583 
1584 void SAL_CALL Cell::setAllPropertiesToDefault()
1585 {
1586  mpProperties.reset(new sdr::properties::CellProperties( static_cast< SdrTableObj& >( GetObject() ), this ));
1587 
1588  SdrOutliner& rOutliner = GetObject().ImpGetDrawOutliner();
1589 
1590  OutlinerParaObject* pParaObj = GetOutlinerParaObject();
1591  if( !pParaObj )
1592  return;
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 void SAL_CALL Cell::setPropertiesToDefault( const Sequence< OUString >& aPropertyNames )
1611 {
1612  for(const OUString& rName : aPropertyNames)
1613  setPropertyToDefault( rName );
1614 }
1615 
1616 
1617 Sequence< Any > SAL_CALL Cell::getPropertyDefaults( const Sequence< OUString >& aPropertyNames )
1618 {
1619  sal_Int32 nCount = aPropertyNames.getLength();
1620  Sequence< Any > aDefaults( nCount );
1621 
1622  std::transform(aPropertyNames.begin(), aPropertyNames.end(), aDefaults.begin(),
1623  [this](const OUString& rName) -> Any { return getPropertyDefault(rName); });
1624 
1625  return aDefaults;
1626 }
1627 
1628 
1629 // XText
1630 
1631 
1632 void SAL_CALL Cell::insertTextContent( const Reference< XTextRange >& xRange, const Reference< XTextContent >& xContent, sal_Bool bAbsorb )
1633 {
1634  SvxUnoTextBase::insertTextContent( xRange, xContent, bAbsorb );
1635  notifyModified();
1636 }
1637 
1638 
1639 void SAL_CALL Cell::removeTextContent( const Reference< XTextContent >& xContent )
1640 {
1642  notifyModified();
1643 }
1644 
1645 
1646 // XSimpleText
1647 
1648 
1649 void SAL_CALL Cell::insertString( const Reference< XTextRange >& xRange, const OUString& aString, sal_Bool bAbsorb )
1650 {
1651  SvxUnoTextBase::insertString( xRange, aString, bAbsorb );
1652  notifyModified();
1653 }
1654 
1655 
1656 void SAL_CALL Cell::insertControlCharacter( const Reference< XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb )
1657 {
1658  SvxUnoTextBase::insertControlCharacter( xRange, nControlCharacter, bAbsorb );
1659  notifyModified();
1660 }
1661 
1662 
1663 // XTextRange
1664 
1665 
1666 OUString SAL_CALL Cell::getString( )
1667 {
1668  maSelection.nStartPara = EE_PARA_MAX_COUNT;
1669  return SvxUnoTextBase::getString();
1670 }
1671 
1672 
1673 void SAL_CALL Cell::setString( const OUString& aString )
1674 {
1675  SvxUnoTextBase::setString( aString );
1676  notifyModified();
1677 }
1678 
1679 // XEventListener
1680 void SAL_CALL Cell::disposing( const EventObject& /*Source*/ )
1681 {
1682  mxTable.clear();
1683  dispose();
1684 }
1685 
1686 void Cell::dumpAsXml(xmlTextWriterPtr pWriter, sal_Int32 nRow, sal_Int32 nCol) const
1687 {
1688  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("Cell"));
1689  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("row"), "%" SAL_PRIdINT32, nRow);
1690  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("col"), "%" SAL_PRIdINT32, nCol);
1691  SdrText::dumpAsXml(pWriter);
1692  //SvxUnoTextBase::dumpAsXml(pWriter);
1693  //mpPropSet->dumpAsXml(pWriter);
1694  mpProperties->dumpAsXml(pWriter);
1695  (void)xmlTextWriterEndElement(pWriter);
1696 }
1697 
1698 }
1699 
1700 /* 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
uno::Any SvxItemPropertySet_getPropertyValue(const SfxItemPropertyMapEntry *pMap, const SfxItemSet &rSet)
Definition: unoshape.cxx:4005
#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:741
static bool SetPropertyValueHelper(const SfxItemPropertyMapEntry *pMap, const css::uno::Any &aValue, SfxItemSet &rNewSet, const ESelection *pSelection=nullptr, SvxEditSource *pEditSource=nullptr)
sdr::table::CellRef mxCell
Definition: cell.cxx:173
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
sal_uInt32 GetTextHeight() const
#define SVX_UNOEDIT_OUTLINER_PROPERTIES
sal_Int32 GetParagraphCount() const
virtual const SfxItemSet & GetObjectItemSet() const override
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual void SAL_CALL setString(const OUString &aString) override
constexpr TypedWhichId< XLineDashItem > XATTR_LINEDASH(XATTR_LINE_FIRST+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
static bool GetPropertyValueHelper(SfxItemSet const &rSet, const SfxItemPropertyMapEntry *pMap, css::uno::Any &aAny, const ESelection *pSelection=nullptr, SvxEditSource *pEditSource=nullptr)
#define UNO_NAME_TEXT_UPPERDIST
const editeng::SvxBorderLine * GetRight() const
SfxStyleFamily GetFamily() const
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CHAINNEXTNAME)
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdoattr.cxx:49
virtual sal_Int32 getTextCount() const =0
Return the number of texts available for this object.
#define OWN_ATTR_FILLBMP_MODE
Definition: unoshprp.hxx:114
const svx::ITextProvider & getTextProvider() const override
Get the TextProvider related to our SdrObject.
Definition: cell.cxx:196
void SetStyleSheet(sal_Int32 nPara, const OUString &rName, const SfxStyleFamily &eFamily)
#define LEFT_BORDER
void SetRight(tools::Long v)
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)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
#define OWN_ATTR_TABLEBORDER
Definition: unoshprp.hxx:145
rtl::Reference< Cell > CellRef
Definition: celltypes.hxx:33
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdmodel.cxx:517
int nCount
const SfxItemSet & GetObjectItemSet() const
Definition: svdobj.cxx:1976
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:156
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LOWERDIST(SDRATTR_MISC_FIRST+7)
void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &)
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
css::uno::Type aType
const editeng::SvxBorderLine * GetHori() const
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
const editeng::SvxBorderLine * GetTop() const
std::vector< sal_uInt16 > GetAllCharPropIds(const SfxItemSet &rSet)
Definition: svdedtv1.cxx:1015
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:548
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:279
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:258
SfxItemPool * GetPool() const
const EditEngine & GetEditEngine() 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:2051
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)
constexpr Size GetSize() const
void SetMaxAutoPaperSize(const Size &rSz)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
sal_Int32 mnRowSpan
#define BOTTOM_BORDER
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
static SdrItemPool & GetGlobalDrawObjectItemPool()
Definition: svdobj.cxx:573
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:2001
constexpr TypedWhichId< XFillBmpStretchItem > XATTR_FILLBMP_STRETCH(XATTR_FILL_FIRST+16)
#define UNO_NAME_TEXT_LEFTDIST
#define SVX_UNOEDIT_PARA_PROPERTIES
bool isActive()
virtual void SetOutlinerParaObject(std::unique_ptr< OutlinerParaObject > pTextObject)
Definition: svdtext.cxx:73
bool IsTopToBottom() const
#define FILL_PROPERTIES
Definition: unoshprp.hxx:274
void AddText(const OutlinerParaObject &, bool bAppend=false)
constexpr TypedWhichId< XFillBmpTileItem > XATTR_FILLBMP_TILE(XATTR_FILL_FIRST+7)
#define OWN_ATTR_STYLE
Definition: unoshprp.hxx:176
void SetUpdateMode(bool bUpdate)
void SvxItemPropertySet_setPropertyValue(const SfxItemPropertyMapEntry *pMap, const uno::Any &rVal, SfxItemSet &rSet)
Definition: unoshape.cxx:4015
const CellTextProvider maTextProvider
Definition: cell.cxx:176
std::optional< SfxItemSet > mxItemSet
void setHeight(tools::Long nHeight)
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1694
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: svdtext.cxx:140
#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
SfxItemSet CreateObjectSpecificItemSet(SfxItemPool &rPool) override
Definition: cell.cxx:180
bool SetFillAttribute(sal_uInt16 nWID, const OUString &rName)
Definition: unoshape.cxx:1386
const SvxItemPropertySet * ImplGetSvxUnoOutlinerTextCursorSvxPropertySet()
void Clear()
void dispose()
void ForceDefaultAttributes() override
Definition: cell.cxx:221
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
#define EE_PARA_MAX_COUNT
virtual void SetVerticalWriting(bool bVertical) override
Definition: svdotable.cxx:2016
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:1145
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