LibreOffice Module sc (master)  1
editutil.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <scitems.hxx>
22 #include <editeng/eeitem.hxx>
23 
24 #include <svx/algitem.hxx>
25 #include <svtools/colorcfg.hxx>
26 #include <editeng/editstat.hxx>
27 #include <editeng/flditem.hxx>
28 #include <editeng/numitem.hxx>
29 #include <editeng/justifyitem.hxx>
30 #include <editeng/editobj.hxx>
31 #include <vcl/outdev.hxx>
32 #include <svl/numformat.hxx>
33 #include <svl/inethist.hxx>
34 #include <sfx2/objsh.hxx>
35 #include <osl/diagnose.h>
36 
37 #include <com/sun/star/text/textfield/Type.hpp>
38 #include <com/sun/star/document/XDocumentProperties.hpp>
39 
40 #include <editutil.hxx>
41 #include <global.hxx>
42 #include <attrib.hxx>
43 #include <document.hxx>
44 #include <docpool.hxx>
45 #include <patattr.hxx>
46 #include <scmod.hxx>
47 #include <inputopt.hxx>
48 #include <compiler.hxx>
49 #include <mutex>
50 
51 using namespace com::sun::star;
52 
53 // delimiters additionally to EditEngine default:
54 
56  const Point& rCellPos,
57  OutputDevice* pDevice, double nScaleX, double nScaleY,
58  const Fraction& rX, const Fraction& rY, bool bPrintTwips ) :
59  pDoc(pDocument),nCol(nX),nRow(nY),nTab(nZ),
60  aCellPos(rCellPos),pDev(pDevice),
61  nPPTX(nScaleX),nPPTY(nScaleY),aZoomX(rX),aZoomY(rY),
62  bInPrintTwips(bPrintTwips) {}
63 
64 OUString ScEditUtil::ModifyDelimiters( const OUString& rOld )
65 {
66  // underscore is used in function argument names
67  OUString aRet = rOld.replaceAll("_", "") +
68  "=()+-*/^&<>" +
69  ScCompiler::GetNativeSymbol(ocSep); // argument separator is localized.
70  return aRet;
71 }
72 
73 static OUString lcl_GetDelimitedString( const EditEngine& rEngine, const char c )
74 {
75  sal_Int32 nParCount = rEngine.GetParagraphCount();
76  OUStringBuffer aRet( nParCount * 80 );
77  for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
78  {
79  if (nPar > 0)
80  aRet.append(c);
81  aRet.append( rEngine.GetText( nPar ));
82  }
83  return aRet.makeStringAndClear();
84 }
85 
86 static OUString lcl_GetDelimitedString( const EditTextObject& rEdit, const char c )
87 {
88  sal_Int32 nParCount = rEdit.GetParagraphCount();
89  OUStringBuffer aRet( nParCount * 80 );
90  for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
91  {
92  if (nPar > 0)
93  aRet.append(c);
94  aRet.append( rEdit.GetText( nPar ));
95  }
96  return aRet.makeStringAndClear();
97 }
98 
100 {
101  return lcl_GetDelimitedString(rEngine, ' ');
102 }
103 OUString ScEditUtil::GetMultilineString( const EditEngine& rEngine )
104 {
105  return lcl_GetDelimitedString(rEngine, '\n');
106 }
107 
109 {
110  return lcl_GetDelimitedString(rEdit, '\n');
111 }
112 
113 OUString ScEditUtil::GetString( const EditTextObject& rEditText, const ScDocument* pDoc )
114 {
115  if( !rEditText.HasField())
116  return GetMultilineString( rEditText );
117 
118  static std::mutex aMutex;
119  std::scoped_lock aGuard( aMutex);
120  // ScFieldEditEngine is needed to resolve field contents.
121  if (pDoc)
122  {
123  /* TODO: make ScDocument::GetEditEngine() const? Most likely it's only
124  * not const because of the pointer assignment, make that mutable, and
125  * then remove the ugly const_cast here. */
126  EditEngine& rEE = const_cast<ScDocument*>(pDoc)->GetEditEngine();
127  rEE.SetText( rEditText);
128  return GetMultilineString( rEE);
129  }
130  else
131  {
133  rEE.SetText( rEditText);
134  return GetMultilineString( rEE);
135  }
136 }
137 
138 std::unique_ptr<EditTextObject> ScEditUtil::CreateURLObjectFromURL( ScDocument& rDoc, const OUString& rURL, const OUString& rText )
139 {
140  SvxURLField aUrlField( rURL, rText, SvxURLFormat::AppDefault);
141  EditEngine& rEE = rDoc.GetEditEngine();
142  rEE.SetText( EMPTY_OUSTRING );
145 
146  return rEE.CreateTextObject();
147 }
148 
150 {
151  static const struct {
152  sal_uInt16 nAttrType;
153  sal_uInt16 nCharType;
154  } AttrTypeMap[] = {
159  };
160 
161  const SfxItemSet& rSet = rAttr.GetItemSet();
162  const SfxPoolItem* pItem;
163  for (size_t i = 0; i < SAL_N_ELEMENTS(AttrTypeMap); ++i)
164  {
165  if ( rSet.GetItemState(AttrTypeMap[i].nAttrType, false, &pItem) == SfxItemState::SET )
166  rEditText.RemoveCharAttribs(AttrTypeMap[i].nCharType);
167  }
168 }
169 
170 std::unique_ptr<EditTextObject> ScEditUtil::Clone( const EditTextObject& rObj, ScDocument& rDestDoc )
171 {
172  std::unique_ptr<EditTextObject> pNew;
173 
174  EditEngine& rEngine = rDestDoc.GetEditEngine();
175  if (rObj.HasOnlineSpellErrors())
176  {
177  EEControlBits nControl = rEngine.GetControlWord();
178  const EEControlBits nSpellControl = EEControlBits::ONLINESPELLING | EEControlBits::ALLOWBIGOBJS;
179  bool bNewControl = ( (nControl & nSpellControl) != nSpellControl );
180  if (bNewControl)
181  rEngine.SetControlWord(nControl | nSpellControl);
182  rEngine.SetText(rObj);
183  pNew = rEngine.CreateTextObject();
184  if (bNewControl)
185  rEngine.SetControlWord(nControl);
186  }
187  else
188  {
189  rEngine.SetText(rObj);
190  pNew = rEngine.CreateTextObject();
191  }
192 
193  return pNew;
194 }
195 
197  const SvxFieldData& rFieldData, const ScDocument* pDoc, std::optional<Color>* ppTextColor )
198 {
199  OUString aRet;
200  switch (rFieldData.GetClassId())
201  {
202  case text::textfield::Type::URL:
203  {
204  const SvxURLField& rField = static_cast<const SvxURLField&>(rFieldData);
205  const OUString& aURL = rField.GetURL();
206 
207  switch (rField.GetFormat())
208  {
209  case SvxURLFormat::AppDefault: //TODO: configurable with App???
210  case SvxURLFormat::Repr:
211  aRet = rField.GetRepresentation();
212  break;
213  case SvxURLFormat::Url:
214  aRet = aURL;
215  break;
216  default:
217  ;
218  }
219 
222 
223  if (ppTextColor)
224  *ppTextColor = SC_MOD()->GetColorConfig().GetColorValue(eEntry).nColor;
225  }
226  break;
227  case text::textfield::Type::EXTENDED_TIME:
228  {
229  const SvxExtTimeField& rField = static_cast<const SvxExtTimeField&>(rFieldData);
230  if (pDoc)
231  aRet = rField.GetFormatted(*pDoc->GetFormatTable(), ScGlobal::eLnge);
232  else
233  {
234  /* TODO: quite expensive, we could have a global formatter? */
236  aRet = rField.GetFormatted(aFormatter, ScGlobal::eLnge);
237  }
238  }
239  break;
241  {
242  Date aDate(Date::SYSTEM);
243  aRet = ScGlobal::getLocaleData().getDate(aDate);
244  }
245  break;
246  case text::textfield::Type::DOCINFO_TITLE:
247  {
248  if (pDoc)
249  {
250  SfxObjectShell* pDocShell = pDoc->GetDocumentShell();
251  if (pDocShell)
252  {
253  aRet = pDocShell->getDocProperties()->getTitle();
254  if (aRet.isEmpty())
255  aRet = pDocShell->GetTitle();
256  }
257  }
258  if (aRet.isEmpty())
259  aRet = "?";
260  }
261  break;
263  {
264  const SvxTableField& rField = static_cast<const SvxTableField&>(rFieldData);
265  SCTAB nTab = rField.GetTab();
266  OUString aName;
267  if (pDoc && pDoc->GetName(nTab, aName))
268  aRet = aName;
269  else
270  aRet = "?";
271  }
272  break;
273  default:
274  aRet = "?";
275  }
276 
277  if (aRet.isEmpty()) // empty is yuck
278  aRet = " "; // space is default of EditEngine
279 
280  return aRet;
281 }
282 
284 {
285  if (!pPattern)
286  pPattern = pDoc->GetPattern( nCol, nRow, nTab );
287 
288  if ( pPattern->GetItem(ATTR_HOR_JUSTIFY).GetValue() ==
289  SvxCellHorJustify::Left )
290  {
291  tools::Long nIndent = pPattern->GetItem(ATTR_INDENT).GetValue();
292  if (!bInPrintTwips)
293  nIndent = static_cast<tools::Long>(nIndent * nPPTX);
294  return nIndent;
295  }
296 
297  return 0;
298 }
299 
300 void ScEditUtil::GetMargins(const ScPatternAttr* pPattern, tools::Long& nLeftMargin, tools::Long& nTopMargin,
301  tools::Long& nRightMargin, tools::Long& nBottomMargin) const
302 {
303  if (!pPattern)
304  pPattern = pDoc->GetPattern( nCol, nRow, nTab );
305 
306  const SvxMarginItem* pMargin = &pPattern->GetItem(ATTR_MARGIN);
307  if (!pMargin)
308  return;
309 
310  nLeftMargin = bInPrintTwips ? pMargin->GetLeftMargin() : static_cast<tools::Long>(pMargin->GetLeftMargin() * nPPTX);
311  nRightMargin = bInPrintTwips ? pMargin->GetRightMargin() : static_cast<tools::Long>(pMargin->GetRightMargin() * nPPTX);
312  nTopMargin = bInPrintTwips ? pMargin->GetTopMargin() : static_cast<tools::Long>(pMargin->GetTopMargin() * nPPTY);
313  nBottomMargin = bInPrintTwips ? pMargin->GetBottomMargin() : static_cast<tools::Long>(pMargin->GetBottomMargin() * nPPTY);
314 }
315 
316 tools::Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bForceToTop )
317 {
318  // bForceToTop = always align to top, for editing
319  // (sal_False for querying URLs etc.)
320 
321  if (!pPattern)
322  pPattern = pDoc->GetPattern( nCol, nRow, nTab );
323 
324  Point aStartPos = aCellPos;
325 
326  bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
327  tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
328 
329  const ScMergeAttr* pMerge = &pPattern->GetItem(ATTR_MERGE);
330  tools::Long nCellX = pDoc->GetColWidth(nCol,nTab);
331  if (!bInPrintTwips)
332  nCellX = static_cast<tools::Long>( nCellX * nPPTX );
333  if ( pMerge->GetColMerge() > 1 )
334  {
335  SCCOL nCountX = pMerge->GetColMerge();
336  for (SCCOL i=1; i<nCountX; i++)
337  {
338  tools::Long nColWidth = pDoc->GetColWidth(nCol+i,nTab);
339  nCellX += (bInPrintTwips ? nColWidth : static_cast<tools::Long>( nColWidth * nPPTX ));
340  }
341  }
343  if (!bInPrintTwips)
344  nCellY = static_cast<tools::Long>( nCellY * nPPTY );
345  if ( pMerge->GetRowMerge() > 1 )
346  {
347  SCROW nCountY = pMerge->GetRowMerge();
348  if (bInPrintTwips)
349  nCellY += pDoc->GetRowHeight(nRow + 1, nRow + nCountY - 1, nTab);
350  else
351  nCellY += static_cast<tools::Long>(pDoc->GetScaledRowHeight( nRow+1, nRow+nCountY-1, nTab, nPPTY));
352  }
353 
357  tools::Long nDifX = 0;
358  {
360  bool bInPrintTwipsOrig = bInPrintTwips;
361  bInPrintTwips = true;
362  tools::Long nIndent = GetIndent(pPattern);
363  GetMargins(pPattern, nLeftMargin, nTopMargin, nRightMargin, nBottomMargin);
364  bInPrintTwips = bInPrintTwipsOrig;
365  // Here rounding may be done only on the sum, ie nDifX,
366  // so need to get margin and indent in twips.
367  nDifX = nLeftMargin + nIndent;
368  if (!bInPrintTwips)
369  {
370  nDifX = static_cast<tools::Long>(nDifX * nPPTX);
371  nRightMargin = static_cast<tools::Long>(nRightMargin * nPPTX);
372  nTopMargin = static_cast<tools::Long>(nTopMargin * nPPTY);
373  nBottomMargin = static_cast<tools::Long>(nBottomMargin * nPPTY);
374  }
375  }
376 
377 
378  aStartPos.AdjustX(nDifX * nLayoutSign );
379  nCellX -= nDifX + nRightMargin; // due to line feed, etc.
380 
381  // align vertical position to the one in the table
382 
383  tools::Long nDifY;
384  SvxCellVerJustify eJust = pPattern->GetItem(ATTR_VER_JUSTIFY).GetValue();
385 
386  // asian vertical is always edited top-aligned
387  bool bAsianVertical = pPattern->GetItem( ATTR_STACKED ).GetValue() &&
388  pPattern->GetItem( ATTR_VERTICAL_ASIAN ).GetValue();
389 
390  if ( eJust == SvxCellVerJustify::Top ||
391  ( bForceToTop && ( SC_MOD()->GetInputOptions().GetTextWysiwyg() || bAsianVertical ) ) )
392  nDifY = nTopMargin;
393  else
394  {
395  MapMode aMode = pDev->GetMapMode();
396  pDev->SetMapMode(MapMode(bInPrintTwips ? MapUnit::MapTwip : MapUnit::MapPixel));
397 
398  tools::Long nTextHeight = pDoc->GetNeededSize( nCol, nRow, nTab,
399  pDev, nPPTX, nPPTY, aZoomX, aZoomY, false /* bWidth */,
400  false /* bTotalSize */, bInPrintTwips );
401  if (!nTextHeight)
402  { // empty cell
403  vcl::Font aFont;
404  // font color doesn't matter here
405  pPattern->GetFont( aFont, SC_AUTOCOL_BLACK, pDev, &aZoomY );
406  pDev->SetFont(aFont);
407  nTextHeight = pDev->GetTextHeight() + nTopMargin + nBottomMargin;
408  }
409 
410  pDev->SetMapMode(aMode);
411 
412  if ( nTextHeight > nCellY + nTopMargin || bForceToTop )
413  nDifY = 0; // too large -> begin at the top
414  else
415  {
416  if ( eJust == SvxCellVerJustify::Center )
417  nDifY = nTopMargin + ( nCellY - nTextHeight ) / 2;
418  else
419  nDifY = nCellY - nTextHeight + nTopMargin; // JUSTIFY_BOTTOM
420  }
421  }
422 
423  aStartPos.AdjustY(nDifY );
424  nCellY -= nDifY;
425 
426  if ( bLayoutRTL )
427  aStartPos.AdjustX( -(nCellX - 2) ); // excluding grid on both sides
428 
429  // -1 -> don't overwrite grid
430  return tools::Rectangle( aStartPos, Size(nCellX-1,nCellY-1) );
431 }
432 
434  bNeedsObject( false ),
435  bNeedsCellAttr( false )
436 {
437  if ( pEngine->GetParagraphCount() > 1 )
438  {
439  bNeedsObject = true; //TODO: find cell attributes ?
440  }
441  else
442  {
443  const SfxPoolItem* pItem = nullptr;
444  pEditAttrs.reset( new SfxItemSet( pEngine->GetAttribs(
445  ESelection(0,0,0,pEngine->GetTextLen(0)), EditEngineAttribs::OnlyHard ) ) );
446  const SfxItemSet& rEditDefaults = pEngine->GetDefaults();
447 
448  for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END && !bNeedsObject; nId++)
449  {
450  SfxItemState eState = pEditAttrs->GetItemState( nId, false, &pItem );
451  if (eState == SfxItemState::DONTCARE)
452  bNeedsObject = true;
453  else if (eState == SfxItemState::SET)
454  {
457  {
458  // Escapement and kerning are kept in EditEngine because there are no
459  // corresponding cell format items. User defined attributes are kept in
460  // EditEngine because "user attributes applied to all the text" is different
461  // from "user attributes applied to the cell".
462 
463  if ( *pItem != rEditDefaults.Get(nId) )
464  bNeedsObject = true;
465  }
466  else
467  if (!bNeedsCellAttr)
468  if ( *pItem != rEditDefaults.Get(nId) )
469  bNeedsCellAttr = true;
470  // rEditDefaults contains the defaults from the cell format
471  }
472  }
473 
474  // contains field commands?
475 
476  SfxItemState eFieldState = pEditAttrs->GetItemState( EE_FEATURE_FIELD, false );
477  if ( eFieldState == SfxItemState::DONTCARE || eFieldState == SfxItemState::SET )
478  bNeedsObject = true;
479 
480  // not converted characters?
481 
482  SfxItemState eConvState = pEditAttrs->GetItemState( EE_FEATURE_NOTCONV, false );
483  if ( eConvState == SfxItemState::DONTCARE || eConvState == SfxItemState::SET )
484  bNeedsObject = true;
485  }
486 }
487 
489 {
490 }
491 
493  bool bDeleteEnginePoolP )
494  :
495  pEnginePool( pEnginePoolP ),
496  pDefaults( nullptr ),
497  bDeleteEnginePool( bDeleteEnginePoolP ),
498  bDeleteDefaults( false )
499 {
500 }
501 
503  :
504  pEnginePool( rOrg.bDeleteEnginePool ? rOrg.pEnginePool->Clone() : rOrg.pEnginePool ),
505  pDefaults( nullptr ),
506  bDeleteEnginePool( rOrg.bDeleteEnginePool ),
507  bDeleteDefaults( false )
508 {
509 }
510 
512 {
513  if ( bDeleteDefaults )
514  delete pDefaults;
515 }
516 
518  bool bDeleteEnginePoolP )
519  :
520  ScEnginePoolHelper( pEnginePoolP, bDeleteEnginePoolP ),
521  EditEngine( pEnginePoolP )
522 {
523  // All EditEngines use ScGlobal::GetEditDefaultLanguage as DefaultLanguage.
524  // DefaultLanguage for InputHandler's EditEngine is updated later.
525 
527 }
528 
530  :
531  ScEnginePoolHelper( rOrg ),
532  EditEngine( pEnginePool.get() )
533 {
535 }
536 
538 {
539 }
540 
541 void ScEditEngineDefaulter::SetDefaults( const SfxItemSet& rSet, bool bRememberCopy )
542 {
543  if ( bRememberCopy )
544  {
545  if ( bDeleteDefaults )
546  delete pDefaults;
547  pDefaults = new SfxItemSet( rSet );
548  bDeleteDefaults = true;
549  }
550  const SfxItemSet& rNewSet = bRememberCopy ? *pDefaults : rSet;
551  bool bUndo = IsUndoEnabled();
552  EnableUndo( false );
553  bool bUpdateMode = SetUpdateLayout( false );
554  sal_Int32 nPara = GetParagraphCount();
555  for ( sal_Int32 j=0; j<nPara; j++ )
556  {
557  SetParaAttribs( j, rNewSet );
558  }
559  if ( bUpdateMode )
560  SetUpdateLayout( true );
561  if ( bUndo )
562  EnableUndo( true );
563 }
564 
565 void ScEditEngineDefaulter::SetDefaults( std::unique_ptr<SfxItemSet> pSet )
566 {
567  if ( bDeleteDefaults )
568  delete pDefaults;
569  pDefaults = pSet.release();
570  bDeleteDefaults = true;
571  if ( pDefaults )
572  SetDefaults( *pDefaults, false );
573 }
574 
576 {
577  if ( !pDefaults )
578  {
580  bDeleteDefaults = true;
581  }
582  pDefaults->Put( rItem );
583  SetDefaults( *pDefaults, false );
584 }
585 
587 {
588  if ( !pDefaults )
589  {
591  bDeleteDefaults = true;
592  }
593  return *pDefaults;
594 }
595 
597 {
598  bool bUpdateMode = SetUpdateLayout( false );
599  SetText( rTextObject );
600  if ( pDefaults )
601  SetDefaults( *pDefaults, false );
602  if ( bUpdateMode )
603  SetUpdateLayout( true );
604 }
605 
607  const SfxItemSet& rSet, bool bRememberCopy )
608 {
609  bool bUpdateMode = SetUpdateLayout( false );
610  SetText( rTextObject );
611  SetDefaults( rSet, bRememberCopy );
612  if ( bUpdateMode )
613  SetUpdateLayout( true );
614 }
615 
617  std::unique_ptr<SfxItemSet> pSet )
618 {
619  bool bUpdateMode = SetUpdateLayout( false );
620  SetText( rTextObject );
621  SetDefaults( std::move(pSet) );
622  if ( bUpdateMode )
623  SetUpdateLayout( true );
624 }
625 
627 {
628  bool bUpdateMode = SetUpdateLayout( false );
629  SetText( rText );
630  if ( pDefaults )
631  SetDefaults( *pDefaults, false );
632  if ( bUpdateMode )
633  SetUpdateLayout( true );
634 }
635 
636 void ScEditEngineDefaulter::SetTextNewDefaults( const OUString& rText,
637  const SfxItemSet& rSet )
638 {
639  bool bUpdateMode = SetUpdateLayout( false );
640  SetText( rText );
641  SetDefaults( rSet );
642  if ( bUpdateMode )
643  SetUpdateLayout( true );
644 }
645 
646 void ScEditEngineDefaulter::SetTextNewDefaults( const OUString& rText,
647  std::unique_ptr<SfxItemSet> pSet )
648 {
649  bool bUpdateMode = SetUpdateLayout( false );
650  SetText( rText );
651  SetDefaults( std::move(pSet) );
652  if ( bUpdateMode )
653  SetUpdateLayout( true );
654 }
655 
657 {
658  if ( pDefaults )
659  {
660  sal_Int32 nPara = GetParagraphCount();
661  for ( sal_Int32 j=0; j<nPara; j++ )
662  SetParaAttribs( j, *pDefaults );
663  }
664 }
665 
667 {
668  std::optional<SfxItemSet> pCharItems;
669  bool bUpdateMode = SetUpdateLayout( false );
670  sal_Int32 nParCount = GetParagraphCount();
671  for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
672  {
673  const SfxItemSet& rParaAttribs = GetParaAttribs( nPar );
674  sal_uInt16 nWhich;
675  for (nWhich = EE_CHAR_START; nWhich <= EE_CHAR_END; nWhich ++)
676  {
677  const SfxPoolItem* pParaItem;
678  if ( rParaAttribs.GetItemState( nWhich, false, &pParaItem ) == SfxItemState::SET )
679  {
680  // if defaults are set, use only items that are different from default
681  if ( !pDefaults || *pParaItem != pDefaults->Get(nWhich) )
682  {
683  if (!pCharItems)
684  pCharItems.emplace( GetEmptyItemSet() );
685  pCharItems->Put( *pParaItem );
686  }
687  }
688  }
689 
690  if ( pCharItems )
691  {
692  std::vector<sal_Int32> aPortions;
693  GetPortions( nPar, aPortions );
694 
695  // loop through the portions of the paragraph, and set only those items
696  // that are not overridden by existing character attributes
697 
698  sal_Int32 nStart = 0;
699  for ( const sal_Int32 nEnd : aPortions )
700  {
701  ESelection aSel( nPar, nStart, nPar, nEnd );
702  SfxItemSet aOldCharAttrs = GetAttribs( aSel );
703  SfxItemSet aNewCharAttrs = *pCharItems;
704  for (nWhich = EE_CHAR_START; nWhich <= EE_CHAR_END; nWhich ++)
705  {
706  // Clear those items that are different from existing character attributes.
707  // Where no character attributes are set, GetAttribs returns the paragraph attributes.
708  const SfxPoolItem* pItem;
709  if ( aNewCharAttrs.GetItemState( nWhich, false, &pItem ) == SfxItemState::SET &&
710  *pItem != aOldCharAttrs.Get(nWhich) )
711  {
712  aNewCharAttrs.ClearItem(nWhich);
713  }
714  }
715  if ( aNewCharAttrs.Count() )
716  QuickSetAttribs( aNewCharAttrs, aSel );
717 
718  nStart = nEnd;
719  }
720 
721  pCharItems.reset();
722  }
723 
724  if ( rParaAttribs.Count() )
725  {
726  // clear all paragraph attributes (including defaults),
727  // so they are not contained in resulting EditTextObjects
728 
729  SetParaAttribs( nPar, SfxItemSet( *rParaAttribs.GetPool(), rParaAttribs.GetRanges() ) );
730  }
731  }
732  if ( bUpdateMode )
733  SetUpdateLayout( true );
734 }
735 
737  : ScFieldEditEngine( pDoc, pDoc->GetEnginePool() )
738 {
741 }
742 
744  SfxItemPool* pEngineItemPool, ScDocument* pDoc, SfxItemPool* pTextObjectPool )
745  : ScFieldEditEngine( pDoc, pEngineItemPool, pTextObjectPool )
746 {
747  if ( pTextObjectPool )
748  SetEditTextObjectPool( pTextObjectPool );
749  Init( rPattern );
750 }
751 
752 void ScTabEditEngine::Init( const ScPatternAttr& rPattern )
753 {
754  SetRefMapMode(MapMode(MapUnit::Map100thMM));
755  auto pEditDefaults = std::make_unique<SfxItemSet>( GetEmptyItemSet() );
756  rPattern.FillEditItemSet( pEditDefaults.get() );
757  SetDefaults( std::move(pEditDefaults) );
758  // we have no StyleSheets for text
759  SetControlWord( GetControlWord() & ~EEControlBits::RTFSTYLESHEETS );
760 }
761 
762 // field commands for header and footer
763 
764 // numbers from \sw\source\core\doc\numbers.cxx
765 
766 static OUString lcl_GetCharStr( sal_Int32 nNo )
767 {
768  OSL_ENSURE( nNo, "0 is an invalid number !!" );
769  OUString aStr;
770 
771  const sal_Int32 coDiff = 'Z' - 'A' +1;
772  sal_Int32 nCalc;
773 
774  do {
775  nCalc = nNo % coDiff;
776  if( !nCalc )
777  nCalc = coDiff;
778  aStr = OUStringChar( sal_Unicode('a' - 1 + nCalc) ) + aStr;
779  nNo = sal::static_int_cast<sal_Int32>( nNo - nCalc );
780  if( nNo )
781  nNo /= coDiff;
782  } while( nNo );
783  return aStr;
784 }
785 
786 static OUString lcl_GetNumStr(sal_Int32 nNo, SvxNumType eType)
787 {
788  OUString aTmpStr('0');
789  if( nNo )
790  {
791  switch( eType )
792  {
793  case css::style::NumberingType::CHARS_UPPER_LETTER:
794  case css::style::NumberingType::CHARS_LOWER_LETTER:
795  aTmpStr = lcl_GetCharStr( nNo );
796  break;
797 
798  case css::style::NumberingType::ROMAN_UPPER:
799  case css::style::NumberingType::ROMAN_LOWER:
800  if( nNo < 4000 )
801  aTmpStr = SvxNumberFormat::CreateRomanString( nNo, ( eType == css::style::NumberingType::ROMAN_UPPER ) );
802  else
803  aTmpStr.clear();
804  break;
805 
806  case css::style::NumberingType::NUMBER_NONE:
807  aTmpStr.clear();
808  break;
809 
810 // CHAR_SPECIAL:
811 // ????
812 
813 // case ARABIC: is default now
814  default:
815  aTmpStr = OUString::number(nNo);
816  break;
817  }
818 
819  if( css::style::NumberingType::CHARS_UPPER_LETTER == eType )
820  aTmpStr = aTmpStr.toAsciiUpperCase();
821  }
822  return aTmpStr;
823 }
824 
826  : aDateTime ( DateTime::EMPTY )
827 {
828  nPageNo = nTotalPages = 0;
830 }
831 
833  : ScEditEngineDefaulter( pEnginePoolP,true/*bDeleteEnginePoolP*/ )
834 {
835 }
836 
838  sal_Int32 /* nPara */, sal_Int32 /* nPos */,
839  std::optional<Color>& /* rTxtColor */, std::optional<Color>& /* rFldColor */ )
840 {
841  const SvxFieldData* pFieldData = rField.GetField();
842  if (!pFieldData)
843  return "?";
844 
845  OUString aRet;
846  sal_Int32 nClsId = pFieldData->GetClassId();
847  switch (nClsId)
848  {
849  case text::textfield::Type::PAGE:
851  break;
852  case text::textfield::Type::PAGES:
854  break;
855  case text::textfield::Type::EXTENDED_TIME:
856  case text::textfield::Type::TIME:
857  // For now, time field in the header / footer is always dynamic.
859  break;
860  case text::textfield::Type::DOCINFO_TITLE:
861  aRet = aData.aTitle;
862  break;
863  case text::textfield::Type::EXTENDED_FILE:
864  {
865  switch (static_cast<const SvxExtFileField*>(pFieldData)->GetFormat())
866  {
867  case SvxFileFormat::PathFull :
868  aRet = aData.aLongDocName;
869  break;
870  default:
871  aRet = aData.aShortDocName;
872  }
873  }
874  break;
876  aRet = aData.aTabName;
877  break;
880  break;
881  default:
882  aRet = "?";
883  }
884 
885  return aRet;
886 }
887 
888 // field data
889 
891  ScDocument* pDoc, SfxItemPool* pEnginePoolP,
892  SfxItemPool* pTextObjectPool, bool bDeleteEnginePoolP) :
893  ScEditEngineDefaulter( pEnginePoolP, bDeleteEnginePoolP ),
894  mpDoc(pDoc), bExecuteURL(true)
895 {
896  if ( pTextObjectPool )
897  SetEditTextObjectPool( pTextObjectPool );
898  SetControlWord( EEControlBits(GetControlWord() | EEControlBits::MARKFIELDS) & ~EEControlBits::RTFSTYLESHEETS );
899 }
900 
902  sal_Int32 /* nPara */, sal_Int32 /* nPos */,
903  std::optional<Color>& rTxtColor, std::optional<Color>& /* rFldColor */ )
904 {
905  const SvxFieldData* pFieldData = rField.GetField();
906 
907  if (!pFieldData)
908  return " ";
909 
910  return ScEditUtil::GetCellFieldValue(*pFieldData, mpDoc, &rTxtColor);
911 }
912 
914 {
915  if (!bExecuteURL)
916  return;
917  if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(rField.GetField()))
918  {
919  ScGlobal::OpenURL(pURLField->GetURL(), pURLField->GetTargetFrame());
920  }
921 }
922 
924  SfxItemPool* pTextObjectPool ) :
925  ScEditEngineDefaulter( pEnginePoolP, false/*bDeleteEnginePoolP*/ )
926 {
927  if ( pTextObjectPool )
928  SetEditTextObjectPool( pTextObjectPool );
929  SetControlWord( EEControlBits(GetControlWord() | EEControlBits::MARKFIELDS) & ~EEControlBits::RTFSTYLESHEETS );
930 }
931 
932 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Long const nBottomMargin
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
tools::Rectangle GetEditArea(const ScPatternAttr *pPattern, bool bForceToTop)
Definition: editutil.cxx:316
std::unique_ptr< SfxItemSet > pEditAttrs
Definition: editutil.hxx:94
virtual ~ScEditEngineDefaulter() override
Definition: editutil.cxx:537
OUString aLongDocName
Definition: editutil.hxx:208
constexpr double nPPTY
SCCOL GetColMerge() const
Definition: attrib.hxx:68
OUString GetText(LineEnd eEnd=LINEEND_LF) const
EEControlBits GetControlWord() const
URL aURL
Fraction aZoomX
Definition: editutil.hxx:46
Fraction aZoomY
Definition: editutil.hxx:47
void SetDefaults(const SfxItemSet &rDefaults, bool bRememberCopy=true)
Creates a copy of SfxItemSet if bRememberCopy set.
Definition: editutil.cxx:541
constexpr TypedWhichId< SvxAutoKernItem > EE_CHAR_PAIRKERNING(EE_CHAR_START+11)
SCTAB nTab
Definition: editutil.hxx:41
SCROW nRow
Definition: editutil.hxx:40
SfxItemSet * pDefaults
Definition: editutil.hxx:112
constexpr TypedWhichId< SvxKerningItem > EE_CHAR_KERNING(EE_CHAR_START+12)
constexpr TypedWhichId< ScPatternAttr > ATTR_PATTERN(156)
#define EMPTY_OUSTRING
Definition: global.hxx:214
OUString GetTitle(sal_uInt16 nMaxLen=0) const
const SfxItemSet & GetEmptyItemSet() const
constexpr TypedWhichId< SfxBoolItem > ATTR_VERTICAL_ASIAN(137)
Point aCellPos
Definition: editutil.hxx:42
ScEditEngineDefaulter(SfxItemPool *pEnginePool, bool bDeleteEnginePool=false)
bDeleteEnginePool: Engine becomes the owner of the pool and deletes it on destruction ...
Definition: editutil.cxx:517
tools::Long const nLeftMargin
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rTxtColor, std::optional< Color > &rFldColor) override
Definition: editutil.cxx:901
long Long
const WhichRangesContainer & GetRanges() const
static void OpenURL(const OUString &rURL, const OUString &rTarget, bool bIgnoreSettings=false)
Open the specified URL.
Definition: global.cxx:762
sal_Int16 nId
const SfxItemSet & GetItemSet() const
const MapMode & GetMapMode() const
ScFieldEditEngine(ScDocument *pDoc, SfxItemPool *pEnginePool, SfxItemPool *pTextObjectPool=nullptr, bool bDeleteEnginePool=false)
Definition: editutil.cxx:890
double nPPTY
Definition: editutil.hxx:45
sal_Int16 GetRightMargin() const
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
EEControlBits
static std::unique_ptr< EditTextObject > CreateURLObjectFromURL(ScDocument &rDoc, const OUString &rURL, const OUString &rText)
Definition: editutil.cxx:138
void SetMapMode()
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
SfxItemSet GetAttribs(sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags=GetAttribsFlags::ALL) const
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
css::uno::Reference< css::document::XDocumentProperties > getDocProperties() const
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4192
SvxNumType
ScHeaderFieldData aData
Definition: editutil.hxx:223
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6087
ScDocument * pDoc
Definition: editutil.hxx:38
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rTxtColor, std::optional< Color > &rFldColor) override
Definition: editutil.cxx:837
sal_uInt16 sal_Unicode
static SC_DLLPUBLIC const LocaleDataWrapper & getLocaleData()
Definition: global.cxx:1007
virtual ~ScEnginePoolHelper()
Definition: editutil.cxx:511
SvxCellVerJustify
ScNoteEditEngine(SfxItemPool *pEnginePool, SfxItemPool *pTextObjectPool)
Definition: editutil.cxx:923
void SetText(const OUString &rStr)
void SetControlWord(EEControlBits nWord)
SVX_NUM_ARABIC
Mutex aMutex
void Init(const ScPatternAttr &rPattern)
Definition: editutil.cxx:752
ScEditAttrTester(ScEditEngineDefaulter *pEng)
Definition: editutil.cxx:433
OUString aShortDocName
Definition: editutil.hxx:209
virtual bool RemoveCharAttribs(sal_uInt16 nWhich)=0
static OUString lcl_GetDelimitedString(const EditEngine &rEngine, const char c)
Definition: editutil.cxx:73
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:4766
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
Definition: patattr.hxx:70
ocSep
#define SAL_N_ELEMENTS(arr)
bool IsUndoEnabled() const
constexpr double nPPTX
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:441
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
static void GetFont(vcl::Font &rFont, const SfxItemSet &rItemSet, ScAutoFontColorMode eAutoMode, const OutputDevice *pOutDev=nullptr, const Fraction *pScale=nullptr, const SfxItemSet *pCondSet=nullptr, SvtScriptType nScript=SvtScriptType::NONE, const Color *pBackConfigColor=nullptr, const Color *pTextConfigColor=nullptr)
Static helper function to fill a font object from the passed item set.
Definition: patattr.cxx:215
static const OUString & GetNativeSymbol(OpCode eOp)
tools::Long nTotalPages
Definition: editutil.hxx:213
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
Definition: editutil.cxx:596
static ScFieldEditEngine & GetStaticFieldEditEngine()
A static instance of ScFieldEditEngine not capable of resolving document specific fields...
Definition: global.cxx:1079
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetDefaultItem(const SfxPoolItem &rItem)
Set the item in the default ItemSet which is created if it doesn't exist yet.
Definition: editutil.cxx:575
static INetURLHistory * GetOrCreate()
int i
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
sal_uInt32 GetTextLen() const
sal_Int16 SCCOL
Definition: types.hxx:21
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
sal_uLong GetScaledRowHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, double fScale, const sal_uLong *pnMaxHeight=nullptr) const
Definition: document.cxx:4229
#define SC_MOD()
Definition: scmod.hxx:250
void RepeatDefaults()
Re-apply existing defaults if set, same as in SetText, but without EnableUndo/SetUpdateMode.
Definition: editutil.cxx:656
bool bInPrintTwips
Definition: editutil.hxx:48
sal_uInt16 Count() const
virtual OUString GetText(sal_Int32 nPara) const =0
OUString aTabName
Definition: editutil.hxx:210
std::unique_ptr< EditTextObject > CreateTextObject()
ScHeaderEditEngine(SfxItemPool *pEnginePool)
Definition: editutil.cxx:832
constexpr sal_uInt16 EE_CHAR_START(EE_PARA_END+1)
OUString GetFormatted(SvNumberFormatter &rFormatter, LanguageType eLanguage) const
virtual bool HasField(sal_Int32 nType=css::text::textfield::Type::UNSPECIFIED) const =0
const OUString & GetRepresentation() const
constexpr TypedWhichId< ScVerticalStackCell > ATTR_STACKED(134)
constexpr sal_uInt16 EE_CHAR_END(EE_CHAR_START+32)
static OUString lcl_GetNumStr(sal_Int32 nNo, SvxNumType eType)
Definition: editutil.cxx:786
static SC_DLLPUBLIC LanguageType eLnge
Definition: global.hxx:553
void SetDefaultLanguage(LanguageType eLang)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
sal_Int16 GetBottomMargin() const
static LanguageType GetEditDefaultLanguage()
Definition: global.cxx:861
sal_Int32 GetParagraphCount() const
bool SetUpdateLayout(bool bUpdate, bool bRestoring=false)
static OUString GetCellFieldValue(const SvxFieldData &rFieldData, const ScDocument *pDoc, std::optional< Color > *ppTextColor)
Definition: editutil.cxx:196
ScEditUtil(ScDocument *pDocument, SCCOL nX, SCROW nY, SCTAB nZ, const Point &rCellPos, OutputDevice *pDevice, double nScaleX, double nScaleY, const Fraction &rX, const Fraction &rY, bool bPrintTwips=false)
Definition: editutil.cxx:55
const OUString & GetURL() const
virtual sal_Int32 GetClassId() const
bool QueryUrl(const INetURLObject &rUrl)
constexpr sal_uInt16 EE_FEATURE_NOTCONV(EE_FEATURE_LINEBR+1)
OUString getDate(const Date &rDate) const
void SetRefMapMode(const MapMode &rMapMode)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_Int32 SCROW
Definition: types.hxx:17
tools::Long GetIndent(const ScPatternAttr *pPattern) const
Definition: editutil.cxx:283
void GetMargins(const ScPatternAttr *pPattern, tools::Long &nLeftMargin, tools::Long &nTopMargin, tools::Long &nRightMargin, tools::Long &BottomMargin) const
Definition: editutil.cxx:300
tools::Long const nTopMargin
SfxItemState
static OUString CreateRomanString(sal_Int32 nNo, bool bUpper)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
void SetFont(const vcl::Font &rNewFont)
double nPPTX
Definition: editutil.hxx:44
virtual sal_Int32 GetParagraphCount() const =0
virtual void FieldClicked(const SvxFieldItem &rField) override
Definition: editutil.cxx:913
tools::Long GetTextHeight() const
OUString aName
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
void EnableUndo(bool bEnable)
void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList)
static OUString ModifyDelimiters(const OUString &rOld)
Definition: editutil.cxx:64
sal_Int16 GetLeftMargin() const
const SfxItemSet & GetDefaults()
Returns the stored defaults, used to find non-default character attributes.
Definition: editutil.cxx:586
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
ScEnginePoolHelper(SfxItemPool *pEnginePool, bool bDeleteEnginePool)
Definition: editutil.cxx:492
void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel)
tools::Long GetNeededSize(SCCOL nCol, SCROW nRow, SCTAB nTab, OutputDevice *pDev, double nPPTX, double nPPTY, const Fraction &rZoomX, const Fraction &rZoomY, bool bWidth, bool bTotalSize=false, bool bInPrintTwips=false)
Definition: document.cxx:4284
Reference< XComponentContext > getProcessComponentContext()
#define EE_TEXTPOS_MAX_COUNT
ScTabEditEngine(ScDocument *pDoc)
Definition: editutil.cxx:736
static OUString lcl_GetCharStr(sal_Int32 nNo)
Definition: editutil.cxx:766
DateTime aDateTime
Definition: editutil.hxx:211
tools::Long const nRightMargin
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
static OUString GetSpaceDelimitedString(const EditEngine &rEngine)
Retrieves string with paragraphs delimited by spaces.
Definition: editutil.cxx:99
static void RemoveCharAttribs(EditTextObject &rEditText, const ScPatternAttr &rAttr)
Definition: editutil.cxx:149
SC_DLLPUBLIC SfxItemPool * GetEditPool() const
Definition: documen2.cxx:447
int GetTab() const
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Definition: document.cxx:986
tools::Long nPageNo
Definition: editutil.hxx:212
virtual bool HasOnlineSpellErrors() const =0
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
Definition: editutil.cxx:113
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet)
ScDocument * mpDoc
Definition: editutil.hxx:179
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1057
static std::unique_ptr< EditTextObject > Clone(const EditTextObject &rSrc, ScDocument &rDestDoc)
Definition: editutil.cxx:170
VclPtr< OutputDevice > pDev
Definition: editutil.hxx:43
SCCOL nCol
Definition: editutil.hxx:39
constexpr sal_uInt16 EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
SCROW GetRowMerge() const
Definition: attrib.hxx:69
SvxNumType eNumType
Definition: editutil.hxx:214
OUString getTime(const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
#define EE_PARA_MAX_COUNT
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4151
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
void SetTextNewDefaults(const EditTextObject &rTextObject, const SfxItemSet &rDefaults, bool bRememberCopy=true)
Current defaults are not applied, new defaults are applied.
Definition: editutil.cxx:606
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
void RemoveParaAttribs()
Paragraph attributes that are not defaults are copied to character attributes and all paragraph attri...
Definition: editutil.cxx:666
static OUString GetMultilineString(const EditEngine &rEngine)
Retrieves string with paragraphs delimited by new lines (' ').
Definition: editutil.cxx:103
aStr
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:213
void SetEditTextObjectPool(SfxItemPool *pPool)
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
Definition: documen2.cxx:457
const SfxItemSet & GetParaAttribs(sal_Int32 nPara) const
constexpr TypedWhichId< SvXMLAttrContainerItem > EE_CHAR_XMLATTRIBS(EE_CHAR_START+28)
sal_Int16 SCTAB
Definition: types.hxx:22
constexpr TypedWhichId< SvxMarginItem > ATTR_MARGIN(143)
const SvxFieldData * GetField() const
void FillEditItemSet(SfxItemSet *pEditSet, const SfxItemSet *pCondSet=nullptr) const
Converts all Calc items contained in the own item set to edit engine items and puts them into pEditSe...
Definition: patattr.cxx:775
SvxURLFormat GetFormat() const
sal_Int16 GetTopMargin() const