fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / navipi / navcitem.cxx
blobef981c99aaeaa4d25782b177f579f7fef47d5b49
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 -----------------------------------------------------------
30 ScNavigatorControllerItem::ScNavigatorControllerItem( sal_uInt16 nIdP,
31 ScNavigatorDlg& rDlg,
32 SfxBindings& rBindings )
33 : SfxControllerItem ( nIdP, rBindings ),
34 rNavigatorDlg ( rDlg )
38 void ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, SfxItemState /* eState */,
39 const SfxPoolItem* pItem )
41 switch( GetId() )
43 case SID_CURRENTCELL:
44 if ( pItem )
46 const SfxStringItem* pCellPosItem = PTR_CAST(SfxStringItem, pItem);
48 OSL_ENSURE( pCellPosItem, "SfxStringItem expected!" );
50 if ( pCellPosItem )
52 OUString aAddress( pCellPosItem->GetValue() );
53 ScAddress aScAddress;
54 aScAddress.Parse( aAddress );
56 SCCOL nCol = aScAddress.Col()+1;
57 SCROW nRow = aScAddress.Row()+1;
59 rNavigatorDlg.UpdateColumn( &nCol );
60 rNavigatorDlg.UpdateRow ( &nRow );
63 break;
65 case SID_CURRENTTAB:
66 if ( pItem )
68 const SfxUInt16Item* pTabItem = PTR_CAST(SfxUInt16Item, pItem);
70 OSL_ENSURE( pTabItem, "SfxUInt16Item expected!" );
72 // Tabelle fuer Basic ist 1-basiert
73 if ( pTabItem && pTabItem->GetValue() )
75 SCTAB nTab = pTabItem->GetValue() - 1;
77 rNavigatorDlg.UpdateTable( &nTab );
78 rNavigatorDlg.UpdateColumn();
79 rNavigatorDlg.UpdateRow();
82 break;
84 case SID_CURRENTDOC:
86 // gar nix mehr, wird ueber SFX_HINT_DOCCHANGED erledigt
88 break;
90 case SID_SELECT_SCENARIO:
91 rNavigatorDlg.aWndScenarios->NotifyState( pItem );
92 break;
94 default:
95 break;
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */