[Libreoffice-commits] core.git: sdext/source

Noel Grandin noel at peralex.com
Mon Jun 27 05:22:20 UTC 2016


 sdext/source/pdfimport/tree/pdfiprocessor.cxx     |    9 ----
 sdext/source/pdfimport/tree/pdfiprocessor.hxx     |    2 
 sdext/source/presenter/PresenterController.cxx    |    6 --
 sdext/source/presenter/PresenterPaneContainer.cxx |    6 --
 sdext/source/presenter/PresenterPaneContainer.hxx |    1 
 sdext/source/presenter/PresenterSprite.cxx        |    3 -
 sdext/source/presenter/PresenterSprite.hxx        |    1 
 sdext/source/presenter/PresenterTextView.cxx      |    5 --
 sdext/source/presenter/PresenterTextView.hxx      |    2 
 sdext/source/presenter/PresenterToolBar.cxx       |   47 +++++-----------------
 10 files changed, 14 insertions(+), 68 deletions(-)

New commits:
commit b1225d201f8c23c75e31e09a0f5e9ff838866776
Author: Noel Grandin <noel at peralex.com>
Date:   Sat Jun 25 18:41:51 2016 +0200

    loplugin:singlevalfields in sdext
    
    Change-Id: I9bf194fb58b3bd37071647a83a629b6782836890
    Reviewed-on: https://gerrit.libreoffice.org/26659
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index 2551bf4..69c9066 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -68,7 +68,6 @@ namespace pdfi
     m_aIdToGC(),
     m_aGCToId(),
     m_aImages(),
-    m_eTextDirection( LrTb ),
     m_nPages(0),
     m_nNextZOrder( 1 ),
     m_xStatusIndicator( xStat ),
@@ -706,13 +705,7 @@ void PDFIProcessor::sortElements( Element* pEle, bool bDeep )
         aChildren.push_back( pEle->Children.front() );
         pEle->Children.pop_front();
     }
-    switch( m_eTextDirection )
-    {
-        case LrTb:
-        default:
-        std::stable_sort( aChildren.begin(), aChildren.end(), lr_tb_sort );
-        break;
-    }
+    std::stable_sort( aChildren.begin(), aChildren.end(), lr_tb_sort );
     int nChildren = aChildren.size();
     for( int i = 0; i < nChildren; i++ )
         pEle->Children.push_back( aChildren[i] );
diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.hxx b/sdext/source/pdfimport/tree/pdfiprocessor.hxx
index 21197bf..672b333 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.hxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.hxx
@@ -191,8 +191,6 @@ namespace pdfi
 
         ImageContainer                     m_aImages;
 
-        DocumentTextDirecion               m_eTextDirection;
-
         sal_Int32                          m_nPages;
         sal_Int32                          m_nNextZOrder;
         css::uno::Reference<
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index b90b396..5a8235c 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -744,12 +744,6 @@ void SAL_CALL PresenterController::notifyConfigurationChange (
                 {
                     PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
                         mpPaneContainer->FindPaneId(xPane->getResourceId()));
-
-                    // When there is a call out anchor location set then tell the
-                    // window about it.
-                    if (pDescriptor->mbHasCalloutAnchor)
-                        pDescriptor->mxPane->SetCalloutAnchor(
-                            pDescriptor->maCalloutAnchorLocation);
                 }
             }
             else if (rEvent.ResourceId->isBoundTo(mxMainPaneId,AnchorBindingMode_INDIRECT))
diff --git a/sdext/source/presenter/PresenterPaneContainer.cxx b/sdext/source/presenter/PresenterPaneContainer.cxx
index 81be293..d226163 100644
--- a/sdext/source/presenter/PresenterPaneContainer.cxx
+++ b/sdext/source/presenter/PresenterPaneContainer.cxx
@@ -95,7 +95,6 @@ void PresenterPaneContainer::PreparePane (
         pDescriptor->maSpriteProvider = PaneDescriptor::SpriteProvider();
         pDescriptor->mbIsSprite = false;
         pDescriptor->maCalloutAnchorLocation = awt::Point(-1,-1);
-        pDescriptor->mbHasCalloutAnchor = false;
 
         maPanes.push_back(pDescriptor);
     }
@@ -135,11 +134,6 @@ PresenterPaneContainer::SharedPaneDescriptor
             pDescriptor->mxPane = rxPane;
             pDescriptor->mxPane->SetTitle(pDescriptor->msTitle);
 
-            // When there is a call out anchor location set then tell the
-            // window about it.
-            if (pDescriptor->mbHasCalloutAnchor)
-                pDescriptor->mxPane->SetCalloutAnchor(pDescriptor->maCalloutAnchorLocation);
-
             if (xWindow.is())
                 xWindow->addEventListener(this);
         }
