[Libreoffice-commits] core.git: sd/inc sd/source

Noel Grandin noel at peralex.com
Tue Apr 5 07:15:28 UTC 2016


 sd/inc/sdpage.hxx                                      |    2 -
 sd/source/core/sdpage.cxx                              |   24 ++++++++---------
 sd/source/ui/dlg/masterlayoutdlg.cxx                   |    2 -
 sd/source/ui/inc/PreviewRenderer.hxx                   |   14 ++-------
 sd/source/ui/sidebar/MasterPageContainerProviders.cxx  |    3 --
 sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx |   13 ---------
 sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx |    3 --
 sd/source/ui/slidesorter/cache/SlsPageCache.cxx        |    2 -
 sd/source/ui/tools/PreviewRenderer.cxx                 |    7 +---
 9 files changed, 23 insertions(+), 47 deletions(-)

New commits:
commit b8c528a3515616bf0ec852c2f7b1bb07dc9f7ed2
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Apr 4 15:34:03 2016 +0200

    loplugin:constantparam in sd
    
    Change-Id: Ife610abb1f8ed19ab219301d41d7fc2174ff1d29
    Reviewed-on: https://gerrit.libreoffice.org/23830
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 2427a5c..46d47b9 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -172,7 +172,7 @@ public:
 
     void EnsureMasterPageDefaultBackground();
     SdrObject*      CreatePresObj(PresObjKind eObjKind, bool bVertical, const Rectangle& rRect, bool bInsert=false);
-    SdrObject*      CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert);
+    SdrObject*      CreateDefaultPresObj(PresObjKind eObjKind);
     void            DestroyDefaultPresObj(PresObjKind eObjKind);
     SdrObject*      GetPresObj(PresObjKind eObjKind, int nIndex = 1, bool bFuzzySearch = false );
     PresObjKind     GetPresObjKind(SdrObject* pObj) const;
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index a4a6c65..55c779c 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -820,11 +820,11 @@ void SdPage::CreateTitleAndLayout(bool bInit, bool bCreate )
         {
             SdrObject* pMasterTitle = pMasterPage->GetPresObj( PRESOBJ_TITLE );
             if( pMasterTitle == nullptr )
-                pMasterPage->CreateDefaultPresObj(PRESOBJ_TITLE, true);
+                pMasterPage->CreateDefaultPresObj(PRESOBJ_TITLE);
 
             SdrObject* pMasterOutline = pMasterPage->GetPresObj( mePageKind==PK_NOTES ? PRESOBJ_NOTES : PRESOBJ_OUTLINE );
             if( pMasterOutline == nullptr )
-                pMasterPage->CreateDefaultPresObj( mePageKind == PK_STANDARD ? PRESOBJ_OUTLINE : PRESOBJ_NOTES, true );
+                pMasterPage->CreateDefaultPresObj( mePageKind == PK_STANDARD ? PRESOBJ_OUTLINE : PRESOBJ_NOTES );
         }
 
         // create header&footer objects
@@ -835,20 +835,20 @@ void SdPage::CreateTitleAndLayout(bool bInit, bool bCreate )
             {
                 SdrObject* pHeader = pMasterPage->GetPresObj( PRESOBJ_HEADER );
                 if( pHeader == nullptr )
-                    pMasterPage->CreateDefaultPresObj( PRESOBJ_HEADER, true );
+                    pMasterPage->CreateDefaultPresObj( PRESOBJ_HEADER );
             }
 
             SdrObject* pDate   = pMasterPage->GetPresObj( PRESOBJ_DATETIME );
             if( pDate == nullptr )
-                pMasterPage->CreateDefaultPresObj( PRESOBJ_DATETIME, true );
+                pMasterPage->CreateDefaultPresObj( PRESOBJ_DATETIME );
 
             SdrObject* pFooter = pMasterPage->GetPresObj( PRESOBJ_FOOTER );
             if( pFooter == nullptr )
