GPU-Calc: remove Alloc_Host_Ptr for clmem of NAN vector
[LibreOffice.git] / sc / source / ui / navipi / navcitem.cxx
blob9297aae5f3508db0ed2b1f8be03572b52a5c84e8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <svl/intitem.hxx>
21 #include <svl/stritem.hxx>
23 #include "navcitem.hxx"
24 #include "global.hxx"
25 #include "navipi.hxx"
26 #include "sc.hrc"
28 // STATIC DATA -----------------------------------------------------------
31 //------------------------------------------------------------------------
33 ScNavigatorControllerItem::ScNavigatorControllerItem( sal_uInt16 nIdP,
34 ScNavigatorDlg& rDlg,
35 SfxBindings& rBindings )
36 : SfxControllerItem ( nIdP, rBindings ),
37 rNavigatorDlg ( rDlg )
41 //------------------------------------------------------------------------
43 void ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, SfxItemState /* eState */,
44 const SfxPoolItem* pItem )
46 switch( GetId() )
48 case SID_CURRENTCELL:
49 if ( pItem )
51 const SfxStringItem* pCellPosItem = PTR_CAST(SfxStringItem, pItem);
53 OSL_ENSURE( pCellPosItem, "SfxStringItem expected!" );
55 if ( pCellPosItem )
57 OUString aAddress( pCellPosItem->GetValue() );
58 ScAddress aScAddress;
59 aScAddress.Parse( aAddress );
61 SCCOL nCol = aScAddress.Col()+1;
62 SCROW nRow = aScAddress.Row()+1;
64 rNavigatorDlg.UpdateColumn( &nCol );
65 rNavigatorDlg.UpdateRow ( &nRow );
66 rNavigatorDlg.CursorPosChanged();
69 break;
71 case SID_CURRENTTAB:
72 if ( pItem )
74 const SfxUInt16Item* pTabItem = PTR_CAST(SfxUInt16Item, pItem);
76 OSL_ENSURE( pTabItem, "SfxUInt16Item expected!" );
78 // Tabelle fuer Basic ist 1-basiert
79 if ( pTabItem && pTabItem->GetValue() )
81 SCTAB nTab = pTabItem->GetValue() - 1;
83 rNavigatorDlg.UpdateTable( &nTab );
84 rNavigatorDlg.UpdateColumn();
85 rNavigatorDlg.UpdateRow();
86 rNavigatorDlg.CursorPosChanged();
89 break;
91 case SID_CURRENTDOC:
93 // gar nix mehr, wird ueber SFX_HINT_DOCCHANGED erledigt
95 break;
98 case SID_SELECT_SCENARIO:
99 rNavigatorDlg.aWndScenarios.NotifyState( pItem );
100 break;
102 default:
103 break;
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */