diff options
Diffstat (limited to 'sdext/source/presenter/PresenterToolBar.cxx')
-rw-r--r-- | sdext/source/presenter/PresenterToolBar.cxx | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx index ad5d6161eca8..a20c2871d9b2 100644 --- a/sdext/source/presenter/PresenterToolBar.cxx +++ b/sdext/source/presenter/PresenterToolBar.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -112,11 +112,11 @@ namespace { { public: ElementMode (void); - + SharedBitmapDescriptor mpIcon; OUString msAction; Text maText; - + void ReadElementMode ( const Reference<beans::XPropertySet>& rxProperties, const ::rtl::OUString& rsModeName, @@ -137,13 +137,13 @@ public: css::uno::Reference<css::rendering::XCanvas> mxCanvas; }; - + //===== PresenterToolBar::Element ============================================= namespace { - typedef cppu::WeakComponentImplHelper2< + typedef cppu::WeakComponentImplHelper2< css::document::XEventListener, css::frame::XStatusListener > ElementInterfaceBase; @@ -185,7 +185,7 @@ namespace { virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) throw(css::uno::RuntimeException); - + // document::XEventListener virtual void SAL_CALL notifyEvent (const css::document::EventObject& rEvent) @@ -208,7 +208,7 @@ namespace { bool mbIsOver; bool mbIsPressed; bool mbIsSelected; - + virtual awt::Size CreateBoundingSize ( const Reference<rendering::XCanvas>& rxCanvas) = 0; @@ -251,11 +251,11 @@ namespace { virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) throw(css::uno::RuntimeException); - + protected: virtual awt::Size CreateBoundingSize ( const Reference<rendering::XCanvas>& rxCanvas); - + private: bool mbIsListenerRegistered; @@ -277,7 +277,7 @@ namespace { { public: Label (const ::rtl::Reference<PresenterToolBar>& rpToolBar); - + void SetText (const OUString& rsText); virtual void Paint ( const Reference<rendering::XCanvas>& rxCanvas, @@ -445,7 +445,7 @@ void PresenterToolBar::Initialize ( Reference<awt::XWindowPeer> xPeer (mxWindow, UNO_QUERY); if (xPeer.is()) xPeer->setBackground(util::Color(0xff000000)); - + mxWindow->setVisible(sal_True); } @@ -614,7 +614,7 @@ void SAL_CALL PresenterToolBar::disposing (const lang::EventObject& rEventObject //----- XWindowListener ------------------------------------------------------- - + void SAL_CALL PresenterToolBar::windowResized (const awt::WindowEvent& rEvent) throw (RuntimeException) { @@ -670,7 +670,7 @@ void SAL_CALL PresenterToolBar::windowPaint (const css::awt::PaintEvent& rEvent) if (mbIsLayoutPending) Layout(mxCanvas); - + Paint(rEvent.UpdateRect, aViewState); // Make the back buffer visible. @@ -721,7 +721,7 @@ void SAL_CALL PresenterToolBar::mouseExited (const css::awt::MouseEvent& rEvent) //----- XMouseMotionListener -------------------------------------------------- - + void SAL_CALL PresenterToolBar::mouseMoved (const css::awt::MouseEvent& rEvent) throw (css::uno::RuntimeException) { @@ -774,7 +774,7 @@ void PresenterToolBar::CreateControls ( { if ( ! mxWindow.is()) return; - + // Expand the macro in the bitmap file names. PresenterConfigurationAccess aConfiguration ( mxComponentContext, @@ -890,7 +890,7 @@ void PresenterToolBar::Layout ( for (iPart=maElementContainer.begin(),nIndex=0; iPart!=iEnd; ++iPart,++nIndex) { geometry::RealSize2D aSize (CalculatePartSize(rxCanvas, *iPart, bIsHorizontal)); - + // Remember the size of each part for later. aPartSizes[nIndex] = aSize; @@ -900,7 +900,7 @@ void PresenterToolBar::Layout ( nTotalHorizontalGap += ((*iPart)->size() - 1) * gnGapSize; nGapCount += (*iPart)->size()-1; } - + // Orientation changes for each part. bIsHorizontal = !bIsHorizontal; // Width is accumulated. @@ -941,12 +941,12 @@ void PresenterToolBar::Layout ( // Place the parts. double nY ((aWindowBox.Height - aTotalSize.Height) / 2); bIsHorizontal = true; - + maBoundingBox.X1 = nX; maBoundingBox.Y1 = nY; maBoundingBox.X2 = nX + aTotalSize.Width + nTotalHorizontalGap; maBoundingBox.Y2 = nY + aTotalSize.Height; - + for (iPart=maElementContainer.begin(), nIndex=0; iPart!=iEnd; ++iPart,++nIndex) { geometry::RealRectangle2D aBoundingBox( @@ -1130,7 +1130,7 @@ void PresenterToolBar::CheckMouseOver ( { if (iElement->get() == NULL) continue; - + awt::Rectangle aBox ((*iElement)->GetBoundingBox()); const bool bIsOver = bOverWindow && aBox.X <= rEvent.X @@ -1202,7 +1202,7 @@ PresenterToolBarView::PresenterToolBarView ( Reference<awt::XWindowPeer> xPeer (mxWindow, UNO_QUERY); if (xPeer.is()) xPeer->setBackground(util::Color(0xff000000)); - + mxWindow->setVisible(sal_True); } } @@ -1229,7 +1229,7 @@ void SAL_CALL PresenterToolBarView::disposing (void) mpToolBar = NULL; if (xComponent.is()) xComponent->dispose(); - + if (mxWindow.is()) { mxWindow->removePaintListener(this); @@ -1449,7 +1449,7 @@ bool Element::SetState ( { bool bModified (mbIsOver != bIsOver || mbIsPressed != bIsPressed); bool bClicked (mbIsPressed && bIsOver && ! bIsPressed); - + mbIsOver = bIsOver; mbIsPressed = bIsPressed; @@ -1472,7 +1472,7 @@ bool Element::SetState ( { if (mpMode->msAction.getLength() <= 0) break; - + if (mpToolBar.get() == NULL) break; @@ -1573,7 +1573,7 @@ void SAL_CALL Element::disposing (const css::lang::EventObject& rEvent) { (void)rEvent; } - + @@ -1597,7 +1597,7 @@ void SAL_CALL Element::statusChanged (const css::frame::FeatureStateEvent& rEven bool bIsSelected (mbIsSelected); bool bIsEnabled (rEvent.IsEnabled); rEvent.State >>= bIsSelected; - + if (bIsSelected != mbIsSelected || bIsEnabled != mbIsEnabled) { mbIsEnabled = bIsEnabled; @@ -1758,13 +1758,13 @@ void Button::Paint ( if (mpMode.get() == NULL) return; - + if (mpMode->mpIcon.get() == NULL) return; geometry::RealRectangle2D aTextBBox (mpMode->maText.GetBoundingBox(rxCanvas)); sal_Int32 nTextHeight (sal::static_int_cast<sal_Int32>(0.5 + aTextBBox.Y2 - aTextBBox.Y1)); - + PaintIcon(rxCanvas, nTextHeight, rViewState); awt::Point aOffset(0,0); if ( ! IsEnabled()) @@ -1814,7 +1814,7 @@ void Button::PaintIcon ( { if (mpMode.get() == NULL) return; - + Reference<rendering::XBitmap> xBitmap (mpMode->mpIcon->GetBitmap(GetMode())); if (xBitmap.is()) { @@ -1858,7 +1858,7 @@ void SAL_CALL Button::disposing (const css::lang::EventObject& rEvent) mbIsListenerRegistered = false; Element::disposing(rEvent); } - + } // end of anonymous namespace @@ -1881,13 +1881,13 @@ awt::Size Label::CreateBoundingSize ( { if (mpMode.get() == NULL) return awt::Size(0,0); - + geometry::RealRectangle2D aTextBBox (mpMode->maText.GetBoundingBox(rxCanvas)); return awt::Size( sal::static_int_cast<sal_Int32>(0.5 + aTextBBox.X2 - aTextBBox.X1), sal::static_int_cast<sal_Int32>(0.5 + aTextBBox.Y2 - aTextBBox.Y1)); } - + @@ -1920,7 +1920,7 @@ void Label::Paint ( OSL_ASSERT(rxCanvas.is()); if (mpMode.get() == NULL) return; - + mpMode->maText.Paint(rxCanvas, rViewState, GetBoundingBox(), awt::Point(0,0)); } @@ -2035,7 +2035,7 @@ void Text::Paint ( Sequence<double>(4), rendering::CompositeOperation::SOURCE); PresenterCanvasHelper::SetDeviceColor(aRenderState, mpFont->mnColor); - + rxCanvas->drawText( aContext, mpFont->mxFont, @@ -2125,7 +2125,7 @@ OUString TimeFormatter::FormatTime (const oslDateTime& rTime) const sal_Int32 nHours (sal::static_int_cast<sal_Int32>(rTime.Hours)); const sal_Int32 nMinutes (sal::static_int_cast<sal_Int32>(rTime.Minutes)); const sal_Int32 nSeconds(sal::static_int_cast<sal_Int32>(rTime.Seconds)); - + // Hours if (mbIs24HourFormat) sText.append(OUString::valueOf(nHours)); @@ -2293,7 +2293,7 @@ void PresentationTimeLabel::TimeHasChanged (const oslDateTime& rCurrentTime) maStartTimeValue.Seconds += 1; maStartTimeValue.Nanosec = 0; } - + TimeValue aElapsedTimeValue; aElapsedTimeValue.Seconds = aCurrentTimeValue.Seconds - maStartTimeValue.Seconds; aElapsedTimeValue.Nanosec = aCurrentTimeValue.Nanosec - maStartTimeValue.Nanosec; |