-                pMasterPage->CreateDefaultPresObj( PRESOBJ_FOOTER, true );
+                pMasterPage->CreateDefaultPresObj( PRESOBJ_FOOTER );
 
             SdrObject* pNumber = pMasterPage->GetPresObj( PRESOBJ_SLIDENUMBER );
             if( pNumber == nullptr )
-                pMasterPage->CreateDefaultPresObj( PRESOBJ_SLIDENUMBER, true );
+                pMasterPage->CreateDefaultPresObj( PRESOBJ_SLIDENUMBER );
         }
     }
 }
@@ -932,23 +932,23 @@ void getPresObjProp( const SdPage& rPage, const char* sObjKind, const char* sPag
 
 }
 
-SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert)
+SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind)
 {
 
     if( eObjKind == PRESOBJ_TITLE )
     {
         Rectangle aTitleRect( GetTitleRect() );
-        return CreatePresObj(PRESOBJ_TITLE, false, aTitleRect, bInsert);
+        return CreatePresObj(PRESOBJ_TITLE, false, aTitleRect, true/*bInsert*/);
     }
     else if( eObjKind == PRESOBJ_OUTLINE )
     {
         Rectangle aLayoutRect( GetLayoutRect() );
-        return CreatePresObj( PRESOBJ_OUTLINE, false, aLayoutRect, bInsert);
+        return CreatePresObj( PRESOBJ_OUTLINE, false, aLayoutRect, true/*bInsert*/);
     }
     else if( eObjKind == PRESOBJ_NOTES )
     {
         Rectangle aLayoutRect( GetLayoutRect() );
-        return CreatePresObj( PRESOBJ_NOTES, false, aLayoutRect, bInsert);
+        return CreatePresObj( PRESOBJ_NOTES, false, aLayoutRect, true/*bInsert*/);
     }
     else if( (eObjKind == PRESOBJ_FOOTER) || (eObjKind == PRESOBJ_DATETIME) || (eObjKind == PRESOBJ_SLIDENUMBER) || (eObjKind == PRESOBJ_HEADER ) )
     {
@@ -981,7 +981,7 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert)
             else
             {
                 Rectangle aRect( aPos, aSize );
-                return CreatePresObj( eObjKind, false, aRect, bInsert );
+                return CreatePresObj( eObjKind, false, aRect, true/*bInsert*/ );
             }
         }
         else
@@ -1008,7 +1008,7 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert)
                 aPos.Y() = aPosition.Y() + long( aPageSize.Height() - NOTES_HEADER_FOOTER_HEIGHT );
 
             Rectangle aRect( aPos, aSize );
-            return CreatePresObj( eObjKind, false, aRect, bInsert );
+            return CreatePresObj( eObjKind, false, aRect, true/*bInsert*/ );
         }
     }
     else
diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx b/sd/source/ui/dlg/masterlayoutdlg.cxx
index 07d04fd..e49bc33 100644
--- a/sd/source/ui/dlg/masterlayoutdlg.cxx
+++ b/sd/source/ui/dlg/masterlayoutdlg.cxx
@@ -138,7 +138,7 @@ void MasterLayoutDialog::applyChanges()
 
 void MasterLayoutDialog::create(PresObjKind eKind)
 {
-    mpCurrentPage->CreateDefaultPresObj(eKind, true);
+    mpCurrentPage->CreateDefaultPresObj(eKind);
 }
 
 void MasterLayoutDialog::remove( PresObjKind eKind )
diff --git a/sd/source/ui/inc/PreviewRenderer.hxx b/sd/source/ui/inc/PreviewRenderer.hxx
index 6920109..af23ec4 100644
--- a/sd/source/ui/inc/PreviewRenderer.hxx
+++ b/sd/source/ui/inc/PreviewRenderer.hxx
@@ -65,21 +65,13 @@ public:
             When the actual preview can not be created for some reason, then
             this text is painted in an empty rectangle of the requested size
             instead.
