[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 13 11:19:18 UTC 2018


 include/sfx2/thumbnailview.hxx        |    3 ---
 sfx2/source/appl/fileobj.cxx          |    7 +++----
 sfx2/source/appl/fileobj.hxx          |    1 -
 sfx2/source/control/thumbnailview.cxx |   34 +++++++++++++---------------------
 sfx2/source/dialog/filedlghelper.cxx  |    3 +--
 sfx2/source/dialog/filedlgimpl.hxx    |    1 -
 6 files changed, 17 insertions(+), 32 deletions(-)

New commits:
commit 8709c643136eed67bc8f04ab9465b4a76085747c
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Nov 13 11:20:11 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Nov 13 12:18:55 2018 +0100

    loplugin:singlevalfields in sfx2
    
    Change-Id: I91c092783facc22b6e580631252e7b2dbd80d511
    Reviewed-on: https://gerrit.libreoffice.org/63323
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 2ea319b36c3d..238004cdc67b 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -300,12 +300,9 @@ protected:
     long mnVisLines;
     long mnLines;
 
-    int mnFineness;
-
     sal_uInt16 mnCols;
     sal_uInt16 mnFirstLine;
     bool mbScroll : 1;
-    bool mbIsTransientChildrenDisabled : 1;
     bool mbHasVisibleItems : 1;
     bool mbShowTooltips : 1;
     bool mbIsMultiSelectionEnabled: 1;
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index 7032dce1e1bc..7d0cffb21b78 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -54,7 +54,6 @@ SvFileObject::SvFileObject()
     , bSynchron(false)
     , bLoadError(false)
     , bWaitForData(false)
-    , bInNewData(false)
     , bDataReady(false)
     , bClearMedium(false)
     , bStateChangeCalled(false)
@@ -169,7 +168,7 @@ bool SvFileObject::LoadFile_Impl()
 
     if( !bSynchron )
     {
-        bLoadAgain = bDataReady = bInNewData = false;
+        bLoadAgain = bDataReady = false;
         bWaitForData = true;
 
         tools::SvRef<SfxMedium> xTmpMed = xMed;
@@ -182,7 +181,7 @@ bool SvFileObject::LoadFile_Impl()
     }
 
     bWaitForData = true;
-    bDataReady = bInNewData = false;
+    bDataReady = false;
     xMed->Download();
     bLoadAgain = !xMed->IsRemote();
     bWaitForData = false;
@@ -326,7 +325,7 @@ IMPL_LINK_NOARG( SvFileObject, LoadGrfReady_Impl, void*, void )
     bLoadError = false;
     bWaitForData = false;
 
-    if( !bInNewData && !bDataReady )
+    if( !bDataReady )
     {
         // Graphic is finished, also send DataChanged from Status change
         bDataReady = true;
diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx
index b08cd29e477c..eca397aca82b 100644
--- a/sfx2/source/appl/fileobj.hxx
+++ b/sfx2/source/appl/fileobj.hxx
@@ -42,7 +42,6 @@ class SvFileObject : public sfx2::SvLinkSource
     bool bSynchron : 1;
     bool bLoadError : 1;
     bool bWaitForData : 1;
-    bool bInNewData : 1;
     bool bDataReady : 1;
     bool bClearMedium : 1;
     bool bStateChangeCalled : 1;
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 45514d7b1681..0cee2cb06130 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -49,12 +49,13 @@ using namespace basegfx::utils;
 using namespace drawinglayer::attribute;
 using namespace drawinglayer::primitive2d;
 
+constexpr int gnFineness = 5;
+
 ThumbnailView::ThumbnailView (vcl::Window *pParent, WinBits nWinStyle)
     : Control( pParent, nWinStyle )
     , mpItemAttrs(new ThumbnailItemAttributes)
 {
     ImplInit();
-    mbIsTransientChildrenDisabled = false;
 }
 
 ThumbnailView::~ThumbnailView()
@@ -130,7 +131,6 @@ void ThumbnailView::ImplInit()
     mnItemPadding = 0;
     mnVisLines = 0;
     mnLines = 0;
-    mnFineness = 5;
     mnFirstLine = 0;
     mnCols = 0;
     mbScroll = false;
@@ -174,7 +174,7 @@ void ThumbnailView::ImplDeleteItems()
         {
             css::uno::Any aOldAny, aNewAny;
 
-            aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
+            aOldAny <<= pItem->GetAccessible( false );
             ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
         }
 
@@ -224,7 +224,7 @@ void ThumbnailView::OnItemDblClicked (ThumbnailViewItem*)
 
 css::uno::Reference< css::accessibility::XAccessible > ThumbnailView::CreateAccessible()
 {
-    return new ThumbnailViewAcc( this, mbIsTransientChildrenDisabled );
+    return new ThumbnailViewAcc( this, false );
 }
 
 void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
@@ -345,7 +345,7 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
                 {
                     css::uno::Any aOldAny, aNewAny;
 
-                    aNewAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
+                    aNewAny <<= pItem->GetAccessible( false );
                     ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
                 }
 
@@ -373,7 +373,7 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
                 {
                     css::uno::Any aOldAny, aNewAny;
 
-                    aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
+                    aOldAny <<= pItem->GetAccessible( false );
                     ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
                 }
 
@@ -400,10 +400,10 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
         Size aSize( nScrBarWidth, aWinSize.Height() );
 
         mpScrBar->SetPosSizePixel( aPos, aSize );
-        mpScrBar->SetRangeMax( (nCurCount+mnCols-1)*mnFineness/mnCols);
+        mpScrBar->SetRangeMax( (nCurCount+mnCols-1)*gnFineness/mnCols);
         mpScrBar->SetVisibleSize( mnVisLines );
         if (!bScrollBarUsed)
-            mpScrBar->SetThumbPos( static_cast<long>(mnFirstLine)*mnFineness );
+            mpScrBar->SetThumbPos( static_cast<long>(mnFirstLine)*gnFineness );
         long nPageSize = mnVisLines;
         if ( nPageSize < 1 )
             nPageSize = 1;
@@ -1100,22 +1100,14 @@ void ThumbnailView::SelectItem( sal_uInt16 nItemId )
         if( ImplHasAccessibleListeners() )
         {
             // focus event (select)
-            ThumbnailViewItemAcc* pItemAcc = ThumbnailViewItemAcc::getImplementation( pItem->GetAccessible( mbIsTransientChildrenDisabled ) );
+            ThumbnailViewItemAcc* pItemAcc = ThumbnailViewItemAcc::getImplementation( pItem->GetAccessible( false ) );
 
             if( pItemAcc )
             {
                 css::uno::Any aOldAny, aNewAny;
-                if( !mbIsTransientChildrenDisabled )
-                {
-                    aNewAny <<= css::uno::Reference< css::uno::XInterface >(
-                        static_cast< ::cppu::OWeakObject* >( pItemAcc ));
-                    ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny );
-                }
-                else
-                {
-                    aNewAny <<= css::accessibility::AccessibleStateType::FOCUSED;
-                    pItemAcc->FireAccessibleEvent( css::accessibility::AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
-                }
+                aNewAny <<= css::uno::Reference< css::uno::XInterface >(
+                    static_cast< ::cppu::OWeakObject* >( pItemAcc ));
+                ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny );
             }
 
             // selection event
@@ -1194,7 +1186,7 @@ void ThumbnailView::filterItems(const std::function<bool (const ThumbnailViewIte
                 {
                     css::uno::Any aOldAny, aNewAny;
 
-                    aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
+                    aOldAny <<= pItem->GetAccessible( false );
                     ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
                 }
 
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 9784a268c39c..d0e885c506fa 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -894,7 +894,6 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
     mbHasPassword           = false;
     m_bHaveFilterOptions    = false;
     mbIsPwdEnabled          = true;
-    mbIsGpgEnabled          = true;
     mbHasVersions           = false;
     mbHasPreview            = false;
     mbShowPreview           = false;
@@ -1527,7 +1526,7 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList,
             catch( const IllegalArgumentException& ){}
         }
         // check, whether or not we have to display a key selection box
-        if ( pCurrentFilter && mbHasPassword && mbIsGpgEnabled && xCtrlAccess.is() )
+        if ( pCurrentFilter && mbHasPassword && xCtrlAccess.is() )
         {
             try
             {
diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx
index f2313ebff134..23830ddcad84 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -76,7 +76,6 @@ namespace sfx2
 
         bool                    mbHasPassword           : 1;
         bool                    mbIsPwdEnabled          : 1;
-        bool                    mbIsGpgEnabled          : 1;
         bool                    m_bHaveFilterOptions    : 1;
         bool                    mbHasVersions           : 1;
         bool                    mbHasAutoExt            : 1;


More information about the Libreoffice-commits mailing list