include/tools/gen.hxx                      |   10 +---------
 sfx2/source/control/recentdocsviewitem.cxx |    3 +--
 tools/source/generic/gen.cxx               |   15 +++++++++++++++
 3 files changed, 17 insertions(+), 11 deletions(-)

New commits:
commit 31bd8c4a4a4752dcff12ee35636193f79a6d6137
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Jul 8 14:50:12 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Jul 8 21:29:01 2019 +0200

    no need to use AlphaMask in RecentDocsViewItem
    
    since it's purely opaque
    
    Change-Id: Id9df52f860946cfd4c30c406d5748224a2a4f4df
    Reviewed-on: https://gerrit.libreoffice.org/75226
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index 85d84ddc699d..908a679a5629 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -91,8 +91,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView 
&rView, const OUStri
         }
 
         // create empty, and copy the default thumbnail in
-        sal_uInt8 nAlpha = 255;
-        aThumbnail = BitmapEx(Bitmap(aThumbnailSize, 24), 
AlphaMask(aThumbnailSize, &nAlpha));
+        aThumbnail = BitmapEx(aThumbnailSize, 24);
 
         aThumbnail.CopyPixel(
                 ::tools::Rectangle(Point((aThumbnailSize.Width() - 
aExtSize.Width()) / 2, (aThumbnailSize.Height() - aExtSize.Height()) / 2), 
aExtSize),
commit 9e8c6c81f2f5d3df850353ee92a5b6e52546d6c6
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Jul 8 16:40:05 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Jul 8 21:28:49 2019 +0200

    make tools::Rectangle::expandBy respect empty state
    
    and make non-inline so it is easy to disable this for debugging, if need
    be
    
    Change-Id: Ib383bb990ddcd835ff37e98893e44156287e0488
    Reviewed-on: https://gerrit.libreoffice.org/75227
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index 0d9a81ebdcee..56af47582a7f 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -470,7 +470,7 @@ public:
     /**
      * Expands the rectangle in all directions by the input value.
      */
-    inline void expand(long nExpandBy);
+    void expand(long nExpandBy);
     inline void shrink(long nShrinkBy);
 
     /**
@@ -722,14 +722,6 @@ inline Rectangle operator - ( const Rectangle& rRect, 
const Point& rPt )
 }
 }
 
-inline void tools::Rectangle::expand(long nExpandBy)
-{
-    nLeft   -= nExpandBy;
-    nTop    -= nExpandBy;
-    nRight  += nExpandBy;
-    nBottom += nExpandBy;
-}
-
 inline void tools::Rectangle::shrink(long nShrinkBy)
 {
     nLeft   += nShrinkBy;
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 3593801579ac..53bb2680c5c8 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -233,4 +233,19 @@ OString tools::Rectangle::toString() const
     return ss.str().c_str();
 }
 
+void tools::Rectangle::expand(long nExpandBy)
+{
+    nLeft   -= nExpandBy;
+    nTop    -= nExpandBy;
+    if (nRight == RECT_EMPTY)
+        nRight = nLeft + nExpandBy - 1;
+    else
+        nRight += nExpandBy;
+    if (nBottom == RECT_EMPTY)
+        nBottom = nTop + nExpandBy - 1;
+    else
+        nBottom += nExpandBy;
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to