-        @param bObeyHighContrastMode
-            When <FALSE/> then the high contrast mode of the application is
-            ignored and the preview is rendered in normal mode.  When
-            <TRUE/> and high contrast mode is active then the preview is
-            rendered in high contrast mode.
-        @param bDisplayPresentationObjects
-            When <FALSE/> then the PresObj place holders are not displayed
-            in the returned preview.
+         The high contrast mode of the application is
+         ignored and the preview is rendered in normal mode.
     */
     Image RenderPage (
         const SdPage* pPage,
         const sal_Int32 nWidth,
-        const OUString& sSubstitutionText,
-        const bool bObeyHighContrastMode = true,
-        const bool bDisplayPresentationObjects = true);
+        const OUString& sSubstitutionText);
 
     /** Render a page with the given pixel size.
         @param pPage
diff --git a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx
index 709f9a0..3bec4c2 100644
--- a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx
@@ -58,8 +58,7 @@ Image PagePreviewProvider::operator () (
         aPreview = rRenderer.RenderPage(
             pPage,
             nWidth,
-            OUString(),
-            false);
+            OUString());
     }
 
     return aPreview;
diff --git a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
index ca34385..ec5e6fb 100644
--- a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
@@ -141,24 +141,13 @@ Bitmap GenericPageCache::GetPreviewBitmap (
 }
 
 Bitmap GenericPageCache::GetMarkedPreviewBitmap (
-    const CacheKey aKey,
-    const bool bResize)
+    const CacheKey aKey)
 {
     OSL_ASSERT(aKey != nullptr);
 
     ProvideCacheAndProcessor();
     const SdrPage* pPage = mpCacheContext->GetPage(aKey);
     Bitmap aMarkedPreview (mpBitmapCache->GetMarkedBitmap(pPage));
-    const Size aBitmapSize (aMarkedPreview.GetSizePixel());
-    if (bResize && aBitmapSize != maPreviewSize)
-    {
-        // Scale the bitmap to the desired size when that is possible,
-        // i.e. the bitmap is not empty.
-        if (aBitmapSize.Width()>0 && aBitmapSize.Height()>0)
-        {
-            aMarkedPreview.Scale(maPreviewSize);
-        }
-    }
 
     return aMarkedPreview;
 }
diff --git a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx
index 91e8a9f..f440450 100644
--- a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx
+++ b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx
@@ -81,8 +81,7 @@ public:
         const CacheKey aKey,
         const bool bResize);
     Bitmap GetMarkedPreviewBitmap (
-        const CacheKey aKey,
-        const bool bResize);
+        const CacheKey aKey);
     void SetMarkedPreviewBitmap (
         const CacheKey aKey,
         const Bitmap& rMarkedBitmap);
diff --git a/sd/source/ui/slidesorter/cache/SlsPageCache.cxx b/sd/source/ui/slidesorter/cache/SlsPageCache.cxx
index b10dbd6..1efb875 100644
--- a/sd/source/ui/slidesorter/cache/SlsPageCache.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsPageCache.cxx
@@ -62,7 +62,7 @@ Bitmap PageCache::GetPreviewBitmap (
 Bitmap PageCache::GetMarkedPreviewBitmap (
     const CacheKey aKey)
 {
-    return mpImplementation->GetMarkedPreviewBitmap(aKey, false/*bResize*/);
+    return mpImplementation->GetMarkedPreviewBitmap(aKey);
 }
 
 void PageCache::SetMarkedPreviewBitmap (
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index 5c6af24..bfa61b6 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -92,9 +92,7 @@ PreviewRenderer::~PreviewRenderer()
 Image PreviewRenderer::RenderPage (
     const SdPage* pPage,
     const sal_Int32 nWidth,
-    const OUString& rSubstitutionText,
-    const bool bObeyHighContrastMode,
-    const bool bDisplayPresentationObjects)
+    const OUString& rSubstitutionText)
 {
     if (pPage != nullptr)
     {
@@ -108,8 +106,7 @@ Image PreviewRenderer::RenderPage (
             pPage,
             Size(nWidth,nHeight),
             rSubstitutionText,
-            bObeyHighContrastMode,
-            bDisplayPresentationObjects);
+            false/*bObeyHighContrastMode*/);
     }
     else
         return Image();


More information about the Libreoffice-commits mailing list