diff --git a/sdext/source/presenter/PresenterPaneContainer.hxx b/sdext/source/presenter/PresenterPaneContainer.hxx
index 84fb3b5..7e7bc12 100644
--- a/sdext/source/presenter/PresenterPaneContainer.hxx
+++ b/sdext/source/presenter/PresenterPaneContainer.hxx
@@ -104,7 +104,6 @@ public:
         bool mbIsSprite;
         Activator maActivator;
         css::awt::Point maCalloutAnchorLocation;
-        bool mbHasCalloutAnchor;
 
         void SetActivationState (const bool bIsActive);
     };
diff --git a/sdext/source/presenter/PresenterSprite.cxx b/sdext/source/presenter/PresenterSprite.cxx
index 4d3c03e..d38fd58 100644
--- a/sdext/source/presenter/PresenterSprite.cxx
+++ b/sdext/source/presenter/PresenterSprite.cxx
@@ -36,7 +36,6 @@ PresenterSprite::PresenterSprite()
       maSize(0,0),
       maLocation(0,0),
       mbIsVisible(false),
-      mnPriority(0),
       mnAlpha(1.0)
 {
 }
@@ -143,7 +142,7 @@ void PresenterSprite::ProvideSprite()
                 rendering::CompositeOperation::SOURCE)
                 );
             mxSprite->setAlpha(mnAlpha);
-            mxSprite->setPriority(mnPriority);
+            mxSprite->setPriority(0);
             if (mbIsVisible)
                 mxSprite->show();
         }
diff --git a/sdext/source/presenter/PresenterSprite.hxx b/sdext/source/presenter/PresenterSprite.hxx
index 7043f189..c73400f 100644
--- a/sdext/source/presenter/PresenterSprite.hxx
+++ b/sdext/source/presenter/PresenterSprite.hxx
@@ -63,7 +63,6 @@ private:
     css::geometry::RealSize2D maSize;
     css::geometry::RealPoint2D maLocation;
     bool mbIsVisible;
-    double mnPriority;
     double mnAlpha;
 
     void ProvideSprite();
diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx
index 07a1294..8f40ebd 100644
--- a/sdext/source/presenter/PresenterTextView.cxx
+++ b/sdext/source/presenter/PresenterTextView.cxx
@@ -66,7 +66,6 @@ PresenterTextView::PresenterTextView (
     const Reference<rendering::XCanvas>& rxCanvas,
     const ::std::function<void (const css::awt::Rectangle&)>& rInvalidator)
     : mxCanvas(rxCanvas),
-      mbDoOuput(true),
       mxBreakIterator(),
       mxScriptTypeDetector(),
       maLocation(0,0),
