summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-10-27 12:48:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-27 11:39:37 +0000
commite5438e9ef75a7fdc3c8c6ba44d116f277e036d96 (patch)
tree9a1f94e23649f96a6a4b165504680bf6530fed77 /sdext
parent618171552e1bcddb07660167d9df4512435269b0 (diff)
loplugin:expandablemethods in sdext
Change-Id: I7d375d6eafdd450ac165539f8f7dd3d02826ac5b Reviewed-on: https://gerrit.libreoffice.org/30323 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/presenter/PresenterAccessibility.cxx9
-rw-r--r--sdext/source/presenter/PresenterController.cxx18
-rw-r--r--sdext/source/presenter/PresenterController.hxx2
-rw-r--r--sdext/source/presenter/PresenterNotesView.cxx18
-rw-r--r--sdext/source/presenter/PresenterNotesView.hxx6
-rw-r--r--sdext/source/presenter/PresenterProtocolHandler.cxx34
-rw-r--r--sdext/source/presenter/PresenterScreen.cxx22
-rw-r--r--sdext/source/presenter/PresenterScrollBar.cxx29
-rw-r--r--sdext/source/presenter/PresenterScrollBar.hxx1
-rw-r--r--sdext/source/presenter/PresenterSlideShowView.cxx20
-rw-r--r--sdext/source/presenter/PresenterTextView.cxx7
-rw-r--r--sdext/source/presenter/PresenterTextView.hxx1
-rw-r--r--sdext/source/presenter/PresenterWindowManager.cxx7
-rw-r--r--sdext/source/presenter/PresenterWindowManager.hxx2
14 files changed, 50 insertions, 126 deletions
diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx
index 03d3017f4d2c..7c474b288daf 100644
--- a/sdext/source/presenter/PresenterAccessibility.cxx
+++ b/sdext/source/presenter/PresenterAccessibility.cxx
@@ -217,8 +217,6 @@ protected:
void UpdateState (const sal_Int16 aState, const bool bValue);
- bool IsDisposed() const;
-
void ThrowIfDisposed() const
throw (css::lang::DisposedException);
};
@@ -1090,7 +1088,7 @@ void SAL_CALL PresenterAccessible::AccessibleObject::addAccessibleEventListener
{
const osl::MutexGuard aGuard(m_aMutex);
- if (IsDisposed())
+ if (rBHelper.bDisposed || rBHelper.bInDispose)
{
uno::Reference<uno::XInterface> xThis (static_cast<XWeak*>(this), UNO_QUERY);
rxListener->disposing (lang::EventObject(xThis));
@@ -1336,11 +1334,6 @@ awt::Point PresenterAccessible::AccessibleObject::GetAbsoluteParentLocation()
return awt::Point();
}
-bool PresenterAccessible::AccessibleObject::IsDisposed() const
-{
- return (rBHelper.bDisposed || rBHelper.bInDispose);
-}
-
void PresenterAccessible::AccessibleObject::ThrowIfDisposed() const
throw (lang::DisposedException)
{
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index 5a8235c7f868..f6e39cd4b51b 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -722,7 +722,12 @@ void SAL_CALL PresenterController::notifyConfigurationChange (
const ConfigurationChangeEvent& rEvent)
throw (RuntimeException, std::exception)
{
- ThrowIfDisposed();
+ if (rBHelper.bDisposed || rBHelper.bInDispose)
+ {
+ throw lang::DisposedException (
+ OUString( "PresenterController object has already been disposed"),
+ const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
+ }
sal_Int32 nType (0);
if ( ! (rEvent.UserData >>= nType))
@@ -1208,17 +1213,6 @@ void PresenterController::UpdatePendingSlideNumber (const sal_Int32 nPendingSlid
0));
}
-void PresenterController::ThrowIfDisposed() const
- throw (css::lang::DisposedException)
-{
- if (rBHelper.bDisposed || rBHelper.bInDispose)
- {
- throw lang::DisposedException (
- OUString( "PresenterController object has already been disposed"),
- const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
- }
-}
-
void PresenterController::SwitchMonitors()
{
Reference<lang::XEventListener> xScreen( mxScreen );
diff --git a/sdext/source/presenter/PresenterController.hxx b/sdext/source/presenter/PresenterController.hxx
index e54bcf0b2903..3b96626882ff 100644
--- a/sdext/source/presenter/PresenterController.hxx
+++ b/sdext/source/presenter/PresenterController.hxx
@@ -244,8 +244,6 @@ private:
The modifier bit field as provided by the key up event.
*/
void HandleNumericKeyPress (const sal_Int32 nKey, const sal_Int32 nModifiers);
-
- void ThrowIfDisposed() const throw (css::lang::DisposedException);
};
} } // end of namespace ::sdext::presenter
diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx
index 11b6d9ef8347..c964839a38b4 100644
--- a/sdext/source/presenter/PresenterNotesView.cxx
+++ b/sdext/source/presenter/PresenterNotesView.cxx
@@ -320,7 +320,12 @@ void SAL_CALL PresenterNotesView::windowHidden (const lang::EventObject& rEvent)
void SAL_CALL PresenterNotesView::windowPaint (const awt::PaintEvent& rEvent)
throw (RuntimeException, std::exception)
{
- ThrowIfDisposed();
+ if (rBHelper.bDisposed || rBHelper.bInDispose)
+ {
+ throw lang::DisposedException (
+ "PresenterNotesView object has already been disposed",
+ static_cast<uno::XWeak*>(this));
+ }
if ( ! mbIsPresenterViewActive)
return;
@@ -698,17 +703,6 @@ void PresenterNotesView::UpdateScrollBar()
}
}
-void PresenterNotesView::ThrowIfDisposed()
- throw (css::lang::DisposedException)
-{
- if (rBHelper.bDisposed || rBHelper.bInDispose)
- {
- throw lang::DisposedException (
- "PresenterNotesView object has already been disposed",
- static_cast<uno::XWeak*>(this));
- }
-}
-
} } // end of namespace ::sdext::presenter
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/presenter/PresenterNotesView.hxx b/sdext/source/presenter/PresenterNotesView.hxx
index 8a0fea61d5b8..d7f1bbf3fab7 100644
--- a/sdext/source/presenter/PresenterNotesView.hxx
+++ b/sdext/source/presenter/PresenterNotesView.hxx
@@ -166,12 +166,6 @@ private:
void Scroll (const double nDistance);
void SetTop (const double nTop);
void UpdateScrollBar();
-
- /** This method throws a DisposedException when the object has already been
- disposed.
- */
- void ThrowIfDisposed()
- throw (css::lang::DisposedException);
};
} } // end of namespace ::sdext::presenter
diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx
index 107c18c01660..cb2d556ee368 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.cxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.cxx
@@ -127,7 +127,6 @@ namespace {
private:
bool mbOn;
rtl::Reference<PresenterController> mpPresenterController;
- static bool IsActive (const ::rtl::Reference<PresenterWindowManager>& rpWindowManager);
};
class SetSlideSorterCommand : public Command
@@ -240,8 +239,6 @@ private:
const OUString& rsURLPath,
const ::rtl::Reference<PresenterController>& rpPresenterController);
virtual ~Dispatch() override;
-
- void ThrowIfDisposed() const throw (css::lang::DisposedException);
};
//----- Service ---------------------------------------------------------------
@@ -453,11 +450,16 @@ void PresenterProtocolHandler::Dispatch::disposing()
void SAL_CALL PresenterProtocolHandler::Dispatch::dispatch(
const css::util::URL& rURL,
- const css::uno::Sequence<css::beans::PropertyValue>& rArguments)
+ const css::uno::Sequence<css::beans::PropertyValue>& /*rArguments*/)
throw(css::uno::RuntimeException, std::exception)
{
- (void)rArguments;
- ThrowIfDisposed();
+ if (rBHelper.bDisposed || rBHelper.bInDispose)
+ {
+ throw lang::DisposedException (
+ OUString(
+ "PresenterProtocolHandler::Dispatch object has already been disposed"),
+ const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
+ }
if (rURL.Protocol == "vnd.org.libreoffice.presenterscreen:"
&& rURL.Path == msURLPath)
@@ -511,18 +513,6 @@ void SAL_CALL PresenterProtocolHandler::Dispatch::removeStatusListener (
throw RuntimeException();
}
-void PresenterProtocolHandler::Dispatch::ThrowIfDisposed() const
- throw (css::lang::DisposedException)
-{
- if (rBHelper.bDisposed || rBHelper.bInDispose)
- {
- throw lang::DisposedException (
- OUString(
- "PresenterProtocolHandler::Dispatch object has already been disposed"),
- const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
- }
-}
-
//----- document::XEventListener ----------------------------------------------
void SAL_CALL PresenterProtocolHandler::Dispatch::notifyEvent (
@@ -675,13 +665,7 @@ Any SetNotesViewCommand::GetState() const
if ( ! pWindowManager.is())
return Any(false);
- return Any(IsActive(pWindowManager));
-}
-
-bool SetNotesViewCommand::IsActive (
- const ::rtl::Reference<PresenterWindowManager>& rpWindowManager)
-{
- return rpWindowManager->GetViewMode() == PresenterWindowManager::VM_Notes;
+ return Any(pWindowManager->GetViewMode() == PresenterWindowManager::VM_Notes);
}
//===== SetSlideSorterCommand =================================================
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index 0bfb4522d178..26b4cfbc29c4 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -85,8 +85,6 @@ namespace {
css::uno::Reference<css::frame::XModel2 > mxModel;
css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
rtl::Reference<PresenterScreen> mpPresenterScreen;
-
- void ThrowIfDisposed() const throw (css::lang::DisposedException);
};
}
@@ -215,7 +213,13 @@ void SAL_CALL PresenterScreenListener::disposing()
void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventObject& Event ) throw (css::uno::RuntimeException, std::exception)
{
- ThrowIfDisposed();
+ if (rBHelper.bDisposed || rBHelper.bInDispose)
+ {
+ throw lang::DisposedException (
+ OUString(
+ "PresenterScreenListener object has already been disposed"),
+ const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
+ }
if ( Event.EventName == "OnStartPresentation" )
{
@@ -247,18 +251,6 @@ void SAL_CALL PresenterScreenListener::disposing (const css::lang::EventObject&
}
}
-void PresenterScreenListener::ThrowIfDisposed() const throw (
- css::lang::DisposedException)
-{
- if (rBHelper.bDisposed || rBHelper.bInDispose)
- {
- throw lang::DisposedException (
- OUString(
- "PresenterScreenListener object has already been disposed"),
- const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
- }
-}
-
} // end of anonymous namespace
//===== PresenterScreen =======================================================
diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx
index ead527a0a0ea..8cba1bcafa01 100644
--- a/sdext/source/presenter/PresenterScrollBar.cxx
+++ b/sdext/source/presenter/PresenterScrollBar.cxx
@@ -194,7 +194,16 @@ void PresenterScrollBar::SetThumbPosition (
UpdateBorders();
Repaint(GetRectangle(Total), bAsynchronousUpdate);
- NotifyThumbPositionChange();
+
+ mbIsNotificationActive = true;
+ try
+ {
+ maThumbMotionListener(mnThumbPosition);
+ }
+ catch (Exception&)
+ {
+ }
+ mbIsNotificationActive = false;
}
}
@@ -523,24 +532,6 @@ void PresenterScrollBar::PaintBitmap(
}
}
-void PresenterScrollBar::NotifyThumbPositionChange()
-{
- if ( ! mbIsNotificationActive)
- {
- mbIsNotificationActive = true;
-
- try
- {
- maThumbMotionListener(mnThumbPosition);
- }
- catch (Exception&)
- {
- }
-
- mbIsNotificationActive = false;
- }
-}
-
PresenterScrollBar::Area PresenterScrollBar::GetArea (const double nX, const double nY) const
{
const geometry::RealPoint2D aPoint(nX, nY);
diff --git a/sdext/source/presenter/PresenterScrollBar.hxx b/sdext/source/presenter/PresenterScrollBar.hxx
index 00f8393738fe..7706ce4ea5aa 100644
--- a/sdext/source/presenter/PresenterScrollBar.hxx
+++ b/sdext/source/presenter/PresenterScrollBar.hxx
@@ -214,7 +214,6 @@ protected:
const css::awt::Rectangle& rRepaintBox,
const Area eArea,
const SharedBitmapDescriptor& rpBitmaps);
- void NotifyThumbPositionChange();
void UpdateWidthOrHeight (sal_Int32& rSize,
const SharedBitmapDescriptor& rpDescriptor);
css::uno::Reference<css::rendering::XBitmap> GetBitmap (
diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx
index 60af7c95696c..6237a165f058 100644
--- a/sdext/source/presenter/PresenterSlideShowView.cxx
+++ b/sdext/source/presenter/PresenterSlideShowView.cxx
@@ -814,8 +814,15 @@ void PresenterSlideShowView::PaintInnerWindow (const awt::PaintEvent& rEvent)
pIterator->notifyEach(&awt::XPaintListener::windowPaint, aEvent);
}
- if (mbIsForcedPaintPending)
- ForceRepaint();
+ /** The slide show relies on the back buffer of the canvas not being
+ modified. With a shared canvas there are times when that can not be
+ guaranteed.
+ */
+ if (mbIsForcedPaintPending && mxSlideShow.is() && mbIsViewAdded)
+ {
+ mxSlideShow->removeView(this);
+ impl_addAndConfigureView();
+ }
// Finally, in double buffered environments, request the changes to be
// made visible.
@@ -929,15 +936,6 @@ void PresenterSlideShowView::Resize()
mbIsForcedPaintPending = true;
}
-void PresenterSlideShowView::ForceRepaint()
-{
- if (mxSlideShow.is() && mbIsViewAdded)
- {
- mxSlideShow->removeView(this);
- impl_addAndConfigureView();
- }
-}
-
void PresenterSlideShowView::CreateBackgroundPolygons()
{
const awt::Rectangle aWindowBox (mxWindow->getPosSize());
diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx
index 8f40ebdc6c5c..8e3800b46479 100644
--- a/sdext/source/presenter/PresenterTextView.cxx
+++ b/sdext/source/presenter/PresenterTextView.cxx
@@ -1201,7 +1201,7 @@ PresenterTextParagraph::Line::Line (
void PresenterTextParagraph::Line::ProvideCellBoxes()
{
- if ( ! IsEmpty() && maCellBoxes.getLength()==0)
+ if ( mnLineStartCharacterIndex < mnLineEndCharacterIndex && maCellBoxes.getLength()==0 )
{
if (mxLayoutedLine.is())
maCellBoxes = mxLayoutedLine->queryInkMeasures();
@@ -1231,11 +1231,6 @@ void PresenterTextParagraph::Line::ProvideLayoutedLine (
}
}
-bool PresenterTextParagraph::Line::IsEmpty() const
-{
- return mnLineStartCharacterIndex >= mnLineEndCharacterIndex;
-}
-
} } // end of namespace ::sdext::presenter
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/presenter/PresenterTextView.hxx b/sdext/source/presenter/PresenterTextView.hxx
index 664d65eec71f..b56bd5a85f31 100644
--- a/sdext/source/presenter/PresenterTextView.hxx
+++ b/sdext/source/presenter/PresenterTextView.hxx
@@ -175,7 +175,6 @@ private:
const PresenterTheme::SharedFontDescriptor& rpFont,
const sal_Int8 nTextDirection);
void ProvideCellBoxes();
- bool IsEmpty() const;
};
css::uno::Reference<css::i18n::XBreakIterator> mxBreakIterator;
diff --git a/sdext/source/presenter/PresenterWindowManager.cxx b/sdext/source/presenter/PresenterWindowManager.cxx
index 557b4f94f5dc..2db64ef5eb11 100644
--- a/sdext/source/presenter/PresenterWindowManager.cxx
+++ b/sdext/source/presenter/PresenterWindowManager.cxx
@@ -1111,17 +1111,12 @@ Reference<rendering::XPolyPolygon2D> PresenterWindowManager::CreateClipPolyPolyg
return xPolyPolygon;
}
-
-void PresenterWindowManager::Invalidate()
-{
- mpPresenterController->GetPaintManager()->Invalidate(mxParentWindow);
-}
void PresenterWindowManager::Update()
{
mxClipPolygon = nullptr;
mbIsLayoutPending = true;
- Invalidate();
+ mpPresenterController->GetPaintManager()->Invalidate(mxParentWindow);
}
void PresenterWindowManager::ThrowIfDisposed() const
diff --git a/sdext/source/presenter/PresenterWindowManager.hxx b/sdext/source/presenter/PresenterWindowManager.hxx
index 13115fba4ab7..1724da476515 100644
--- a/sdext/source/presenter/PresenterWindowManager.hxx
+++ b/sdext/source/presenter/PresenterWindowManager.hxx
@@ -193,8 +193,6 @@ private:
void ProvideBackgroundBitmap();
css::uno::Reference<css::rendering::XPolyPolygon2D> CreateClipPolyPolygon() const;
- void Invalidate();
-
void StoreViewMode (const ViewMode eViewMode);
void LayoutStandardMode();