diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-30 23:40:52 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-09-01 14:48:48 -0400 |
commit | 547f4fec93a023ff244e3bf509baf4b8001effa0 (patch) | |
tree | bb77beb1224c111fe9eef04cd4300a187906323e /sc/source | |
parent | 4bc3a58a648f6c0ce95b4eb41f2cbf46175629ed (diff) |
First step toward showing mis-spelled words without modifying cells.
There are still tons of problems to fix.
Change-Id: Icae6e3d2c9b8b2266724d8d068abbab8acae96da
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/app/scmod.cxx | 28 | ||||
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 18 | ||||
-rw-r--r-- | sc/source/ui/inc/output.hxx | 13 | ||||
-rw-r--r-- | sc/source/ui/inc/tabview.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 140 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 39 | ||||
-rw-r--r-- | sc/source/ui/view/spellcheckcontext.cxx | 70 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/view/tabview4.cxx | 12 |
11 files changed, 306 insertions, 40 deletions
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index cad7a5df842a..74bb24a4e0ff 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1941,19 +1941,17 @@ IMPL_LINK_NOARG(ScModule, IdleHandler) return 0; } - sal_Bool bMore = false; - ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() ); + bool bMore = false; + ScDocShell* pDocSh = dynamic_cast<ScDocShell*>(SfxObjectShell::Current()); + if ( pDocSh ) { ScDocument* pDoc = pDocSh->GetDocument(); sal_Bool bLinks = pDoc->IdleCheckLinks(); sal_Bool bWidth = pDoc->IdleCalcTextWidth(); - sal_Bool bSpell = pDoc->ContinueOnlineSpelling(); - if ( bSpell ) - aSpellTimer.Start(); // da ist noch was - bMore = bLinks || bWidth || bSpell; // ueberhaupt noch was? + bMore = bLinks || bWidth; // ueberhaupt noch was? // While calculating a Basic formula, a paint event may have occurred, // so check the bNeedsRepaint flags for this document's views @@ -1961,6 +1959,17 @@ IMPL_LINK_NOARG(ScModule, IdleHandler) lcl_CheckNeedsRepaint( pDocSh ); } + ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current()); + if (pViewSh) + { + bool bSpell = pViewSh->ContinueOnlineSpelling(); + if (bSpell) + { + aSpellTimer.Start(); + bMore = true; + } + } + sal_uLong nOldTime = aIdleTimer.GetTimeout(); sal_uLong nNewTime = nOldTime; if ( bMore ) @@ -1996,11 +2005,10 @@ IMPL_LINK_NOARG(ScModule, SpellTimerHdl) return 0; // dann spaeter wieder... } - ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() ); - if ( pDocSh ) + ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current()); + if (pViewSh) { - ScDocument* pDoc = pDocSh->GetDocument(); - if ( pDoc->ContinueOnlineSpelling() ) + if (pViewSh->ContinueOnlineSpelling()) aSpellTimer.Start(); } return 0; diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 1befc351361c..ba55617a4981 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -32,6 +32,16 @@ #include <vector> #include <memory> #include <boost/scoped_ptr.hpp> +#include <boost/unordered_map.hpp> +#include <boost/ptr_container/ptr_map.hpp> + +namespace editeng { + struct MisspellRanges; +} + +namespace sc { + struct SpellCheckContext; +} struct ScTableInfo; class ScDPObject; @@ -81,8 +91,6 @@ class ScGridWindow : public Window, public DropTargetHelper, public DragSourceHe // ScFilterListBox is always used for selection list friend class ScFilterListBox; -private: - enum RfCorner { NONE, @@ -121,9 +129,11 @@ private: bool isInside(SCCOL nCol, SCROW nRow) const; bool set(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); }; + VisibleRange maVisibleRange; -private: + boost::scoped_ptr<sc::SpellCheckContext> mpSpellCheckCxt; + ScViewData* pViewData; ScSplitPos eWhich; ScHSplitPos eHWhich; @@ -169,7 +179,6 @@ private: sal_uInt16 nCurrentPointer; - ScDDComboBoxButton aComboButton; Point aCurMousePos; @@ -382,6 +391,7 @@ public: // #114409# void CursorChanged(); void DrawLayerCreated(); + bool ContinueOnlineSpelling(); void DeleteCopySourceOverlay(); void UpdateCopySourceOverlay(); diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index 4565354ac1c7..ec894bdbdd42 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -27,6 +27,14 @@ #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <drawinglayer/processor2d/baseprocessor2d.hxx> +namespace sc { + struct SpellCheckContext; +} + +namespace editeng { + struct MisspellRanges; +} + class Rectangle; class Font; class OutputDevice; @@ -40,8 +48,6 @@ class ScTabViewShell; class ScPageBreakData; class FmFormView; class ScFieldEditEngine; - -// #i74769# SdrPaintWindow predefine class SdrPaintWindow; // --------------------------------------------------------------------------- @@ -100,6 +106,7 @@ private: const SfxItemSet* mpOldCondSet; const SfxItemSet* mpOldPreviewFontSet; const RowInfo* mpThisRowInfo; + const std::vector<editeng::MisspellRanges>* mpMisspellRanges; explicit DrawEditParam(const ScPatternAttr* pPattern, const SfxItemSet* pCondSet, bool bCellIsValue); @@ -203,6 +210,7 @@ private: // #i74769# use SdrPaintWindow direct, remember it during BeginDrawLayers/EndDrawLayers SdrPaintWindow* mpTargetPaintWindow; + const sc::SpellCheckContext* mpSpellCheckCxt; // private methods @@ -260,6 +268,7 @@ public: ~ScOutputData(); + void SetSpellCheckContext( const sc::SpellCheckContext* pCxt ); void SetContentDevice( OutputDevice* pContentDev ); void SetRefDevice( OutputDevice* pRDev ) { mpRefDevice = pFmtDevice = pRDev; } diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 92a42ae70e18..69d9c54f159d 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -520,6 +520,8 @@ public: void ResetBrushDocument(); void SetInRefMode( bool bRefMode ); + + bool ContinueOnlineSpelling(); }; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index d2fb9ac75614..e91d74f23905 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -27,6 +27,9 @@ #include <editeng/editstat.hxx> #include <editeng/flditem.hxx> #include <editeng/justifyitem.hxx> +#include "editeng/unolingu.hxx" +#include "editeng/langitem.hxx" +#include "editeng/misspellrange.hxx" #include <svx/svdetc.hxx> #include <editeng/editobj.hxx> #include <sfx2/dispatch.hxx> @@ -120,6 +123,9 @@ #include "checklistmenu.hrc" #include "strload.hxx" #include "externalrefmgr.hxx" +#include "dociter.hxx" +#include "hints.hxx" +#include "spellcheckcontext.hxx" #include <svx/sdrpagewindow.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> @@ -439,6 +445,7 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic mpOOHeader( NULL ), mpOOShrink( NULL ), mpAutoFillRect(static_cast<Rectangle*>(NULL)), + mpSpellCheckCxt(new sc::SpellCheckContext), pViewData( pData ), eWhich( eWhichPos ), pNoteMarker( NULL ), @@ -5355,6 +5362,139 @@ void ScGridWindow::DrawLayerCreated() ImpCreateOverlayObjects(); } +namespace { + +struct SpellCheckStatus +{ + bool mbModified; + + SpellCheckStatus() : mbModified(false) {}; + + DECL_LINK (EventHdl, EditStatus*); +}; + +IMPL_LINK(SpellCheckStatus, EventHdl, EditStatus*, pStatus) +{ + sal_uLong nStatus = pStatus->GetStatusWord(); + if (nStatus & EE_STAT_WRONGWORDCHANGED) + mbModified = true; + + return 0; +} + +} + +bool ScGridWindow::ContinueOnlineSpelling() +{ + if (!mpSpellCheckCxt->maPos.isValid()) + return false; + + ScDocument* pDoc = pViewData->GetDocument(); + SCTAB nTab = pViewData->GetTabNo(); + SpellCheckStatus aStatus; + + ScHorizontalCellIterator aIter( + pDoc, nTab, maVisibleRange.mnCol1, mpSpellCheckCxt->maPos.mnRow, maVisibleRange.mnCol2, maVisibleRange.mnRow2); + + SCCOL nCol; + SCROW nRow; + ScRefCellValue* pCell = aIter.GetNext(nCol, nRow); + while (pCell && nRow < mpSpellCheckCxt->maPos.mnRow) + pCell = aIter.GetNext(nCol, nRow); + + while (pCell && nCol < mpSpellCheckCxt->maPos.mnCol) + pCell = aIter.GetNext(nCol, nRow); + + boost::scoped_ptr<ScTabEditEngine> pEngine; + + // Check only up to 256 cells at a time. + size_t nTotalCellCount = 0; + size_t nTextCellCount = 0; + bool bChanged = false; + + while (pCell) + { + ++nTotalCellCount; + + CellType eType = pCell->meType; + if (eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT) + { + ++nTextCellCount; + + if (!pEngine) + { + // ScTabEditEngine is needed + // because MapMode must be set for some old documents + pEngine.reset(new ScTabEditEngine(pDoc)); + pEngine->SetControlWord( + pEngine->GetControlWord() | (EE_CNTRL_ONLINESPELLING | EE_CNTRL_ALLOWBIGOBJS)); + pEngine->SetStatusEventHdl(LINK(&aStatus, SpellCheckStatus, EventHdl)); + // Delimiters hier wie in inputhdl.cxx !!! + pEngine->SetWordDelimiters( + ScEditUtil::ModifyDelimiters(pEngine->GetWordDelimiters())); + + uno::Reference<linguistic2::XSpellChecker1> xXSpellChecker1(LinguMgr::GetSpellChecker()); + pEngine->SetSpeller(xXSpellChecker1); + } + + const ScPatternAttr* pPattern = pDoc->GetPattern(nCol, nRow, nTab); + sal_uInt16 nCellLang = + static_cast<const SvxLanguageItem&>(pPattern->GetItem(ATTR_FONT_LANGUAGE)).GetValue(); + if (nCellLang == LANGUAGE_SYSTEM) + nCellLang = Application::GetSettings().GetLanguageTag().getLanguageType(); // never use SYSTEM for spelling + pEngine->SetDefaultLanguage(nCellLang); + + if (eType == CELLTYPE_STRING) + pEngine->SetText(*pCell->mpString); + else + pEngine->SetText(*pCell->mpEditText); + + aStatus.mbModified = false; + pEngine->CompleteOnlineSpelling(); + if (aStatus.mbModified) + { + std::vector<editeng::MisspellRanges> aRanges; + pEngine->GetAllMisspellRanges(aRanges); + if (!aRanges.empty()) + { + sc::SpellCheckContext::CellPos aPos(nCol, nRow); + mpSpellCheckCxt->maMisspellCells.insert( + sc::SpellCheckContext::CellMapType::value_type(aPos, aRanges)); + } + + // Broadcast for re-paint. + ScPaintHint aHint(ScRange(nCol, nRow, nTab), PAINT_GRID); + aHint.SetPrintFlag(false); + pDoc->GetDocumentShell()->Broadcast(aHint); + bChanged = true; + } + } + + if (nTotalCellCount >= 255 || nTextCellCount >= 1) + break; + + pCell = aIter.GetNext(nCol, nRow); + } + + if (pCell) + // Move to the next cell position for the next iteration. + pCell = aIter.GetNext(nCol, nRow); + + if (pCell) + { + // This will become the first cell position for the next time. + mpSpellCheckCxt->maPos.mnCol = nCol; + mpSpellCheckCxt->maPos.mnRow = nRow; + } + else + { + // No more cells to spell check. + mpSpellCheckCxt->maPos.setInvalid(); + } + + return bChanged; +} + // #114409# void ScGridWindow::CursorChanged() { diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 1d2f133bcae4..7213f6a19a74 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -488,6 +488,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod &aZoomX, &aZoomY ); aOutputData.SetMirrorWidth( nMirrorWidth ); // needed for RTL + aOutputData.SetSpellCheckContext(mpSpellCheckCxt.get()); std::auto_ptr< VirtualDevice > xFmtVirtDev; sal_Bool bLogicText = bTextWysiwyg; // call DrawStrings in logic MapMode? diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 8f13897016bb..1208699965df 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -207,7 +207,8 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType, bSnapPixel( false ), bAnyRotated( false ), bAnyClipped( false ), - mpTargetPaintWindow(0) // #i74769# use SdrPaintWindow direct + mpTargetPaintWindow(NULL), // #i74769# use SdrPaintWindow direct + mpSpellCheckCxt(NULL) { if (pZoomX) aZoomX = *pZoomX; @@ -246,6 +247,11 @@ ScOutputData::~ScOutputData() delete pFormulaColor; } +void ScOutputData::SetSpellCheckContext( const sc::SpellCheckContext* pCxt ) +{ + mpSpellCheckCxt = pCxt; +} + void ScOutputData::SetContentDevice( OutputDevice* pContentDev ) { // use pContentDev instead of pDev where used diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 77b700ca4240..5e361c35d536 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -59,6 +59,7 @@ #include "docsh.hxx" #include "markdata.hxx" #include "stlsheet.hxx" +#include "spellcheckcontext.hxx" #include <com/sun/star/i18n/DirectionProperty.hpp> #include <comphelper/string.hxx> @@ -1443,23 +1444,23 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) nPosX -= pRowInfo[0].pCellInfo[nLoopStartX+1].nWidth * nLayoutSign; for (SCCOL nX=nLoopStartX; nX<=nX2; nX++) { - sal_Bool bMergeEmpty = false; + bool bMergeEmpty = false; CellInfo* pInfo = &pThisRowInfo->pCellInfo[nX+1]; - sal_Bool bEmpty = nX < nX1 || pInfo->bEmptyCellText; + bool bEmpty = nX < nX1 || pInfo->bEmptyCellText; SCCOL nCellX = nX; // position where the cell really starts SCROW nCellY = nY; - sal_Bool bDoCell = false; - sal_Bool bNeedEdit = false; + bool bDoCell = false; + bool bNeedEdit = false; // // Part of a merged cell? // - sal_Bool bOverlapped = ( pInfo->bHOverlapped || pInfo->bVOverlapped ); + bool bOverlapped = (pInfo->bHOverlapped || pInfo->bVOverlapped); if ( bOverlapped ) { - bEmpty = sal_True; + bEmpty = true; SCCOL nOverX; // start of the merged cells SCROW nOverY; @@ -1471,7 +1472,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) bDoCell = sal_True; } else - bMergeEmpty = sal_True; + bMergeEmpty = true; } // @@ -1489,7 +1490,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) !mpDoc->HasAttrib( nTempX,nY,nTab, nX1,nY,nTab, HASATTR_MERGED | HASATTR_OVERLAPPED ) ) { nCellX = nTempX; - bDoCell = sal_True; + bDoCell = true; } } @@ -1519,7 +1520,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) // if (!bEmpty) - bDoCell = sal_True; + bDoCell = true; // // don't output the cell that's being edited @@ -1553,6 +1554,14 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) else if (aCell.meType == CELLTYPE_EDIT) bNeedEdit = true; } + + // Check if this cell is mis-spelled. + if (bDoCell && !bNeedEdit && aCell.meType == CELLTYPE_STRING) + { + if (mpSpellCheckCxt && mpSpellCheckCxt->isMisspelled(nCellX, nCellY)) + bNeedEdit = true; + } + if (bDoCell && !bNeedEdit) { if ( nCellY == nY && nCellX >= nX1 && nCellX <= nX2 ) @@ -2257,7 +2266,8 @@ ScOutputData::DrawEditParam::DrawEditParam(const ScPatternAttr* pPattern, const mpOldPattern(NULL), mpOldCondSet(NULL), mpOldPreviewFontSet(NULL), - mpThisRowInfo(NULL) + mpThisRowInfo(NULL), + mpMisspellRanges(NULL) {} bool ScOutputData::DrawEditParam::readCellContent( @@ -2302,6 +2312,10 @@ bool ScOutputData::DrawEditParam::readCellContent( if ( pColor && !bSyntaxMode && !( bUseStyleColor && bForceAutoColor ) ) lcl_SetEditColor( *mpEngine, *pColor ); } + + if (mpMisspellRanges) + mpEngine->SetAllMisspellRanges(*mpMisspellRanges); + return true; } @@ -4576,7 +4590,7 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic) } else { - bDoCell = sal_True; + bDoCell = true; } if ( bDoCell && bEditMode && nCellX == nEditCol && nCellY == nEditRow ) @@ -4644,6 +4658,9 @@ void ScOutputData::DrawEdit(sal_Bool bPixelToLogic) aParam.mpOldCondSet = pOldCondSet; aParam.mpOldPreviewFontSet = pOldPreviewFontSet; aParam.mpThisRowInfo = pThisRowInfo; + if (mpSpellCheckCxt) + aParam.mpMisspellRanges = mpSpellCheckCxt->getMisspellRanges(nCellX, nCellY); + if (aParam.meHorJust == SVX_HOR_JUSTIFY_REPEAT) { // ignore orientation/rotation if "repeat" is active diff --git a/sc/source/ui/view/spellcheckcontext.cxx b/sc/source/ui/view/spellcheckcontext.cxx new file mode 100644 index 000000000000..c064d2b69b45 --- /dev/null +++ b/sc/source/ui/view/spellcheckcontext.cxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "spellcheckcontext.hxx" + +namespace sc { + +size_t SpellCheckContext::CellPos::Hash::operator() (const CellPos& rPos) const +{ + size_t nVal = rPos.mnCol; + nVal = nVal << 4; + nVal += rPos.mnRow; + return nVal; +} + +SpellCheckContext::CellPos::CellPos() : mnCol(0), mnRow(0) {} +SpellCheckContext::CellPos::CellPos(SCCOL nCol, SCROW nRow) : mnCol(nCol), mnRow(nRow) {} + +void SpellCheckContext::CellPos::setInvalid() +{ + mnCol = -1; + mnRow = -1; +} + +bool SpellCheckContext::CellPos::isValid() const +{ + return mnCol >= 0 && mnRow >= 0; +} + +bool SpellCheckContext::CellPos::operator< (const CellPos& r) const +{ + if (mnCol != r.mnCol) + return mnCol < r.mnCol; + + return mnRow < r.mnRow; +} + +bool SpellCheckContext::CellPos::operator== (const CellPos& r) const +{ + return mnCol == r.mnCol && mnRow == r.mnRow; +} + +SpellCheckContext::SpellCheckContext() +{ +} + +bool SpellCheckContext::isMisspelled( SCCOL nCol, SCROW nRow ) const +{ + return maMisspellCells.count(CellPos(nCol, nRow)) > 0; +} + +const std::vector<editeng::MisspellRanges>* SpellCheckContext::getMisspellRanges( + SCCOL nCol, SCROW nRow ) const +{ + CellMapType::const_iterator it = maMisspellCells.find(CellPos(nCol,nRow)); + if (it == maMisspellCells.end()) + return NULL; + + return &it->second; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index a83fba24942c..3be9f36b908a 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2332,4 +2332,19 @@ void ScTabView::SetInRefMode( bool bRefMode ) pGridWin[SC_SPLIT_TOPRIGHT]->SetInRefMode( bRefMode ); } +bool ScTabView::ContinueOnlineSpelling() +{ + bool bChanged = false; + for (int i = 0; i < 4; ++i) + { + if (!pGridWin[i] || !pGridWin[i]->IsVisible()) + continue; + + if (pGridWin[i]->ContinueOnlineSpelling()) + bChanged = true; + } + + return bChanged; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index 47fbc1453558..a7c4faca41cd 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -429,18 +429,6 @@ void ScTabView::UpdateScrollBars() { if (UpdateVisibleRange()) SC_MOD()->AnythingChanged(); // if visible area has changed - - ScSplitPos eActive = aViewData.GetActivePart(); - ScHSplitPos eHWhich = WhichH( eActive ); - ScVSplitPos eVWhich = WhichV( eActive ); - SCCOL nPosX = aViewData.GetPosX(eHWhich); - SCROW nPosY = aViewData.GetPosY(eVWhich); - SCCOL nEndX = nPosX + ( ( eHWhich == SC_SPLIT_LEFT ) ? nVisXL : nVisXR ); - SCROW nEndY = nPosY + ( ( eVWhich == SC_SPLIT_TOP ) ? nVisYT : nVisYB ); - if ( nEndX > MAXCOL ) nEndX = MAXCOL; - if ( nEndY > MAXROW ) nEndY = MAXROW; - ScRange aVisible( nPosX, nPosY, nTab, nEndX, nEndY, nTab ); - pDoc->SetVisibleSpellRange(aVisible); } } |