calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / dbaccess / source / ui / querydesign / TableWindow.cxx
blobfe5310ea6592d72b07e64bd49c1c0c1a6d8f07b5
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 <TableWindow.hxx>
21 #include <TableWindowListBox.hxx>
22 #include <TableWindowData.hxx>
23 #include <imageprovider.hxx>
24 #include <JoinController.hxx>
25 #include <JoinTableView.hxx>
26 #include <JoinDesignView.hxx>
27 #include <osl/diagnose.h>
28 #include <utility>
29 #include <vcl/svapp.hxx>
30 #include <vcl/settings.hxx>
31 #include <vcl/commandevent.hxx>
32 #include <vcl/event.hxx>
33 #include <vcl/ptrstyle.hxx>
34 #include <vcl/wall.hxx>
35 #include <vcl/weldutils.hxx>
36 #include <comphelper/diagnose_ex.hxx>
38 #include <com/sun/star/container/XContainer.hpp>
39 #include <com/sun/star/container/XNameAccess.hpp>
40 #include <com/sun/star/beans/XPropertySet.hpp>
41 #include <com/sun/star/sdb/application/DatabaseObject.hpp>
42 #include <bitmaps.hlst>
43 #include <TableWindowAccess.hxx>
44 #include <connectivity/dbtools.hxx>
46 using namespace dbaui;
47 using namespace ::utl;
48 using namespace ::com::sun::star;
49 using namespace ::com::sun::star::sdb;
50 using namespace ::com::sun::star::sdbc;
51 using namespace ::com::sun::star::sdbcx;
52 using namespace ::com::sun::star::uno;
53 using namespace ::com::sun::star::beans;
54 using namespace ::com::sun::star::container;
55 using namespace ::com::sun::star::lang;
56 using namespace ::com::sun::star::accessibility;
58 namespace DatabaseObject = css::sdb::application::DatabaseObject;
60 #define TABWIN_SIZING_AREA 4
61 #define TABWIN_WIDTH_MIN 90
62 #define TABWIN_HEIGHT_MIN 80
64 namespace {
66 void Draw3DBorder(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
68 // Use the System Style-Settings for my colours
69 const StyleSettings& aSystemStyle = Application::GetSettings().GetStyleSettings();
71 // Black lines for bottom and right
72 rRenderContext.SetLineColor(aSystemStyle.GetDarkShadowColor());
73 rRenderContext.DrawLine(rRect.BottomLeft(), rRect.BottomRight());
74 rRenderContext.DrawLine(rRect.BottomRight(), rRect.TopRight());
76 // Dark grey lines over the black lines
77 rRenderContext.SetLineColor(aSystemStyle.GetShadowColor());
78 Point aEHvector(1, 1);
79 rRenderContext.DrawLine(rRect.BottomLeft() + Point(1, -1), rRect.BottomRight() - aEHvector);
80 rRenderContext.DrawLine(rRect.BottomRight() - aEHvector, rRect.TopRight() + Point(-1, 1));
82 // Light grey lines for top and left
83 rRenderContext.SetLineColor(aSystemStyle.GetLightColor());
84 rRenderContext.DrawLine(rRect.BottomLeft() + Point(1, -2), rRect.TopLeft() + aEHvector);
85 rRenderContext.DrawLine(rRect.TopLeft() + aEHvector, rRect.TopRight() + Point(-2, 1));
90 OTableWindow::OTableWindow( vcl::Window* pParent, TTableWindowData::value_type pTabWinData )
91 : ::comphelper::OContainerListener(m_aMutex)
92 , Window( pParent, WB_3DLOOK|WB_MOVEABLE )
93 , m_xTitle( VclPtr<OTableWindowTitle>::Create(this) )
94 , m_pData(std::move( pTabWinData ))
95 , m_nMoveCount(0)
96 , m_nMoveIncrement(1)
97 , m_nSizingFlags( SizingFlags::NONE )
99 // Set position and size
100 if( GetData()->HasPosition() )
101 SetPosPixel( GetData()->GetPosition() );
103 if( GetData()->HasSize() )
104 SetSizePixel( GetData()->GetSize() );
106 // Set background
107 const StyleSettings& aSystemStyle = Application::GetSettings().GetStyleSettings();
108 SetBackground(Wallpaper(aSystemStyle.GetFaceColor()));
109 // Set the text colour even though there is no text,
110 // because derived classes might need it
111 SetTextColor(aSystemStyle.GetButtonTextColor());
113 EnableClipSiblings();
116 OTableWindow::~OTableWindow()
118 disposeOnce();
121 void OTableWindow::dispose()
123 if (m_xListBox)
125 OSL_ENSURE(m_xListBox->get_widget().n_children()==0,"Forgot to call EmptyListbox()!");
127 m_xListBox.disposeAndClear();
128 if ( m_pContainerListener.is() )
129 m_pContainerListener->dispose();
131 m_xTitle.disposeAndClear();
132 vcl::Window::dispose();
135 const OJoinTableView* OTableWindow::getTableView() const
137 OSL_ENSURE(static_cast<OJoinTableView*>(GetParent()),"No OJoinTableView!");
138 return static_cast<OJoinTableView*>(GetParent());
141 OJoinTableView* OTableWindow::getTableView()
143 OSL_ENSURE(static_cast<OJoinTableView*>(GetParent()),"No OJoinTableView!");
144 return static_cast<OJoinTableView*>(GetParent());
147 OJoinDesignView* OTableWindow::getDesignView()
149 OSL_ENSURE(static_cast<OJoinDesignView*>(GetParent()->GetParent()->GetParent()),"No OJoinDesignView!");
150 return static_cast<OJoinDesignView*>(GetParent()->GetParent()->GetParent());
153 void OTableWindow::SetPosPixel( const Point& rNewPos )
155 Point aNewPosData = rNewPos + getTableView()->GetScrollOffset();
156 GetData()->SetPosition( aNewPosData );
157 Window::SetPosPixel( rNewPos );
160 void OTableWindow::SetSizePixel( const Size& rNewSize )
162 Size aOutSize(rNewSize);
163 if( aOutSize.Width() < TABWIN_WIDTH_MIN )
164 aOutSize.setWidth( TABWIN_WIDTH_MIN );
165 if( aOutSize.Height() < TABWIN_HEIGHT_MIN )
166 aOutSize.setHeight( TABWIN_HEIGHT_MIN );
168 GetData()->SetSize( aOutSize );
169 Window::SetSizePixel( aOutSize );
172 void OTableWindow::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
174 SetPosPixel( rNewPos );
175 SetSizePixel( rNewSize );
178 void OTableWindow::FillListBox()
180 clearListBox();
181 weld::TreeView& rTreeView = m_xListBox->get_widget();
182 assert(!rTreeView.n_children());
184 if ( !m_pContainerListener.is() )
186 Reference< XContainer> xContainer(m_pData->getColumns(),UNO_QUERY);
187 if ( xContainer.is() )
188 m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer);
191 // mark all primary keys with special image
192 OUString aPrimKeyImage(BMP_PRIMARY_KEY);
194 if (GetData()->IsShowAll())
196 rTreeView.append(weld::toId(createUserData(nullptr,false)), OUString("*"));
199 Reference<XNameAccess> xPKeyColumns;
202 xPKeyColumns = dbtools::getPrimaryKeyColumns_throw(m_pData->getTable());
204 catch(Exception&)
206 TOOLS_WARN_EXCEPTION( "dbaccess", "");
210 Reference< XNameAccess > xColumns = m_pData->getColumns();
211 if( xColumns.is() )
213 Sequence< OUString> aColumns = xColumns->getElementNames();
214 const OUString* pIter = aColumns.getConstArray();
215 const OUString* pEnd = pIter + aColumns.getLength();
217 for (; pIter != pEnd; ++pIter)
219 bool bPrimaryKeyColumn = xPKeyColumns.is() && xPKeyColumns->hasByName( *pIter );
221 OUString sId;
222 Reference<XPropertySet> xColumn(xColumns->getByName(*pIter),UNO_QUERY);
223 if (xColumn.is())
224 sId = weld::toId(createUserData(xColumn, bPrimaryKeyColumn));
226 rTreeView.append(sId, *pIter);
228 // is this column in the primary key
229 if ( bPrimaryKeyColumn )
230 rTreeView.set_image(rTreeView.n_children() - 1, aPrimKeyImage);
235 catch(Exception&)
237 TOOLS_WARN_EXCEPTION( "dbaccess", "");
241 void* OTableWindow::createUserData(const Reference< XPropertySet>& /*_xColumn*/,bool /*_bPrimaryKey*/)
243 return nullptr;
246 void OTableWindow::deleteUserData(void*& _pUserData)
248 OSL_ENSURE(!_pUserData,"INVALID call. Need to delete the userclass!");
249 _pUserData = nullptr;
252 void OTableWindow::clearListBox()
254 if ( !m_xListBox )
255 return;
257 weld::TreeView& rTreeView = m_xListBox->get_widget();
258 rTreeView.all_foreach([this, &rTreeView](weld::TreeIter& rEntry){
259 void* pUserData = weld::fromId<void*>(rTreeView.get_id(rEntry));
260 deleteUserData(pUserData);
261 return false;
264 rTreeView.clear();
267 void OTableWindow::impl_updateImage()
269 weld::Image& rImage = m_xTitle->GetImage();
270 ImageProvider aImageProvider( getDesignView()->getController().getConnection() );
271 rImage.set_from_icon_name(aImageProvider.getImageId(GetComposedName(), m_pData->isQuery() ? DatabaseObject::QUERY : DatabaseObject::TABLE));
272 rImage.show();
275 bool OTableWindow::Init()
277 // create list box if necessary
278 if ( !m_xListBox )
280 m_xListBox = VclPtr<OTableWindowListBox>::Create(this);
281 assert(m_xListBox && "OTableWindow::Init() : CreateListBox returned NULL !");
282 m_xListBox->get_widget().set_selection_mode(SelectionMode::Multiple);
285 // Set the title
286 weld::Label& rLabel = m_xTitle->GetLabel();
287 rLabel.set_label(m_pData->GetWinName());
288 rLabel.set_tooltip_text(GetComposedName());
289 m_xTitle->Show();
291 m_xListBox->Show();
293 // add the fields to the ListBox
294 FillListBox();
295 m_xListBox->get_widget().unselect_all();
297 impl_updateImage();
299 return true;
302 void OTableWindow::DataChanged(const DataChangedEvent& rDCEvt)
304 if (rDCEvt.GetType() == DataChangedEventType::SETTINGS)
306 // In the worst-case the colours have changed so
307 // adapt myself to the new colours
308 const StyleSettings& aSystemStyle = Application::GetSettings().GetStyleSettings();
309 SetBackground(Wallpaper(aSystemStyle.GetFaceColor()));
310 SetTextColor(aSystemStyle.GetButtonTextColor());
314 void OTableWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
316 tools::Rectangle aRect(Point(0,0), GetOutputSizePixel());
317 Window::Paint(rRenderContext, rRect);
318 Draw3DBorder(rRenderContext, aRect);
321 tools::Rectangle OTableWindow::getSizingRect(const Point& _rPos,const Size& _rOutputSize) const
323 tools::Rectangle aSizingRect( GetPosPixel(), GetSizePixel() );
325 if( m_nSizingFlags & SizingFlags::Top )
327 if( _rPos.Y() < 0 )
328 aSizingRect.SetTop( 0 );
329 else
330 aSizingRect.SetTop( _rPos.Y() );
333 if( m_nSizingFlags & SizingFlags::Bottom )
335 if( _rPos.Y() > _rOutputSize.Height() )
336 aSizingRect.SetBottom( _rOutputSize.Height() );
337 else
338 aSizingRect.SetBottom( _rPos.Y() );
341 if( m_nSizingFlags & SizingFlags::Right )
343 if( _rPos.X() > _rOutputSize.Width() )
344 aSizingRect.SetRight( _rOutputSize.Width() );
345 else
346 aSizingRect.SetRight( _rPos.X() );
349 if( m_nSizingFlags & SizingFlags::Left )
351 if( _rPos.X() < 0 )
352 aSizingRect.SetLeft( 0 );
353 else
354 aSizingRect.SetLeft( _rPos.X() );
356 return aSizingRect;
359 void OTableWindow::setSizingFlag(const Point& _rPos)
361 Size aOutSize = GetOutputSizePixel();
362 // Set the flags when the mouse cursor is in the sizing area
363 m_nSizingFlags = SizingFlags::NONE;
365 if( _rPos.X() < TABWIN_SIZING_AREA )
366 m_nSizingFlags |= SizingFlags::Left;
368 if( _rPos.Y() < TABWIN_SIZING_AREA )
369 m_nSizingFlags |= SizingFlags::Top;
371 if( _rPos.X() > aOutSize.Width()-TABWIN_SIZING_AREA )
372 m_nSizingFlags |= SizingFlags::Right;
374 if( _rPos.Y() > aOutSize.Height()-TABWIN_SIZING_AREA )
375 m_nSizingFlags |= SizingFlags::Bottom;
378 void OTableWindow::MouseMove( const MouseEvent& rEvt )
380 Window::MouseMove(rEvt);
382 OJoinTableView* pCont = getTableView();
383 if (pCont->getDesignView()->getController().isReadOnly())
384 return;
386 Point aPos = rEvt.GetPosPixel();
387 setSizingFlag(aPos);
388 PointerStyle aPointer = PointerStyle::Arrow;
390 // Set the mouse cursor when it is in the sizing area
391 if ( m_nSizingFlags == SizingFlags::Top ||
392 m_nSizingFlags == SizingFlags::Bottom )
393 aPointer = PointerStyle::SSize;
394 else if ( m_nSizingFlags == SizingFlags::Left ||
395 m_nSizingFlags ==SizingFlags::Right )
396 aPointer = PointerStyle::ESize;
397 else if ( m_nSizingFlags == (SizingFlags::Left | SizingFlags::Top) ||
398 m_nSizingFlags == (SizingFlags::Right | SizingFlags::Bottom) )
399 aPointer = PointerStyle::SESize;
400 else if ( m_nSizingFlags == (SizingFlags::Right | SizingFlags::Top) ||
401 m_nSizingFlags == (SizingFlags::Left | SizingFlags::Bottom) )
402 aPointer = PointerStyle::NESize;
404 SetPointer( aPointer );
407 void OTableWindow::MouseButtonDown( const MouseEvent& rEvt )
409 // When resizing, the parent must be informed that
410 // the window size of its child has changed
411 if( m_nSizingFlags != SizingFlags::NONE )
412 getTableView()->BeginChildSizing( this, GetPointer() );
414 Window::MouseButtonDown( rEvt );
417 void OTableWindow::Resize()
419 // The window must not disappear so we enforce a minimum size
420 Size aOutSize = GetOutputSizePixel();
421 aOutSize = Size(CalcZoom(aOutSize.Width()),CalcZoom(aOutSize.Height()));
423 tools::Long nTitleHeight = CalcZoom( GetTextHeight() )+ CalcZoom( 4 );
425 // Set the title and ListBox
426 tools::Long n5Pos = CalcZoom(5);
427 tools::Long nPositionX = n5Pos;
428 tools::Long nPositionY = n5Pos;
430 Size aPreferredSize = m_xTitle->get_preferred_size();
431 if (nTitleHeight < aPreferredSize.Height())
432 nTitleHeight = aPreferredSize.Height();
434 m_xTitle->SetPosSizePixel( Point( nPositionX, nPositionY ), Size( aOutSize.Width() - nPositionX - n5Pos, nTitleHeight ) );
436 tools::Long nTitleToList = CalcZoom( 3 );
438 m_xListBox->SetPosSizePixel(
439 Point( n5Pos, nPositionY + nTitleHeight + nTitleToList ),
440 Size( aOutSize.Width() - 2 * n5Pos, aOutSize.Height() - ( nPositionY + nTitleHeight + nTitleToList ) - n5Pos )
443 Window::Invalidate();
446 void OTableWindow::SetBoldTitle( bool bBold )
448 weld::Label& rLabel = m_xTitle->GetLabel();
449 vcl::Font aFont = rLabel.get_font();
450 aFont.SetWeight(bBold ? WEIGHT_BOLD : WEIGHT_NORMAL);
451 rLabel.set_font(aFont);
454 void OTableWindow::GetFocus()
456 Window::GetFocus();
457 // we have to forward the focus to our listbox to enable keystrokes
458 if(m_xListBox)
459 m_xListBox->GrabFocus();
462 void OTableWindow::setActive(bool _bActive)
464 SetBoldTitle( _bActive );
465 if (_bActive || !m_xListBox)
466 return;
468 weld::TreeView& rTreeView = m_xListBox->get_widget();
469 if (rTreeView.get_selected_index() != -1)
470 rTreeView.unselect_all();
473 void OTableWindow::Remove()
475 // Delete the window
476 OJoinTableView* pTabWinCont = getTableView();
477 VclPtr<OTableWindow> aHoldSelf(this); // keep ourselves alive during the RemoveTabWin process
478 pTabWinCont->RemoveTabWin( this );
479 pTabWinCont->Invalidate();
482 bool OTableWindow::ExistsAConn() const
484 return getTableView()->ExistsAConn(this);
487 void OTableWindow::EnumValidFields(std::vector< OUString>& arrstrFields)
489 arrstrFields.clear();
490 weld::TreeView& rTreeView = m_xListBox->get_widget();
492 // This default implementation counts every item in the ListBox ... for any other behaviour it must be over-written
493 rTreeView.all_foreach([&rTreeView, &arrstrFields](weld::TreeIter& rEntry){
494 arrstrFields.push_back(rTreeView.get_text(rEntry));
495 return false;
499 void OTableWindow::StateChanged( StateChangedType nType )
501 Window::StateChanged( nType );
503 // FIXME RenderContext
505 if ( nType != StateChangedType::Zoom )
506 return;
508 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
510 vcl::Font aFont = rStyleSettings.GetGroupFont();
511 if ( IsControlFont() )
512 aFont.Merge( GetControlFont() );
513 SetZoomedPointFont(*GetOutDev(), aFont);
515 m_xTitle->SetZoom(GetZoom());
516 m_xListBox->SetZoom(GetZoom());
517 Resize();
518 Invalidate();
521 Reference< XAccessible > OTableWindow::CreateAccessible()
523 return new OTableWindowAccess(this);
526 void OTableWindow::Command(const CommandEvent& rEvt)
528 switch (rEvt.GetCommand())
530 case CommandEventId::ContextMenu:
532 OJoinController& rController = getDesignView()->getController();
533 if(!rController.isReadOnly() && rController.isConnected())
535 Point ptWhere;
536 if ( rEvt.IsMouseEvent() )
537 ptWhere = rEvt.GetMousePosPixel();
538 else
540 weld::TreeView& rTreeView = m_xListBox->get_widget();
541 std::unique_ptr<weld::TreeIter> xCurrent = rTreeView.make_iterator();
542 if (rTreeView.get_cursor(xCurrent.get()))
543 ptWhere = rTreeView.get_row_area(*xCurrent).Center();
544 else
545 ptWhere = m_xTitle->GetPosPixel();
548 ::tools::Rectangle aRect(ptWhere, Size(1, 1));
549 weld::Window* pPopupParent = weld::GetPopupParent(*this, aRect);
550 std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pPopupParent, "dbaccess/ui/jointablemenu.ui"));
551 std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu("menu"));
552 if (!xContextMenu->popup_at_rect(pPopupParent, aRect).isEmpty())
553 Remove();
555 break;
557 default:
558 Window::Command(rEvt);
562 bool OTableWindow::PreNotify(NotifyEvent& rNEvt)
564 bool bHandled = false;
565 switch (rNEvt.GetType())
567 case NotifyEventType::KEYINPUT:
569 if ( getDesignView()->getController().isReadOnly() )
570 break;
572 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
573 const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
574 if ( rCode.IsMod1() )
576 Point aStartPoint = GetPosPixel();
577 if ( rCode.IsShift() )
579 aStartPoint.setX( GetSizePixel().Width() );
580 aStartPoint.setY( GetSizePixel().Height() );
583 switch( rCode.GetCode() )
585 case KEY_DOWN:
586 bHandled = true;
587 aStartPoint.AdjustY(m_nMoveIncrement );
588 break;
589 case KEY_UP:
590 bHandled = true;
591 aStartPoint.AdjustY(-m_nMoveIncrement );
592 break;
593 case KEY_LEFT:
594 bHandled = true;
595 aStartPoint.AdjustX(-m_nMoveIncrement );
596 break;
597 case KEY_RIGHT:
598 bHandled = true;
599 aStartPoint.AdjustX(m_nMoveIncrement );
600 break;
602 if ( bHandled )
604 if ( rCode.IsShift() )
606 OJoinTableView* pView = getTableView();
607 Point ptOld = GetPosPixel();
608 Size aSize = pView->getRealOutputSize();
609 Size aNewSize(aStartPoint.X(),aStartPoint.Y());
610 if ( ((ptOld.X() + aNewSize.Width()) <= aSize.Width())
611 && ((ptOld.Y() + aNewSize.Height()) <= aSize.Height()) )
613 if ( aNewSize.Width() < TABWIN_WIDTH_MIN )
614 aNewSize.setWidth( TABWIN_WIDTH_MIN );
615 if ( aNewSize.Height() < TABWIN_HEIGHT_MIN )
616 aNewSize.setHeight( TABWIN_HEIGHT_MIN );
618 Size szOld = GetSizePixel();
620 aNewSize = Size(pView->CalcZoom(aNewSize.Width()),pView->CalcZoom(aNewSize.Height()));
621 SetPosSizePixel( ptOld, aNewSize );
622 pView->TabWinSized(this, ptOld, szOld);
623 Invalidate( InvalidateFlags::NoChildren );
626 else
628 // remember how often the user moved our window
629 ++m_nMoveCount;
630 if( m_nMoveCount == 5 )
631 m_nMoveIncrement = 10;
632 else if( m_nMoveCount > 15 )
633 m_nMoveCount = m_nMoveIncrement = 20;
635 Point aOldDataPoint = GetData()->GetPosition();
636 Point aNewDataPoint = aStartPoint + getTableView()->GetScrollOffset();
637 if ( aNewDataPoint.X() > -1 && aNewDataPoint.Y() > -1 )
639 OJoinTableView* pView = getTableView();
640 if ( pView->isMovementAllowed(aNewDataPoint, GetData()->GetSize()) )
642 SetPosPixel(aStartPoint);
644 // aNewDataPoint can not be used here because SetPosPixel reset it
645 pView->EnsureVisible(GetData()->GetPosition(), GetData()->GetSize());
646 pView->TabWinMoved(this,aOldDataPoint);
647 Invalidate(InvalidateFlags::NoChildren);
648 getDesignView()->getController().setModified( true );
650 else
652 m_nMoveCount = 0; // reset our movement count
653 m_nMoveIncrement = 1;
656 else
658 m_nMoveCount = 0; // reset our movement count
659 m_nMoveIncrement = 1;
662 m_nSizingFlags = SizingFlags::NONE;
664 else
666 m_nMoveCount = 0; // reset our movement count
667 m_nMoveIncrement = 1;
670 else
672 m_nMoveCount = 0; // reset our movement count
673 m_nMoveIncrement = 1;
675 break;
677 case NotifyEventType::KEYUP:
679 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
680 const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
681 sal_uInt16 nKeyCode = rCode.GetCode();
682 if ( rCode.IsMod2() && nKeyCode != KEY_UP && nKeyCode != KEY_DOWN && nKeyCode != KEY_LEFT && nKeyCode != KEY_RIGHT )
684 m_nMoveCount = 0; // reset our movement count
685 m_nMoveIncrement = 1;
687 break;
689 default:
690 break;
692 if (!bHandled)
693 return Window::PreNotify(rNEvt);
694 return true;
697 OUString OTableWindow::getTitle() const
699 return m_xTitle->GetLabel().get_label();
702 void OTableWindow::_elementInserted( const container::ContainerEvent& /*_rEvent*/ )
704 FillListBox();
707 void OTableWindow::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ )
709 FillListBox();
712 void OTableWindow::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ )
714 FillListBox();
717 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */