LibreOffice Module sc (master)  1
spelleng.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 <spelleng.hxx>
21 #include <com/sun/star/i18n/TextConversionOption.hpp>
22 
23 #include <scitems.hxx>
24 
25 #include <editeng/langitem.hxx>
26 #include <editeng/editobj.hxx>
27 #include <editeng/editview.hxx>
28 #include <editeng/eeitem.hxx>
29 #include <sfx2/viewfrm.hxx>
30 #include <vcl/settings.hxx>
31 #include <vcl/svapp.hxx>
32 #include <vcl/weld.hxx>
33 #include <osl/diagnose.h>
34 
35 #include <spelldialog.hxx>
36 #include <tabvwsh.hxx>
37 #include <docsh.hxx>
38 #include <cellvalue.hxx>
39 #include <cellform.hxx>
40 #include <patattr.hxx>
41 #include <globstr.hrc>
42 #include <scresid.hxx>
43 #include <markdata.hxx>
44 #include <docpool.hxx>
45 
46 #include <memory>
47 
48 using namespace ::com::sun::star;
49 
51  SfxItemPool* pEnginePoolP, ScViewData& rViewData,
52  ScDocument* pUndoDoc, ScDocument* pRedoDoc ) :
53  ScEditEngineDefaulter( pEnginePoolP ),
54  mrViewData( rViewData ),
55  mrDocShell( *rViewData.GetDocShell() ),
56  mrDoc( rViewData.GetDocShell()->GetDocument() ),
57  maSelState( rViewData ),
58  mpUndoDoc( pUndoDoc ),
59  mpRedoDoc( pRedoDoc ),
60  meCurrLang( LANGUAGE_ENGLISH_US ),
61  mbIsAnyModified( false ),
62  mbInitialState( true ),
63  mbWrappedInTable( false ),
64  mbFinished( false )
65 {
67  // start with cell A1 in cell/range/multi-selection, will seek to first selected
69  {
70  mnStartCol = 0;
71  mnStartRow = 0;
72  }
75 }
76 
78 {
79 }
80 
82 {
84  ScTabViewShell* pViewShell = mrViewData.GetViewShell();
85  const ScPatternAttr* pPattern = nullptr;
86  const ScPatternAttr* pLastPattern = nullptr;
87 
88  SfxItemSet aEditDefaults(GetEmptyItemSet());
89 
90  if( IsModified() )
91  {
92  mbIsAnyModified = true;
93 
94  OUString aNewStr = GetText();
95 
96  // Check if the user has changed the language. If the new language is
97  // applied to the entire string length, we will set the language as cell
98  // attribute. Otherwise we will commit this as an edit-engine string.
99  editeng::LanguageSpan aLang = GetLanguage(0, 0);
100 
101  bool bSimpleString = GetParagraphCount() == 1 &&
102  aLang.nLang != LANGUAGE_DONTKNOW &&
103  aLang.nStart == 0 &&
104  aLang.nEnd == aNewStr.getLength();
105 
106  bool bMultiTab = (rMark.GetSelectCount() > 1);
107 
108  OUString aVisibleStr;
109  if( bMultiTab )
110  aVisibleStr = mrDoc.GetString(mnCurrCol, mnCurrRow, mnStartTab);
111 
112  for( SCTAB nTab = 0, nTabCount = mrDoc.GetTableCount(); nTab < nTabCount; ++nTab )
113  {
114  // always change the cell on the visible tab,
115  // on the other selected tabs only if they contain the same text
116 
117  if ((nTab == mnStartTab) ||
118  (bMultiTab && rMark.GetTableSelect(nTab) && mrDoc.GetString(mnCurrCol, mnCurrRow, nTab) == aVisibleStr))
119  {
120  ScAddress aPos( mnCurrCol, mnCurrRow, nTab );
121  CellType eCellType = mrDoc.GetCellType( aPos );
122  bool bEmptyCell = eCellType == CELLTYPE_NONE;
123 
124  if (mpUndoDoc && !bEmptyCell)
125  mrDoc.CopyCellToDocument(aPos, aPos, *mpUndoDoc);
126 
127  if (!bSimpleString || eCellType == CELLTYPE_EDIT)
128  {
129  std::unique_ptr<EditTextObject> pEditObj(CreateTextObject());
130  mrDoc.SetEditText(aPos, *pEditObj, GetEditTextObjectPool());
131  }
132  else
133  {
134  // Set the new string and update the language with the cell.
135  mrDoc.SetString(aPos, aNewStr);
136 
137  const ScPatternAttr* pAttr = mrDoc.GetPattern(aPos);
138  std::unique_ptr<ScPatternAttr> pNewAttr;
139 
140  if (pAttr)
141  pNewAttr = std::make_unique<ScPatternAttr>(*pAttr);
142  else
143  pNewAttr = std::make_unique<ScPatternAttr>(mrDoc.GetPool());
144 
146  mrDoc.SetPattern(aPos, std::move(pNewAttr));
147  }
148 
149  if (mpRedoDoc && !bEmptyCell)
150  mrDoc.CopyCellToDocument(aPos, aPos, *mpRedoDoc);
151 
153  }
154  }
155  }
156 
157  SCCOL nNewCol = mnCurrCol;
158  SCROW nNewRow = mnCurrRow;
159 
160  if( mbInitialState )
161  {
162  /* On very first call, decrement row to let GetNextSpellingCell() find
163  the first cell of current range. */
164  mbInitialState = false;
165  --nNewRow;
166  }
167 
168  bool bSheetSel = maSelState.GetSelectionType() == SC_SELECTTYPE_SHEET;
169  bool bLoop = true;
170  bool bFound = false;
171  while( bLoop && !bFound )
172  {
173  bLoop = mrDoc.GetNextSpellingCell( nNewCol, nNewRow, mnStartTab, bSheetSel, rMark );
174  if( bLoop )
175  {
177 
178  if( mbWrappedInTable && ((nNewCol > mnStartCol) || ((nNewCol == mnStartCol) && (nNewRow >= mnStartRow))) )
179  {
181  bLoop = false;
182  mbFinished = true;
183  }
184  else if( nNewCol >= mrDoc.GetAllocatedColumnsCount(mnStartTab) )
185  {
186  // no more cells in the sheet - try to restart at top of sheet
187 
188  if( bSheetSel || ((mnStartCol == 0) && (mnStartRow == 0)) )
189  {
190  // conversion started at cell A1 or in selection, do not query to restart at top
192  bLoop = false;
193  mbFinished = true;
194  }
195  else if( ShowTableWrapDialog() )
196  {
197  // conversion started anywhere but in cell A1, user wants to restart
198  nNewRow = mrDoc.MaxRow() + 2;
199  mbWrappedInTable = true;
200  }
201  else
202  {
203  bLoop = false;
204  mbFinished = true;
205  }
206  }
207  else
208  {
209  // GetPattern may implicitly allocates the column if not exists,
210  pPattern = mrDoc.GetPattern( nNewCol, nNewRow, mnStartTab );
211  if( pPattern && (pPattern != pLastPattern) )
212  {
213  pPattern->FillEditItemSet( &aEditDefaults );
214  SetDefaults( aEditDefaults );
215  pLastPattern = pPattern;
216  }
217 
218  // language changed?
219  const SfxPoolItem* pItem = mrDoc.GetAttr( nNewCol, nNewRow, mnStartTab, ATTR_FONT_LANGUAGE );
220  if( const SvxLanguageItem* pLangItem = dynamic_cast<const SvxLanguageItem*>( pItem ) )
221  {
222  LanguageType eLang = pLangItem->GetValue();
223  if( eLang == LANGUAGE_SYSTEM )
224  eLang = Application::GetSettings().GetLanguageTag().getLanguageType(); // never use SYSTEM for spelling
225  if( eLang != meCurrLang )
226  {
227  meCurrLang = eLang;
228  SetDefaultLanguage( eLang );
229  }
230  }
231 
232  FillFromCell( nNewCol, nNewRow, mnStartTab );
233 
234  bFound = bLoop && NeedsConversion();
235  }
236  }
237  }
238 
239  if( bFound )
240  {
241  pViewShell->AlignToCursor( nNewCol, nNewRow, SC_FOLLOW_JUMP );
242  pViewShell->SetCursor( nNewCol, nNewRow, true );
243  mrViewData.GetView()->MakeEditView( this, nNewCol, nNewRow );
244  EditView* pEditView = mrViewData.GetSpellingView();
245  // maSelState.GetEditSelection() returns (0,0) if not in edit mode -> ok
246  pEditView->SetSelection( maSelState.GetEditSelection() );
247 
248  ClearModifyFlag();
249  mnCurrCol = nNewCol;
250  mnCurrRow = nNewRow;
251  }
252 
253  return bFound;
254 }
255 
257 {
258  const ScAddress& rPos = maSelState.GetCellCursor();
259  mrViewData.GetViewShell()->SetCursor( rPos.Col(), rPos.Row() );
260 }
261 
263 {
264  // default: no dialog, always restart at top
265  return true;
266 }
267 
269 {
270  // default: no dialog
271 }
272 
273 // private --------------------------------------------------------------------
274 
276 {
277  ScAddress aPos(nCol, nRow, nTab);
278 
279  ScRefCellValue aCell(mrDoc, aPos);
280  switch (aCell.meType)
281  {
282  case CELLTYPE_STRING:
283  {
284  SvNumberFormatter* pFormatter = mrDoc.GetFormatTable();
285  sal_uInt32 nNumFmt = mrDoc.GetNumberFormat(aPos);
286  const Color* pColor;
287  OUString aText = ScCellFormat::GetString(aCell, nNumFmt, &pColor, *pFormatter, mrDoc);
288 
289  SetTextCurrentDefaults(aText);
290  }
291  break;
292  case CELLTYPE_EDIT:
293  {
294  const EditTextObject* pNewEditObj = aCell.mpEditText;
295  SetTextCurrentDefaults(*pNewEditObj);
296  }
297  break;
298  default:
299  SetTextCurrentDefaults(OUString());
300  }
301 }
302 
304  SfxItemPool* pEnginePoolP, ScViewData& rViewData,
305  ScDocument* pUndoDoc, ScDocument* pRedoDoc,
306  css::uno::Reference< css::linguistic2::XSpellChecker1 > const & xSpeller ) :
307  ScConversionEngineBase( pEnginePoolP, rViewData, pUndoDoc, pRedoDoc )
308 {
309  SetSpeller( xSpeller );
310 }
311 
312 void ScSpellingEngine::ConvertAll(weld::Widget* pDialogParent, EditView& rEditView)
313 {
314  EESpellState eState = EESpellState::Ok;
315  if( FindNextConversionCell() )
316  eState = rEditView.StartSpeller(pDialogParent, true);
317 
318  OSL_ENSURE( eState != EESpellState::NoSpeller, "ScSpellingEngine::Convert - no spell checker" );
319 }
320 
322 {
323  return FindNextConversionCell();
324 }
325 
327 {
328  return HasSpellErrors() != EESpellState::Ok;
329 }
330 
332 {
333  weld::Widget* pParent = GetDialogParent();
334  weld::WaitObject aWaitOff(pParent);
335 
336  std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent,
337  VclMessageType::Question, VclButtonsType::YesNo,
338  ScResId(STR_SPELLING_BEGIN_TAB))); // "delete data?"
339  xBox->set_title(ScResId(STR_MSSG_DOSUBTOTALS_0));
340  xBox->set_default_response(RET_YES);
341  return xBox->run() == RET_YES;
342 }
343 
345 {
346  weld::Widget* pParent = GetDialogParent();
347  weld::WaitObject aWaitOff(pParent);
348  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pParent,
349  VclMessageType::Info, VclButtonsType::Ok,
350  ScResId(STR_SPELLING_STOP_OK)));
351  xInfoBox->run();
352 }
353 
355 {
356  sal_uInt16 nWinId = ScSpellDialogChildWindow::GetChildWindowId();
358  if( pViewFrm->HasChildWindow( nWinId ) )
359  {
360  if( SfxChildWindow* pChild = pViewFrm->GetChildWindow( nWinId ) )
361  {
362  auto xController = pChild->GetController();
363  if (xController)
364  {
365  if (weld::Window *pRet = xController->getDialog())
366  {
367  if (pRet->get_visible())
368  return pRet;
369  }
370  }
371  }
372  }
373 
374  // fall back to standard dialog parent
376 }
377 
379  meConvType( eConvType ),
380  meSourceLang( LANGUAGE_NONE ),
381  meTargetLang( LANGUAGE_NONE ),
382  mnOptions( 0 ),
383  mbUseTargetFont( false ),
384  mbIsInteractive( false )
385 {
386 }
387 
389  LanguageType eLang, sal_Int32 nOptions, bool bIsInteractive ) :
390  meConvType( eConvType ),
391  meSourceLang( eLang ),
392  meTargetLang( eLang ),
393  mnOptions( nOptions ),
394  mbUseTargetFont( false ),
395  mbIsInteractive( bIsInteractive )
396 {
397  if (LANGUAGE_KOREAN == eLang)
398  mnOptions = i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
399 }
400 
402  LanguageType eSourceLang, LanguageType eTargetLang, const vcl::Font& rTargetFont,
403  sal_Int32 nOptions, bool bIsInteractive ) :
404  meConvType( eConvType ),
405  meSourceLang( eSourceLang ),
406  meTargetLang( eTargetLang ),
407  maTargetFont( rTargetFont ),
408  mnOptions( nOptions ),
409  mbUseTargetFont( true ),
410  mbIsInteractive( bIsInteractive )
411 {
413  mnOptions = i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
414 }
415 
417  SfxItemPool* pEnginePoolP, ScViewData& rViewData,
418  const ScConversionParam& rConvParam,
419  ScDocument* pUndoDoc, ScDocument* pRedoDoc ) :
420  ScConversionEngineBase( pEnginePoolP, rViewData, pUndoDoc, pRedoDoc ),
421  maConvParam( rConvParam )
422 {
423 }
424 
426 {
427  if( FindNextConversionCell() )
428  {
429  rEditView.StartTextConversion(pDialogParent,
432  // #i34769# restore initial cursor position
434  }
435 }
436 
438 {
439  return FindNextConversionCell();
440 }
441 
443 {
445 }
446 
447 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void RestoreCursorPos()
Restores the initial cursor position.
Definition: spelleng.cxx:256
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3135
SfxViewFrame * GetViewFrame() const
ScSelectionState maSelState
Definition: spelleng.hxx:79
#define LANGUAGE_NONE
OUString GetText(LineEnd eEnd=LINEEND_LF) const
void GetVars(SCCOL &nColP, SCROW &nRowP, SCTAB &nTabP) const
Definition: address.hxx:324
void SetDefaults(const SfxItemSet &rDefaults, bool bRememberCopy=true)
Creates a copy of SfxItemSet if bRememberCopy set.
Definition: editutil.cxx:561
bool HasConvertibleTextPortion(LanguageType nLang)
LanguageType meSourceLang
Type of the conversion.
Definition: spellparam.hxx:63
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:42
EESpellState StartSpeller(weld::Widget *pDialogParent, bool bMultipleDoc=false)
SfxChildWindow * GetChildWindow(sal_uInt16)
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
bool mbIsAnyModified
Current row index.
Definition: spelleng.hxx:88
LanguageType GetTargetLang() const
Definition: spellparam.hxx:56
SCROW Row() const
Definition: address.hxx:274
#define LANGUAGE_ENGLISH_US
ScViewData & mrViewData
Definition: spelleng.hxx:74
void CopyCellToDocument(const ScAddress &rSrcPos, const ScAddress &rDestPos, ScDocument &rDestDoc)
Copy only cell, nothing but cell to another document.
Definition: document.cxx:2252
const SfxItemSet & GetEmptyItemSet() const
static weld::Window * GetActiveDialogParent()
Definition: docsh.cxx:3076
SCCOL mnStartCol
Current cell language.
Definition: spelleng.hxx:83
LanguageType getLanguageType(bool bResolveSystem=true) const
void PostPaintCell(SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: docsh3.cxx:188
ScConversionEngineBase(SfxItemPool *pEnginePool, ScViewData &rViewData, ScDocument *pUndoDoc, ScDocument *pRedoDoc)
Definition: spelleng.cxx:50
constexpr TypedWhichId< SvxLanguageItem > ATTR_FONT_LANGUAGE(110)
static const AllSettings & GetSettings()
virtual void ShowFinishDialog()
Derived classes may show a message box stating that the conversion is finished.
Definition: spelleng.cxx:268
#define LANGUAGE_KOREAN
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:103
SCTAB mnStartTab
Initial row index.
Definition: spelleng.hxx:85
virtual void ConvertAll(weld::Widget *pDialogParent, EditView &rEditView) override
Checks spelling of all cells in the selection or sheet.
Definition: spelleng.cxx:312
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
Definition: tabview3.cxx:363
const ESelection & GetEditSelection() const
Returns the edit engine selection.
SCROW mnCurrRow
Current column index.
Definition: spelleng.hxx:87
No selection, simple cell cursor.
bool mbWrappedInTable
true = Not searched for a cell yet.
Definition: spelleng.hxx:90
ScDocument * mpRedoDoc
Document stores all old cells for UNDO action.
Definition: spelleng.hxx:81
ScSelectionType GetSelectionType() const
Returns the type of the selection this object contains.
bool GetNextSpellingCell(SCCOL &nCol, SCROW &nRow, SCTAB nTab, bool bInSel, const ScMarkData &rMark) const
Definition: documen4.cxx:538
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6156
Base class for special type of edit engines, i.e.
Definition: spelleng.hxx:33
Reference< XController > xController
RET_YES
const EditTextObject * mpEditText
Definition: cellvalue.hxx:109
void StartTextConversion(weld::Widget *pDialogParent, LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont, sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc)
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:891
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:315
SCTAB GetSelectCount() const
Definition: markdata.cxx:180
ScDocument * mpUndoDoc
Selection data of the document.
Definition: spelleng.hxx:80
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
Definition: document.cxx:3536
sal_Int32 mnOptions
Target font to be used if language has to be changed.
Definition: spellparam.hxx:66
ScTextConversionEngine(SfxItemPool *pEnginePool, ScViewData &rViewData, const ScConversionParam &rConvParam, ScDocument *pUndoDoc, ScDocument *pRedoDoc)
Definition: spelleng.cxx:416
ScConversionParam(ScConversionType eConvType)
Constructs an empty parameter struct with the passed conversion type.
Definition: spelleng.cxx:378
static OUString GetString(const ScRefCellValue &rCell, sal_uInt32 nFormat, const Color **ppColor, SvNumberFormatter &rFormatter, const ScDocument &rDoc, bool bNullVals=true, bool bFormula=false, bool bUseStarFormat=false)
Definition: cellform.cxx:31
void FillFromCell(SCCOL nCol, SCROW nRow, SCTAB nTab)
Fills the edit engine from a document cell.
Definition: spelleng.cxx:275
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:4799
EditView * GetSpellingView() const
Definition: viewdata.hxx:651
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4764
virtual void ConvertAll(weld::Widget *pDialogParent, EditView &rEditView) override
Converts all cells in the selection or sheet according to set language.
Definition: spelleng.cxx:425
virtual bool SpellNextDocument() override
Callback from edit engine to check the next cell.
Definition: spelleng.cxx:321
SC_DLLPUBLIC SCCOL GetAllocatedColumnsCount(SCTAB nTab) const
Definition: documen3.cxx:2150
const LanguageTag & GetLanguageTag() const
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:357
SC_DLLPUBLIC bool SetEditText(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
This method manages the lifecycle of the passed edit text object.
Definition: document.cxx:3444
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
Definition: document.cxx:3413
ScDocument & mrDoc
Definition: spelleng.hxx:76
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:459
SC_DLLPUBLIC void SetPattern(const ScAddress &, const ScPatternAttr &rAttr)
Definition: document.cxx:5111
LanguageType meTargetLang
Source language for conversion.
Definition: spellparam.hxx:64
LanguageType GetSourceLang() const
Definition: spellparam.hxx:55
SC_DLLPUBLIC CellType GetCellType(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3781
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
Definition: editutil.cxx:616
EESpellState HasSpellErrors()
#define LANGUAGE_SYSTEM
virtual bool NeedsConversion()=0
Derived classes return, if the current text needs conversion (i.e.
sal_Int16 SCCOL
Definition: types.hxx:21
ScSpellingEngine(SfxItemPool *pEnginePool, ScViewData &rViewData, ScDocument *pUndoDoc, ScDocument *pRedoDoc, css::uno::Reference< css::linguistic2::XSpellChecker1 > const &xSpeller)
Definition: spelleng.cxx:303
Parameters for conversion.
Definition: spellparam.hxx:32
virtual bool NeedsConversion() override
Returns true, if the current text contains text to convert.
Definition: spelleng.cxx:442
std::unique_ptr< EditTextObject > CreateTextObject()
SfxItemSet & GetItemSet()
Definition: patattr.hxx:155
#define LANGUAGE_DONTKNOW
const vcl::Font * GetTargetFont() const
Definition: spellparam.hxx:57
void MakeEditView(ScEditEngineDefaulter *pEngine, SCCOL nCol, SCROW nRow)
Definition: tabview3.cxx:2093
bool mbFinished
true = Already restarted at top of the sheet.
Definition: spelleng.hxx:91
void SetDefaultLanguage(LanguageType eLang)
weld::Widget * GetDialogParent()
Returns the spelling dialog if it is open.
Definition: spelleng.cxx:354
SCCOL Col() const
Definition: address.hxx:279
sal_Int32 GetParagraphCount() const
const ScAddress & GetCellCursor() const
Returns the position of the cell cursor.
ScDBFunc * GetView() const
Definition: viewdata.cxx:863
bool FindNextConversionCell()
Implementation of cell iteration.
Definition: spelleng.cxx:81
CellType meType
Definition: cellvalue.hxx:105
ScDocShell & mrDocShell
Definition: spelleng.hxx:75
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_Int32 SCROW
Definition: types.hxx:17
bool HasChildWindow(sal_uInt16)
ScConversionParam maConvParam
Definition: spelleng.hxx:148
sal_Int32 GetOptions() const
Definition: spellparam.hxx:58
EESpellState
ScConversionType
Specifiers for sheet conversion (functions iterating over the sheet and modifying cells)...
Definition: spellparam.hxx:24
CellType
Definition: global.hxx:269
void ClearModifyFlag()
virtual bool ShowTableWrapDialog() override
Show a query box that asks whether to restart at top of the sheet.
Definition: spelleng.cxx:331
bool IsInteractive() const
Definition: spellparam.hxx:59
virtual ~ScConversionEngineBase() override
Definition: spelleng.cxx:77
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
bool IsModified() const
void AlignToCursor(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, const ScSplitPos *pWhich=nullptr)
Definition: tabview3.cxx:920
void SetSpeller(css::uno::Reference< css::linguistic2::XSpellChecker1 > const &xSpeller)
virtual bool ShowTableWrapDialog()
Derived classes may show a query box that asks whether to restart at top of the sheet.
Definition: spelleng.cxx:262
void SetSelection(const ESelection &rNewSel)
SCROW mnStartRow
Initial column index.
Definition: spelleng.hxx:84
virtual bool NeedsConversion() override
Returns true, if the current text contains a spelling error.
Definition: spelleng.cxx:326
SCCOL mnCurrCol
Initial sheet index.
Definition: spelleng.hxx:86
bool GetTableSelect(SCTAB nTab) const
Definition: markdata.cxx:169
virtual void ShowFinishDialog() override
Show a message box stating that spell checking is finished.
Definition: spelleng.cxx:344
editeng::LanguageSpan GetLanguage(const EditPaM &rPaM) const
virtual bool ConvertNextDocument() override
Callback from edit engine to convert the next cell.
Definition: spelleng.cxx:437
LanguageType meCurrLang
Document stores all new cells for REDO action.
Definition: spelleng.hxx:82
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
sal_Int16 SCTAB
Definition: types.hxx:22
SC_DLLPUBLIC sal_uInt32 GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3677
bool m_bDetectedRangeSegmentation false
SfxItemPool * GetEditTextObjectPool() 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:827
bool mbInitialState
true = At least one cell has been changed.
Definition: spelleng.hxx:89