@@ -80,7 +79,6 @@ PresenterTextView::PresenterTextView (
       mnLeftOffset(0),
       mnTopOffset(0),
       mbIsFormatPending(false),
-      mnCharacterCount(-1),
       maTextChangeBroadcaster()
 {
     Reference<lang::XMultiComponentFactory> xFactory (
@@ -103,7 +101,6 @@ PresenterTextView::PresenterTextView (
 void PresenterTextView::SetText (const Reference<text::XText>& rxText)
 {
     maParagraphs.clear();
-    mnCharacterCount = -1;
 
     Reference<container::XEnumerationAccess> xParagraphAccess (rxText, UNO_QUERY);
     if ( ! xParagraphAccess.is())
@@ -291,8 +288,6 @@ void PresenterTextView::MoveCaret (
 void PresenterTextView::Paint (
     const css::awt::Rectangle& rUpdateBox)
 {
-    if ( ! mbDoOuput)
-        return;
     if ( ! mxCanvas.is())
         return;
     if ( ! mpFont->PrepareFont(mxCanvas))
diff --git a/sdext/source/presenter/PresenterTextView.hxx b/sdext/source/presenter/PresenterTextView.hxx
index 9a1da80..664d65e 100644
--- a/sdext/source/presenter/PresenterTextView.hxx
+++ b/sdext/source/presenter/PresenterTextView.hxx
@@ -254,7 +254,6 @@ public:
 
 private:
     css::uno::Reference<css::rendering::XCanvas> mxCanvas;
-    bool mbDoOuput;
     css::uno::Reference<css::i18n::XBreakIterator> mxBreakIterator;
     css::uno::Reference<css::i18n::XScriptTypeDetector> mxScriptTypeDetector;
     css::geometry::RealPoint2D maLocation;
@@ -265,7 +264,6 @@ private:
     double mnLeftOffset;
     double mnTopOffset;
     bool mbIsFormatPending;
-    sal_Int32 mnCharacterCount;
     ::std::function<void ()> maTextChangeBroadcaster;
 
     void RequestFormat();
diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx
index e8a8512..a791386 100644
--- a/sdext/source/presenter/PresenterToolBar.cxx
+++ b/sdext/source/presenter/PresenterToolBar.cxx
@@ -264,11 +264,7 @@ namespace {
     {
     public:
         TimeFormatter();
-        OUString FormatTime (const oslDateTime& rTime);
-    private:
-        bool mbIs24HourFormat;
-        bool mbIsAmPmFormat;
-        bool mbIsShowSeconds;
+        static OUString FormatTime (const oslDateTime& rTime);
     };
 
     class TimeLabel : public Label
@@ -306,7 +302,6 @@ namespace {
             const SharedElementMode& rpSelectedMode,
             const SharedElementMode& rpDisabledMode) override;
     private:
-        TimeFormatter maTimeFormatter;
         CurrentTimeLabel (const ::rtl::Reference<PresenterToolBar>& rpToolBar);
         virtual ~CurrentTimeLabel();
         virtual void TimeHasChanged (const oslDateTime& rCurrentTime) override;
@@ -1798,9 +1793,6 @@ geometry::RealRectangle2D Text::GetBoundingBox (const Reference<rendering::XCanv
 //===== TimeFormatter =========================================================
 
 TimeFormatter::TimeFormatter()
-    : mbIs24HourFormat(true),
-      mbIsAmPmFormat(false),
-      mbIsShowSeconds(true)
 {
 }
 
@@ -1812,11 +1804,7 @@ OUString TimeFormatter::FormatTime (const oslDateTime& rTime)
     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::number(nHours));
-    else
-        sText.append(OUString::number(
-            sal::static_int_cast<sal_Int32>(nHours>12 ? nHours-12 : nHours)));
+    sText.append(OUString::number(nHours));
 
     sText.append(":");
 
@@ -1827,21 +1815,11 @@ OUString TimeFormatter::FormatTime (const oslDateTime& rTime)
     sText.append(sMinutes);
 
     // Seconds
-    if (mbIsShowSeconds)
-    {
-        sText.append(":");
-        const OUString sSeconds (OUString::number(nSeconds));
-        if (sSeconds.getLength() == 1)
-            sText.append("0");
-        sText.append(sSeconds);
-    }
-    if (mbIsAmPmFormat)
-    {
-        if (rTime.Hours < 12)
-            sText.append("am");
-        else
-            sText.append("pm");
-    }
+    sText.append(":");
+    const OUString sSeconds (OUString::number(nSeconds));
+    if (sSeconds.getLength() == 1)
+        sText.append("0");
+    sText.append(sSeconds);
     return sText.makeStringAndClear();
 }
 
@@ -1881,14 +1859,13 @@ CurrentTimeLabel::~CurrentTimeLabel()
 
 CurrentTimeLabel::CurrentTimeLabel (
     const ::rtl::Reference<PresenterToolBar>& rpToolBar)
-    : TimeLabel(rpToolBar),
-      maTimeFormatter()
+    : TimeLabel(rpToolBar)
 {
 }
 
 void CurrentTimeLabel::TimeHasChanged (const oslDateTime& rCurrentTime)
 {
-    SetText(maTimeFormatter.FormatTime(rCurrentTime));
+    SetText(TimeFormatter::FormatTime(rCurrentTime));
     Invalidate(false);
 }
 
@@ -1899,7 +1876,7 @@ void CurrentTimeLabel::SetModes (
     const SharedElementMode& rpDisabledMode)
 {
     TimeLabel::SetModes(rpNormalMode, rpMouseOverMode, rpSelectedMode, rpDisabledMode);
-    SetText(maTimeFormatter.FormatTime(PresenterClockTimer::GetCurrentTime()));
+    SetText(TimeFormatter::FormatTime(PresenterClockTimer::GetCurrentTime()));
 }
 
 //===== PresentationTimeLabel =================================================
@@ -1956,7 +1933,7 @@ void PresentationTimeLabel::TimeHasChanged (const oslDateTime& rCurrentTime)
         oslDateTime aElapsedDateTime;
         if (osl_getDateTimeFromTimeValue(&aElapsedTimeValue, &aElapsedDateTime))
         {
-            SetText(maTimeFormatter.FormatTime(aElapsedDateTime));
+            SetText(TimeFormatter::FormatTime(aElapsedDateTime));
             Invalidate(false);
         }
     }
@@ -1973,7 +1950,7 @@ void PresentationTimeLabel::SetModes (
     oslDateTime aStartDateTime;
     if (osl_getDateTimeFromTimeValue(&maStartTimeValue, &aStartDateTime))
     {
-        SetText(maTimeFormatter.FormatTime(aStartDateTime));
+        SetText(TimeFormatter::FormatTime(aStartDateTime));
     }
 }
 


More information about the Libreoffice-commits mailing list