LibreOffice Module sc (master)  1
selectionstate.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 <selectionstate.hxx>
21 
22 #include <editeng/editview.hxx>
23 #include <viewdata.hxx>
24 #include <markdata.hxx>
25 
28 {
29  maCursor.SetTab( rViewData.GetTabNo() );
30  ScSplitPos eWhich = rViewData.GetActivePart();
31 
32  if( rViewData.HasEditView( eWhich ) )
33  {
35  maCursor.SetCol( rViewData.GetEditViewCol() );
36  maCursor.SetRow( rViewData.GetEditViewRow() );
37  maEditSel = rViewData.GetEditView( eWhich )->GetSelection();
38  }
39  else
40  {
41  maCursor.SetCol( rViewData.GetCurX() );
42  maCursor.SetRow( rViewData.GetCurY() );
43 
44  ScMarkData& rMarkData = rViewData.GetMarkData();
45  rMarkData.MarkToMulti();
46  if( rMarkData.IsMultiMarked() )
47  {
49  }
50  // else type is SC_SELECTTYPE_NONE - already initialized
51  }
52 }
53 
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3046
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
void MarkToMulti()
Definition: markdata.cxx:224
ScSelectionState(ScViewData &rViewData)
SCROW GetCurY() const
Definition: viewdata.hxx:402
bool HasEditView(ScSplitPos eWhich) const
Definition: viewdata.hxx:564
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
ScSplitPos GetActivePart() const
Definition: viewdata.hxx:398
No selection, simple cell cursor.
SCCOL GetEditViewCol() const
Definition: viewdata.hxx:585
ScSplitPos
Definition: viewdata.hxx:45
ESelection maEditSel
Cell cursor position.
ScSelectionType meType
bool IsMultiMarked() const
Definition: markdata.hxx:83
void SetRow(SCROW nRowP)
Definition: address.hxx:275
void SetCol(SCCOL nColP)
Definition: address.hxx:279
ScAddress maCursor
Type of the selection.
void SetTab(SCTAB nTabP)
Definition: address.hxx:283
Single cell, cell range, or multi range selection.
SCROW GetEditViewRow() const
Definition: viewdata.hxx:586
RedlineType meType
void GetEditView(ScSplitPos eWhich, EditView *&rViewPtr, SCCOL &rCol, SCROW &rRow)
Definition: viewdata.cxx:2219
SCCOL GetCurX() const
Definition: viewdata.hxx:401