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/inethist.hxx>
33 #include <sfx2/objsh.hxx>
34 #include <osl/diagnose.h>
35 
36 #include <com/sun/star/text/textfield/Type.hpp>
37 #include <com/sun/star/document/XDocumentProperties.hpp>
38 
39 #include <editutil.hxx>
40 #include <global.hxx>
41 #include <attrib.hxx>
42 #include <document.hxx>
43 #include <docpool.hxx>
44 #include <patattr.hxx>
45 #include <scmod.hxx>
46 #include <inputopt.hxx>
47 #include <compiler.hxx>
48 
49 using namespace com::sun::star;
50 
51 // delimiters additionally to EditEngine default:
52 
54  const Point& rCellPos,
55  OutputDevice* pDevice, double nScaleX, double nScaleY,
56  const Fraction& rX, const Fraction& rY, bool bPrintTwips ) :
57  pDoc(pDocument),nCol(nX),nRow(nY),nTab(nZ),
58  aCellPos(rCellPos),pDev(pDevice),
59  nPPTX(nScaleX),nPPTY(nScaleY),aZoomX(rX),aZoomY(rY),
60  bInPrintTwips(bPrintTwips) {}
61 
62 OUString ScEditUtil::ModifyDelimiters( const OUString& rOld )
63 {
64  // underscore is used in function argument names
65  OUString aRet = rOld.replaceAll("_", "") +
66  "=()+-*/^&<>" +
67  ScCompiler::GetNativeSymbol(ocSep); // argument separator is localized.
68  return aRet;
69 }
70 
71 static OUString lcl_GetDelimitedString( const EditEngine& rEngine, const char c )
72 {
73  sal_Int32 nParCount = rEngine.GetParagraphCount();
74  OUStringBuffer aRet( nParCount * 80 );
75  for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
76  {
77  if (nPar > 0)
78  aRet.append(c);
79  aRet.append( rEngine.GetText( nPar ));
80  }
81  return aRet.makeStringAndClear();
82 }
83 
84 static OUString lcl_GetDelimitedString( const EditTextObject& rEdit, const char c )
85 {
86  sal_Int32 nParCount = rEdit.GetParagraphCount();
87  OUStringBuffer aRet( nParCount * 80 );
88  for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
89  {
90  if (nPar > 0)
91  aRet.append(c);
92  aRet.append( rEdit.GetText( nPar ));
93  }
94  return aRet.makeStringAndClear();
95 }
96 
98 {
99  return lcl_GetDelimitedString(rEngine, ' ');
100 }
101 OUString ScEditUtil::GetMultilineString( const EditEngine& rEngine )
102 {
103  return lcl_GetDelimitedString(rEngine, '\n');
104 }
105 
107 {
108  return lcl_GetDelimitedString(rEdit, '\n');
109 }
110 
111 OUString ScEditUtil::GetString( const EditTextObject& rEditText, const ScDocument* pDoc )
112 {
113  if( !rEditText.HasField())
114  return GetMultilineString( rEditText );
115 
116  static osl::Mutex aMutex;
117  osl::MutexGuard aGuard( aMutex);
118  // ScFieldEditEngine is needed to resolve field contents.
119  if (pDoc)
120  {
121  /* TODO: make ScDocument::GetEditEngine() const? Most likely it's only
122  * not const because of the pointer assignment, make that mutable, and
123  * then remove the ugly const_cast here. */
124  EditEngine& rEE = const_cast<ScDocument*>(pDoc)->GetEditEngine();
125  rEE.SetText( rEditText);
126  return GetMultilineString( rEE);
127  }
128  else
129  {
131  rEE.SetText( rEditText);
132  return GetMultilineString( rEE);
133  }
134 }
135 
136 std::unique_ptr<EditTextObject> ScEditUtil::CreateURLObjectFromURL( ScDocument& rDoc, const OUString& rURL, const OUString& rText )
137 {
138  SvxURLField aUrlField( rURL, rText, SvxURLFormat::AppDefault);
139  EditEngine& rEE = rDoc.GetEditEngine();
140  rEE.SetText( EMPTY_OUSTRING );
143 
144  return rEE.CreateTextObject();
145 }
146 
148 {
149  static const struct {
150  sal_uInt16 nAttrType;
151  sal_uInt16 nCharType;
152  } AttrTypeMap[] = {
157  };
158 
159  const SfxItemSet& rSet = rAttr.GetItemSet();
160  const SfxPoolItem* pItem;
161  for (size_t i = 0; i < SAL_N_ELEMENTS(AttrTypeMap); ++i)
162  {
163  if ( rSet.GetItemState(AttrTypeMap[i].nAttrType, false, &pItem) == SfxItemState::SET )
164  rEditText.RemoveCharAttribs(AttrTypeMap[i].nCharType);
165  }
166 }
167 
168 std::unique_ptr<EditTextObject> ScEditUtil::Clone( const EditTextObject& rObj, ScDocument& rDestDoc )
169 {
170  std::unique_ptr<EditTextObject> pNew;
171 
172  EditEngine& rEngine = rDestDoc.GetEditEngine();
173  if (rObj.HasOnlineSpellErrors())
174  {
175  EEControlBits nControl = rEngine.GetControlWord();
176  const EEControlBits nSpellControl = EEControlBits::ONLINESPELLING | EEControlBits::ALLOWBIGOBJS;
177  bool bNewControl = ( (nControl & nSpellControl) != nSpellControl );
178  if (bNewControl)
179  rEngine.SetControlWord(nControl | nSpellControl);
180  rEngine.SetText(rObj);
181  pNew = rEngine.CreateTextObject();
182  if (bNewControl)
183  rEngine.SetControlWord(nControl);
184  }
185  else
186  {
187  rEngine.SetText(rObj);
188  pNew = rEngine.CreateTextObject();
189  }
190 
191  return pNew;
192 }
193 
195  const SvxFieldData& rFieldData, const ScDocument* pDoc, std::optional<Color>* ppTextColor )
196 {
197  OUString aRet;
198  switch (rFieldData.GetClassId())
199  {
200  case text::textfield::Type::URL:
201  {
202  const SvxURLField& rField = static_cast<const SvxURLField&>(rFieldData);
203  const OUString& aURL = rField.GetURL();
204 
205  switch (rField.GetFormat())
206  {
207  case SvxURLFormat::AppDefault: //TODO: configurable with App???
208  case SvxURLFormat::Repr:
209  aRet = rField.GetRepresentation();
210  break;
211  case SvxURLFormat::Url:
212  aRet = aURL;
213  break;
214  default:
215  ;
216  }
217 
220 
221  if (ppTextColor)
222  *ppTextColor = SC_MOD()->GetColorConfig().GetColorValue(eEntry).nColor;
223  }
224  break;
225  case text::textfield::Type::EXTENDED_TIME:
226  {
227  const SvxExtTimeField& rField = static_cast<const SvxExtTimeField&>(rFieldData);
228  if (pDoc)
229  aRet = rField.GetFormatted(*pDoc->GetFormatTable(), ScGlobal::eLnge);
230  else
231  {
232  /* TODO: quite expensive, we could have a global formatter? */
234  aRet = rField.GetFormatted(aFormatter, ScGlobal::eLnge);
235  }
236  }
237  break;
239  {
240  Date aDate(Date::SYSTEM);
241  aRet = ScGlobal::getLocaleDataPtr()->getDate(aDate);
242  }
243  break;
244  case text::textfield::Type::DOCINFO_TITLE:
245  {
246  if (pDoc)
247  {
248  SfxObjectShell* pDocShell = pDoc->GetDocumentShell();
249  if (pDocShell)
250  {
251  aRet = pDocShell->getDocProperties()->getTitle();
252  if (aRet.isEmpty())
253  aRet = pDocShell->GetTitle();
254  }
255  }
256  if (aRet.isEmpty())
257  aRet = "?";
258  }
259  break;
261  {
262  const SvxTableField& rField = static_cast<const SvxTableField&>(rFieldData);
263  SCTAB nTab = rField.GetTab();
264  OUString aName;
265  if (pDoc && pDoc->GetName(nTab, aName))
266  aRet = aName;
267  else
268  aRet = "?";
269  }
270  break;
271  default:
272  aRet = "?";
273  }
274 
275  if (aRet.isEmpty()) // empty is yuck
276  aRet = " "; // space is default of EditEngine
277 
278  return aRet;
279 }
280 
282 {
283  if (!pPattern)
284  pPattern = pDoc->GetPattern( nCol, nRow, nTab );
285 
286  if ( pPattern->GetItem(ATTR_HOR_JUSTIFY).GetValue() ==
287  SvxCellHorJustify::Left )
288  {
289  tools::Long nIndent = pPattern->GetItem(ATTR_INDENT).GetValue();
290  if (!bInPrintTwips)
291  nIndent = static_cast<tools::Long>(nIndent * nPPTX);
292  return nIndent;
293  }
294 
295  return 0;
296 }
297 
298 void ScEditUtil::GetMargins(const ScPatternAttr* pPattern, tools::Long& nLeftMargin, tools::Long& nTopMargin,
299  tools::Long& nRightMargin, tools::Long& nBottomMargin) const
300 {
301  if (!pPattern)
302  pPattern = pDoc->GetPattern( nCol, nRow, nTab );
303 
304  const SvxMarginItem* pMargin = &pPattern->GetItem(ATTR_MARGIN);
305  if (!pMargin)
306  return;
307 
308  nLeftMargin = bInPrintTwips ? pMargin->GetLeftMargin() : static_cast<tools::Long>(pMargin->GetLeftMargin() * nPPTX);
309  nRightMargin = bInPrintTwips ? pMargin->GetRightMargin() : static_cast<tools::Long>(pMargin->GetRightMargin() * nPPTX);
310  nTopMargin = bInPrintTwips ? pMargin->GetTopMargin() : static_cast<tools::Long>(pMargin->GetTopMargin() * nPPTY);
311  nBottomMargin = bInPrintTwips ? pMargin->GetBottomMargin() : static_cast<tools::Long>(pMargin->GetBottomMargin() * nPPTY);
312 }
313 
314 tools::Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bForceToTop )
315 {
316  // bForceToTop = always align to top, for editing
317  // (sal_False for querying URLs etc.)
318 
319  if (!pPattern)
320  pPattern = pDoc->GetPattern( nCol, nRow, nTab );
321 
322  Point aStartPos = aCellPos;
323 
324  bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
325  tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
326 
327  const ScMergeAttr* pMerge = &pPattern->GetItem(ATTR_MERGE);
328  tools::Long nCellX = pDoc->GetColWidth(nCol,nTab);
329  if (!bInPrintTwips)
330  nCellX = static_cast<tools::Long>( nCellX * nPPTX );
331  if ( pMerge->GetColMerge() > 1 )
332  {
333  SCCOL nCountX = pMerge->GetColMerge();
334  for (SCCOL i=1; i<nCountX; i++)
335  {
336  tools::Long nColWidth = pDoc->GetColWidth(nCol+i,nTab);
337  nCellX += (bInPrintTwips ? nColWidth : static_cast<tools::Long>( nColWidth * nPPTX ));
338  }
339  }
341  if (!bInPrintTwips)
342  nCellY = static_cast<tools::Long>( nCellY * nPPTY );
343  if ( pMerge->GetRowMerge() > 1 )
344  {
345  SCROW nCountY = pMerge->GetRowMerge();
346  if (bInPrintTwips)
347  nCellY += pDoc->GetRowHeight(nRow + 1, nRow + nCountY - 1, nTab);
348  else
349  nCellY += static_cast<tools::Long>(pDoc->GetScaledRowHeight( nRow+1, nRow+nCountY-1, nTab, nPPTY));
350  }
351 
355  tools::Long nDifX = 0;
356  {
358  bool bInPrintTwipsOrig = bInPrintTwips;
359  bInPrintTwips = true;
360  tools::Long nIndent = GetIndent(pPattern);
361  GetMargins(pPattern, nLeftMargin, nTopMargin, nRightMargin, nBottomMargin);
362  bInPrintTwips = bInPrintTwipsOrig;
363  // Here rounding may be done only on the sum, ie nDifX,
364  // so need to get margin and indent in twips.
365  nDifX = nLeftMargin + nIndent;
366  if (!bInPrintTwips)
367  {
368  nDifX = static_cast<tools::Long>(nDifX * nPPTX);
369  nRightMargin = static_cast<tools::Long>(nRightMargin * nPPTX);
370  nTopMargin = static_cast<tools::Long>(nTopMargin * nPPTY);
371  nBottomMargin = static_cast<tools::Long>(nBottomMargin * nPPTY);
372  }
373  }
374 
375 
376  aStartPos.AdjustX(nDifX * nLayoutSign );
377  nCellX -= nDifX + nRightMargin; // due to line feed, etc.
378 
379  // align vertical position to the one in the table
380 
381  tools::Long nDifY;
382  SvxCellVerJustify eJust = pPattern->GetItem(ATTR_VER_JUSTIFY).GetValue();
383 
384  // asian vertical is always edited top-aligned
385  bool bAsianVertical = pPattern->GetItem( ATTR_STACKED ).GetValue() &&
386  pPattern->GetItem( ATTR_VERTICAL_ASIAN ).GetValue();
387 
388  if ( eJust == SvxCellVerJustify::Top ||
389  ( bForceToTop && ( SC_MOD()->GetInputOptions().GetTextWysiwyg() || bAsianVertical ) ) )
390  nDifY = nTopMargin;
391  else
392  {
393  MapMode aMode = pDev->GetMapMode();
394  pDev->SetMapMode(MapMode(bInPrintTwips ? MapUnit::MapTwip : MapUnit::MapPixel));
395 
396  tools::Long nTextHeight = pDoc->GetNeededSize( nCol, nRow, nTab,
397  pDev, nPPTX, nPPTY, aZoomX, aZoomY, false /* bWidth */,
398  false /* bTotalSize */, bInPrintTwips );
399  if (!nTextHeight)
400  { // empty cell
401  vcl::Font aFont;
402  // font color doesn't matter here
403  pPattern->GetFont( aFont, SC_AUTOCOL_BLACK, pDev, &aZoomY );
404  pDev->SetFont(aFont);
405  nTextHeight = pDev->GetTextHeight() + nTopMargin + nBottomMargin;
406  }
407 
408  pDev->SetMapMode(aMode);
409 
410  if ( nTextHeight > nCellY + nTopMargin || bForceToTop )
411  nDifY = 0; // too large -> begin at the top
412  else
413  {
414  if ( eJust == SvxCellVerJustify::Center )
415  nDifY = nTopMargin + ( nCellY - nTextHeight ) / 2;
416  else
417  nDifY = nCellY - nTextHeight + nTopMargin; // JUSTIFY_BOTTOM
418  }
419  }
420 
421  aStartPos.AdjustY(nDifY );
422  nCellY -= nDifY;
423 
424  if ( bLayoutRTL )
425  aStartPos.AdjustX( -(nCellX - 2) ); // excluding grid on both sides
426 
427  // -1 -> don't overwrite grid
428  return tools::Rectangle( aStartPos, Size(nCellX-1,nCellY-1) );
429 }
430 
432  bNeedsObject( false ),
433  bNeedsCellAttr( false )
434 {
435  if ( pEngine->GetParagraphCount() > 1 )
436  {
437  bNeedsObject = true; //TODO: find cell attributes ?
438  }
439  else
440  {
441  const SfxPoolItem* pItem = nullptr;
442  pEditAttrs.reset( new SfxItemSet( pEngine->GetAttribs(
443  ESelection(0,0,0,pEngine->GetTextLen(0)), EditEngineAttribs::OnlyHard ) ) );
444  const SfxItemSet& rEditDefaults = pEngine->GetDefaults();
445 
446  for (sal_uInt16 nId = EE_CHAR_START; nId <= EE_CHAR_END && !bNeedsObject; nId++)
447  {
448  SfxItemState eState = pEditAttrs->GetItemState( nId, false, &pItem );
449  if (eState == SfxItemState::DONTCARE)
450  bNeedsObject = true;
451  else if (eState == SfxItemState::SET)
452  {
455  {
456  // Escapement and kerning are kept in EditEngine because there are no
457  // corresponding cell format items. User defined attributes are kept in
458  // EditEngine because "user attributes applied to all the text" is different
459  // from "user attributes applied to the cell".
460 
461  if ( *pItem != rEditDefaults.Get(nId) )
462  bNeedsObject = true;
463  }
464  else
465  if (!bNeedsCellAttr)
466  if ( *pItem != rEditDefaults.Get(nId) )
467  bNeedsCellAttr = true;
468  // rEditDefaults contains the defaults from the cell format
469  }
470  }
471 
472  // contains field commands?
473 
474  SfxItemState eFieldState = pEditAttrs->GetItemState( EE_FEATURE_FIELD, false );
475  if ( eFieldState == SfxItemState::DONTCARE || eFieldState == SfxItemState::SET )
476  bNeedsObject = true;
477 
478  // not converted characters?
479 
480  SfxItemState eConvState = pEditAttrs->GetItemState( EE_FEATURE_NOTCONV, false );
481  if ( eConvState == SfxItemState::DONTCARE || eConvState == SfxItemState::SET )
482  bNeedsObject = true;
483  }
484 }
485 
487 {
488 }
489 
491  bool bDeleteEnginePoolP )
492  :
493  pEnginePool( pEnginePoolP ),
494  pDefaults( nullptr ),
495  bDeleteEnginePool( bDeleteEnginePoolP ),
496  bDeleteDefaults( false )
497 {
498 }
499 
501  :
502  pEnginePool( rOrg.bDeleteEnginePool ? rOrg.pEnginePool->Clone() : rOrg.pEnginePool ),
503  pDefaults( nullptr ),
504  bDeleteEnginePool( rOrg.bDeleteEnginePool ),
505  bDeleteDefaults( false )
506 {
507 }
508 
510 {
511  if ( bDeleteDefaults )
512  delete pDefaults;
513  if ( bDeleteEnginePool )
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 )
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 = GetUpdateMode();
554  if ( bUpdateMode )
555  SetUpdateMode( false );
556  sal_Int32 nPara = GetParagraphCount();
557  for ( sal_Int32 j=0; j<nPara; j++ )
558  {
559  SetParaAttribs( j, rNewSet );
560  }
561  if ( bUpdateMode )
562  SetUpdateMode( true );
563  if ( bUndo )
564  EnableUndo( true );
565 }
566 
567 void ScEditEngineDefaulter::SetDefaults( std::unique_ptr<SfxItemSet> pSet )
568 {
569  if ( bDeleteDefaults )
570  delete pDefaults;
571  pDefaults = pSet.release();
572  bDeleteDefaults = true;
573  if ( pDefaults )
574  SetDefaults( *pDefaults, false );
575 }
576 
578 {
579  if ( !pDefaults )
580  {
582  bDeleteDefaults = true;
583  }
584  pDefaults->Put( rItem );
585  SetDefaults( *pDefaults, false );
586 }
587 
589 {
590  if ( !pDefaults )
591  {
593  bDeleteDefaults = true;
594  }
595  return *pDefaults;
596 }
597 
599 {
600  bool bUpdateMode = GetUpdateMode();
601  if ( bUpdateMode )
602  SetUpdateMode( false );
603  SetText( rTextObject );
604  if ( pDefaults )
605  SetDefaults( *pDefaults, false );
606  if ( bUpdateMode )
607  SetUpdateMode( true );
608 }
609 
611  const SfxItemSet& rSet, bool bRememberCopy )
612 {
613  bool bUpdateMode = GetUpdateMode();
614  if ( bUpdateMode )
615  SetUpdateMode( false );
616  SetText( rTextObject );
617  SetDefaults( rSet, bRememberCopy );
618  if ( bUpdateMode )
619  SetUpdateMode( true );
620 }
621 
623  std::unique_ptr<SfxItemSet> pSet )
624 {
625  bool bUpdateMode = GetUpdateMode();
626  if ( bUpdateMode )
627  SetUpdateMode( false );
628  SetText( rTextObject );
629  SetDefaults( std::move(pSet) );
630  if ( bUpdateMode )
631  SetUpdateMode( true );
632 }
633 
635 {
636  bool bUpdateMode = GetUpdateMode();
637  if ( bUpdateMode )
638  SetUpdateMode( false );
639  SetText( rText );
640  if ( pDefaults )
641  SetDefaults( *pDefaults, false );
642  if ( bUpdateMode )
643  SetUpdateMode( true );
644 }
645 
646 void ScEditEngineDefaulter::SetTextNewDefaults( const OUString& rText,
647  const SfxItemSet& rSet )
648 {
649  bool bUpdateMode = GetUpdateMode();
650  if ( bUpdateMode )
651  SetUpdateMode( false );
652  SetText( rText );
653  SetDefaults( rSet );
654  if ( bUpdateMode )
655  SetUpdateMode( true );
656 }
657 
658 void ScEditEngineDefaulter::SetTextNewDefaults( const OUString& rText,
659  std::unique_ptr<SfxItemSet> pSet )
660 {
661  bool bUpdateMode = GetUpdateMode();
662  if ( bUpdateMode )
663  SetUpdateMode( false );
664  SetText( rText );
665  SetDefaults( std::move(pSet) );
666  if ( bUpdateMode )
667  SetUpdateMode( true );
668 }
669 
671 {
672  if ( pDefaults )
673  {
674  sal_Int32 nPara = GetParagraphCount();
675  for ( sal_Int32 j=0; j<nPara; j++ )
676  SetParaAttribs( j, *pDefaults );
677  }
678 }
679 
681 {
682  std::unique_ptr<SfxItemSet> pCharItems;
683  bool bUpdateMode = GetUpdateMode();
684  if ( bUpdateMode )
685  SetUpdateMode( false );
686  sal_Int32 nParCount = GetParagraphCount();
687  for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
688  {
689  const SfxItemSet& rParaAttribs = GetParaAttribs( nPar );
690  sal_uInt16 nWhich;
691  for (nWhich = EE_CHAR_START; nWhich <= EE_CHAR_END; nWhich ++)
692  {
693  const SfxPoolItem* pParaItem;
694  if ( rParaAttribs.GetItemState( nWhich, false, &pParaItem ) == SfxItemState::SET )
695  {
696  // if defaults are set, use only items that are different from default
697  if ( !pDefaults || *pParaItem != pDefaults->Get(nWhich) )
698  {
699  if (!pCharItems)
700  pCharItems.reset(new SfxItemSet( GetEmptyItemSet() ));
701  pCharItems->Put( *pParaItem );
702  }
703  }
704  }
705 
706  if ( pCharItems )
707  {
708  std::vector<sal_Int32> aPortions;
709  GetPortions( nPar, aPortions );
710 
711  // loop through the portions of the paragraph, and set only those items
712  // that are not overridden by existing character attributes
713 
714  sal_Int32 nStart = 0;
715  for ( const sal_Int32 nEnd : aPortions )
716  {
717  ESelection aSel( nPar, nStart, nPar, nEnd );
718  SfxItemSet aOldCharAttrs = GetAttribs( aSel );
719  SfxItemSet aNewCharAttrs = *pCharItems;
720  for (nWhich = EE_CHAR_START; nWhich <= EE_CHAR_END; nWhich ++)
721  {
722  // Clear those items that are different from existing character attributes.
723  // Where no character attributes are set, GetAttribs returns the paragraph attributes.
724  const SfxPoolItem* pItem;
725  if ( aNewCharAttrs.GetItemState( nWhich, false, &pItem ) == SfxItemState::SET &&
726  *pItem != aOldCharAttrs.Get(nWhich) )
727  {
728  aNewCharAttrs.ClearItem(nWhich);
729  }
730  }
731  if ( aNewCharAttrs.Count() )
732  QuickSetAttribs( aNewCharAttrs, aSel );
733 
734  nStart = nEnd;
735  }
736 
737  pCharItems.reset();
738  }
739 
740  if ( rParaAttribs.Count() )
741  {
742  // clear all paragraph attributes (including defaults),
743  // so they are not contained in resulting EditTextObjects
744 
745  SetParaAttribs( nPar, SfxItemSet( *rParaAttribs.GetPool(), rParaAttribs.GetRanges() ) );
746  }
747  }
748  if ( bUpdateMode )
749  SetUpdateMode( true );
750 }
751 
753  : ScFieldEditEngine( pDoc, pDoc->GetEnginePool() )
754 {
757 }
758 
760  SfxItemPool* pEngineItemPool, ScDocument* pDoc, SfxItemPool* pTextObjectPool )
761  : ScFieldEditEngine( pDoc, pEngineItemPool, pTextObjectPool )
762 {
763  if ( pTextObjectPool )
764  SetEditTextObjectPool( pTextObjectPool );
765  Init( rPattern );
766 }
767 
768 void ScTabEditEngine::Init( const ScPatternAttr& rPattern )
769 {
770  SetRefMapMode(MapMode(MapUnit::Map100thMM));
771  auto pEditDefaults = std::make_unique<SfxItemSet>( GetEmptyItemSet() );
772  rPattern.FillEditItemSet( pEditDefaults.get() );
773  SetDefaults( std::move(pEditDefaults) );
774  // we have no StyleSheets for text
775  SetControlWord( GetControlWord() & ~EEControlBits::RTFSTYLESHEETS );
776 }
777 
778 // field commands for header and footer
779 
780 // numbers from \sw\source\core\doc\numbers.cxx
781 
782 static OUString lcl_GetCharStr( sal_Int32 nNo )
783 {
784  OSL_ENSURE( nNo, "0 is an invalid number !!" );
785  OUString aStr;
786 
787  const sal_Int32 coDiff = 'Z' - 'A' +1;
788  sal_Int32 nCalc;
789 
790  do {
791  nCalc = nNo % coDiff;
792  if( !nCalc )
793  nCalc = coDiff;
794  aStr = OUStringChar( sal_Unicode('a' - 1 + nCalc) ) + aStr;
795  nNo = sal::static_int_cast<sal_Int32>( nNo - nCalc );
796  if( nNo )
797  nNo /= coDiff;
798  } while( nNo );
799  return aStr;
800 }
801 
802 static OUString lcl_GetNumStr(sal_Int32 nNo, SvxNumType eType)
803 {
804  OUString aTmpStr('0');
805  if( nNo )
806  {
807  switch( eType )
808  {
809  case css::style::NumberingType::CHARS_UPPER_LETTER:
810  case css::style::NumberingType::CHARS_LOWER_LETTER:
811  aTmpStr = lcl_GetCharStr( nNo );
812  break;
813 
814  case css::style::NumberingType::ROMAN_UPPER:
815  case css::style::NumberingType::ROMAN_LOWER:
816  if( nNo < 4000 )
817  aTmpStr = SvxNumberFormat::CreateRomanString( nNo, ( eType == css::style::NumberingType::ROMAN_UPPER ) );
818  else
819  aTmpStr.clear();
820  break;
821 
822  case css::style::NumberingType::NUMBER_NONE:
823  aTmpStr.clear();
824  break;
825 
826 // CHAR_SPECIAL:
827 // ????
828 
829 // case ARABIC: is default now
830  default:
831  aTmpStr = OUString::number(nNo);
832  break;
833  }
834 
835  if( css::style::NumberingType::CHARS_UPPER_LETTER == eType )
836  aTmpStr = aTmpStr.toAsciiUpperCase();
837  }
838  return aTmpStr;
839 }
840 
842  : aDateTime ( DateTime::EMPTY )
843 {
844  nPageNo = nTotalPages = 0;
846 }
847 
849  : ScEditEngineDefaulter( pEnginePoolP,true/*bDeleteEnginePoolP*/ )
850 {
851 }
852 
854  sal_Int32 /* nPara */, sal_Int32 /* nPos */,
855  std::optional<Color>& /* rTxtColor */, std::optional<Color>& /* rFldColor */ )
856 {
857  const SvxFieldData* pFieldData = rField.GetField();
858  if (!pFieldData)
859  return "?";
860 
861  OUString aRet;
862  sal_Int32 nClsId = pFieldData->GetClassId();
863  switch (nClsId)
864  {
865  case text::textfield::Type::PAGE:
867  break;
868  case text::textfield::Type::PAGES:
870  break;
871  case text::textfield::Type::EXTENDED_TIME:
872  case text::textfield::Type::TIME:
873  // For now, time field in the header / footer is always dynamic.
875  break;
876  case text::textfield::Type::DOCINFO_TITLE:
877  aRet = aData.aTitle;
878  break;
879  case text::textfield::Type::EXTENDED_FILE:
880  {
881  switch (static_cast<const SvxExtFileField*>(pFieldData)->GetFormat())
882  {
883  case SvxFileFormat::PathFull :
884  aRet = aData.aLongDocName;
885  break;
886  default:
887  aRet = aData.aShortDocName;
888  }
889  }
890  break;
892  aRet = aData.aTabName;
893  break;
896  break;
897  default:
898  aRet = "?";
899  }
900 
901  return aRet;
902 }
903 
904 // field data
905 
907  ScDocument* pDoc, SfxItemPool* pEnginePoolP,
908  SfxItemPool* pTextObjectPool, bool bDeleteEnginePoolP) :
909  ScEditEngineDefaulter( pEnginePoolP, bDeleteEnginePoolP ),
910  mpDoc(pDoc), bExecuteURL(true)
911 {
912  if ( pTextObjectPool )
913  SetEditTextObjectPool( pTextObjectPool );
914  SetControlWord( EEControlBits(GetControlWord() | EEControlBits::MARKFIELDS) & ~EEControlBits::RTFSTYLESHEETS );
915 }
916 
918  sal_Int32 /* nPara */, sal_Int32 /* nPos */,
919  std::optional<Color>& rTxtColor, std::optional<Color>& /* rFldColor */ )
920 {
921  const SvxFieldData* pFieldData = rField.GetField();
922 
923  if (!pFieldData)
924  return " ";
925 
926  return ScEditUtil::GetCellFieldValue(*pFieldData, mpDoc, &rTxtColor);
927 }
928 
930 {
931  if (!bExecuteURL)
932  return;
933  if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(rField.GetField()))
934  {
935  ScGlobal::OpenURL(pURLField->GetURL(), pURLField->GetTargetFrame());
936  }
937 }
938 
940  SfxItemPool* pTextObjectPool ) :
941  ScEditEngineDefaulter( pEnginePoolP, false/*bDeleteEnginePoolP*/ )
942 {
943  if ( pTextObjectPool )
944  SetEditTextObjectPool( pTextObjectPool );
945  SetControlWord( EEControlBits(GetControlWord() | EEControlBits::MARKFIELDS) & ~EEControlBits::RTFSTYLESHEETS );
946 }
947 
948 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Long const nBottomMargin
tools::Rectangle GetEditArea(const ScPatternAttr *pPattern, bool bForceToTop)
Definition: editutil.cxx:314
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
static OUString CreateRomanString(sal_uLong nNo, bool bUpper)
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:213
OUString GetTitle(sal_uInt16 nMaxLen=0) const
const SfxItemSet & GetEmptyItemSet() const
void SetUpdateMode(bool bUpdate, bool bRestoring=false)
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:917
long Long
static void OpenURL(const OUString &rURL, const OUString &rTarget, bool bIgnoreSettings=false)
Open the specified URL.
Definition: global.cxx:759
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:906
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:136
void SetMapMode()
bool HasOnlineSpellErrors() const
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:4211
SvxNumType
ScHeaderFieldData aData
Definition: editutil.hxx:223
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6106
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:853
sal_uInt16 sal_Unicode
virtual ~ScEnginePoolHelper()
Definition: editutil.cxx:509
SvxCellVerJustify
ScNoteEditEngine(SfxItemPool *pEnginePool, SfxItemPool *pTextObjectPool)
Definition: editutil.cxx:939
void SetText(const OUString &rStr)
void SetControlWord(EEControlBits nWord)
SVX_NUM_ARABIC
Mutex aMutex
void Init(const ScPatternAttr &rPattern)
Definition: editutil.cxx:768
ScEditAttrTester(ScEditEngineDefaulter *pEng)
Definition: editutil.cxx:431
OUString aShortDocName
Definition: editutil.hxx:209
static OUString lcl_GetDelimitedString(const EditEngine &rEngine, const char c)
Definition: editutil.cxx:71
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:4785
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
OUString GetText(sal_Int32 nPara) const
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:440
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
bool RemoveCharAttribs(sal_uInt16 nWhich)
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:214
static const OUString & GetNativeSymbol(OpCode eOp)
tools::Long nTotalPages
Definition: editutil.hxx:213
bool HasField(sal_Int32 nType=css::text::textfield::Type::UNSPECIFIED) const
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
Definition: editutil.cxx:598
static ScFieldEditEngine & GetStaticFieldEditEngine()
A static instance of ScFieldEditEngine not capable of resolving document specific fields...
Definition: global.cxx:1054
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:577
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:4248
#define SC_MOD()
Definition: scmod.hxx:249
void RepeatDefaults()
Re-apply existing defaults if set, same as in SetText, but without EnableUndo/SetUpdateMode.
Definition: editutil.cxx:670
bool bInPrintTwips
Definition: editutil.hxx:48
sal_uInt16 Count() const
OUString aTabName
Definition: editutil.hxx:210
std::unique_ptr< EditTextObject > CreateTextObject()
ScHeaderEditEngine(SfxItemPool *pEnginePool)
Definition: editutil.cxx:848
constexpr sal_uInt16 EE_CHAR_START(EE_PARA_END+1)
OUString GetFormatted(SvNumberFormatter &rFormatter, LanguageType eLanguage) const
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:802
static SC_DLLPUBLIC LanguageType eLnge
Definition: global.hxx:547
void SetDefaultLanguage(LanguageType eLang)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
sal_Int16 GetBottomMargin() const
static LanguageType GetEditDefaultLanguage()
Definition: global.cxx:858
sal_Int32 GetParagraphCount() const
static OUString GetCellFieldValue(const SvxFieldData &rFieldData, const ScDocument *pDoc, std::optional< Color > *ppTextColor)
Definition: editutil.cxx:194
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:53
const OUString & GetURL() const
virtual sal_Int32 GetClassId() const
bool QueryUrl(const INetURLObject &rUrl)
sal_Int32 GetParagraphCount() const
static SC_DLLPUBLIC const LocaleDataWrapper * getLocaleDataPtr()
Definition: global.cxx:1000
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
static void Free(SfxItemPool *pPool)
tools::Long GetIndent(const ScPatternAttr *pPattern) const
Definition: editutil.cxx:281
void GetMargins(const ScPatternAttr *pPattern, tools::Long &nLeftMargin, tools::Long &nTopMargin, tools::Long &nRightMargin, tools::Long &BottomMargin) const
Definition: editutil.cxx:298
tools::Long const nTopMargin
SfxItemState
SfxItemPool * pEnginePool
Definition: editutil.hxx:111
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
bool GetUpdateMode() const
virtual void FieldClicked(const SvxFieldItem &rField) override
Definition: editutil.cxx:929
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:62
sal_Int16 GetLeftMargin() const
const SfxItemSet & GetDefaults()
Returns the stored defaults, used to find non-default character attributes.
Definition: editutil.cxx:588
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
ScEnginePoolHelper(SfxItemPool *pEnginePool, bool bDeleteEnginePool)
Definition: editutil.cxx:490
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:4303
Reference< XComponentContext > getProcessComponentContext()
#define EE_TEXTPOS_MAX_COUNT
ScTabEditEngine(ScDocument *pDoc)
Definition: editutil.cxx:752
static OUString lcl_GetCharStr(sal_Int32 nNo)
Definition: editutil.cxx:782
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:97
static void RemoveCharAttribs(EditTextObject &rEditText, const ScPatternAttr &rAttr)
Definition: editutil.cxx:147
SC_DLLPUBLIC SfxItemPool * GetEditPool() const
Definition: documen2.cxx:446
int GetTab() const
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Definition: document.cxx:985
tools::Long nPageNo
Definition: editutil.hxx:212
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
Definition: editutil.cxx:111
const sal_uInt16 * GetRanges() const
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet)
ScDocument * mpDoc
Definition: editutil.hxx:179
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1056
static std::unique_ptr< EditTextObject > Clone(const EditTextObject &rSrc, ScDocument &rDestDoc)
Definition: editutil.cxx:168
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:4170
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:610
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:680
static OUString GetMultilineString(const EditEngine &rEngine)
Retrieves string with paragraphs delimited by new lines (' ').
Definition: editutil.cxx:101
aStr
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:212
void SetEditTextObjectPool(SfxItemPool *pPool)
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
Definition: documen2.cxx:456
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:774
SvxURLFormat GetFormat() const
sal_Int16 GetTopMargin() const