loplugin:constantparam in sd

Change-Id: Ife610abb1f8ed19ab219301d41d7fc2174ff1d29
Reviewed-on: https://gerrit.libreoffice.org/23830
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin
2016-04-04 15:34:03 +02:00
committed by Noel Grandin
parent 5334ff287c
commit b8c528a351
9 changed files with 23 additions and 47 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -138,7 +138,7 @@ void MasterLayoutDialog::applyChanges()
void MasterLayoutDialog::create(PresObjKind eKind)
{
mpCurrentPage->CreateDefaultPresObj(eKind, true);
mpCurrentPage->CreateDefaultPresObj(eKind);
}
void MasterLayoutDialog::remove( PresObjKind eKind )

View File

@@ -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

View File

@@ -58,8 +58,7 @@ Image PagePreviewProvider::operator () (
aPreview = rRenderer.RenderPage(
pPage,
nWidth,
OUString(),
false);
OUString());
}
return aPreview;

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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 (

View File

@@ -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();