[Libreoffice-commits] core.git: 2 commits - cui/source extensions/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 8 14:02:50 UTC 2019
cui/source/tabpages/backgrnd.cxx | 16 ++++++++--------
extensions/source/scanner/sanedlg.cxx | 8 ++++----
2 files changed, 12 insertions(+), 12 deletions(-)
New commits:
commit 3eeb5e19e73978b394d2610b776fbc7efbfa0c26
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 8 12:18:42 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 8 16:02:01 2019 +0200
use BitmapEx in BackgroundPreviewImpl
Change-Id: Iecbb528c526389d7eed0205c06a21c3cd0753644
Reviewed-on: https://gerrit.libreoffice.org/75211
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 1bec48871dfb..5b70f37d88e0 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -117,7 +117,7 @@ public:
void setBmp(bool bBmp);
void NotifyChange(const Color& rColor);
- void NotifyChange(const Bitmap* pBitmap);
+ void NotifyChange(const BitmapEx* pBitmap);
void SetFillColor(const Color& rColor) { aColor = rColor; }
protected:
@@ -130,7 +130,7 @@ private:
void recalcDrawPos();
bool bIsBmp;
- std::unique_ptr<Bitmap> pBitmap;
+ std::unique_ptr<BitmapEx> pBitmap;
Point aDrawPos;
Size aDrawSize;
::tools::Rectangle aDrawRect;
@@ -168,14 +168,14 @@ void BackgroundPreviewImpl::NotifyChange( const Color& rColor )
}
}
-void BackgroundPreviewImpl::NotifyChange( const Bitmap* pNewBitmap )
+void BackgroundPreviewImpl::NotifyChange( const BitmapEx* pNewBitmap )
{
if (bIsBmp && (pNewBitmap || pBitmap))
{
if (pNewBitmap && pBitmap)
*pBitmap = *pNewBitmap;
else if (pNewBitmap && !pBitmap)
- pBitmap.reset( new Bitmap(*pNewBitmap) );
+ pBitmap.reset( new BitmapEx(*pNewBitmap) );
else if (!pNewBitmap)
pBitmap.reset();
@@ -248,7 +248,7 @@ void BackgroundPreviewImpl::Paint(vcl::RenderContext& rRenderContext, const ::to
if (bIsBmp)
{
if (pBitmap)
- rRenderContext.DrawBitmap(aDrawPos, aDrawSize, *pBitmap);
+ rRenderContext.DrawBitmapEx(aDrawPos, aDrawSize, *pBitmap);
else
{
Size aSize(GetOutputSizePixel());
@@ -998,7 +998,7 @@ IMPL_LINK(SvxBackgroundTabPage, FileClickHdl_Impl, weld::ToggleButton&, rBox, vo
if ( bIsGraphicValid )
{
- Bitmap aBmp = aBgdGraphic.GetBitmapEx().GetBitmap();
+ BitmapEx aBmp = aBgdGraphic.GetBitmapEx();
m_xPreview2->NotifyChange( &aBmp );
}
else
@@ -1106,7 +1106,7 @@ IMPL_LINK( SvxBackgroundTabPage, LoadIdleHdl_Impl, Timer*, pIdle, void )
if (m_xBtnPreview->get_active() && bIsGraphicValid)
{
- Bitmap aBmp = aBgdGraphic.GetBitmapEx().GetBitmap();
+ BitmapEx aBmp = aBgdGraphic.GetBitmapEx();
m_xPreview2->NotifyChange( &aBmp );
}
else
@@ -1317,7 +1317,7 @@ void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr,
if (m_xBtnPreview->get_active() && bIsGraphicValid)
{
- Bitmap aBmp = aBgdGraphic.GetBitmapEx().GetBitmap();
+ BitmapEx aBmp = aBgdGraphic.GetBitmapEx();
m_xPreview2->NotifyChange( &aBmp );
}
else
commit 5a60a01af104b48aa9569ecb6204c865db74df9e
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 8 12:22:51 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 8 16:01:52 2019 +0200
use BitmapEx in ScanPreview
Change-Id: Ief3dc627ad0e0096eb8d3ef4dc4e538fa34cb703
Reviewed-on: https://gerrit.libreoffice.org/75212
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 2f9d710a41e7..0a7bdb2565c3 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -75,7 +75,7 @@ private:
enum DragDirection { TopLeft, Top, TopRight, Right, BottomRight, Bottom,
BottomLeft, Left };
- Bitmap maPreviewBitmap;
+ BitmapEx maPreviewBitmapEx;
tools::Rectangle maPreviewRect;
Point maTopLeft, maBottomRight;
Point maMinTopLeft, maMaxBottomRight;
@@ -193,7 +193,7 @@ public:
void UpdatePreviewBounds();
void SetBitmap(SvStream &rStream)
{
- ReadDIB(maPreviewBitmap, rStream, true);
+ ReadDIBBitmapEx(maPreviewBitmapEx, rStream, true);
}
virtual Size GetOptimalSize() const override
{
@@ -928,7 +928,7 @@ void ScanPreview::UpdatePreviewBounds()
}
else
{
- Size aBMSize( maPreviewBitmap.GetSizePixel() );
+ Size aBMSize( maPreviewBitmapEx.GetSizePixel() );
if( aBMSize.Width() > aBMSize.Height() && aBMSize.Width() )
{
int nVHeight = (maBottomRight.X() - maTopLeft.X()) * aBMSize.Height() / aBMSize.Width();
@@ -956,7 +956,7 @@ void ScanPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang
Size(PREVIEW_WIDTH, PREVIEW_HEIGHT)));
rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel));
// check for sane values
- rRenderContext.DrawBitmap(maPreviewRect.TopLeft(), maPreviewRect.GetSize(), maPreviewBitmap);
+ rRenderContext.DrawBitmapEx(maPreviewRect.TopLeft(), maPreviewRect.GetSize(), maPreviewBitmapEx);
mbDragDrawn = false;
DrawDrag(rRenderContext);
More information about the Libreoffice-commits
mailing list