Author: alg
Date: Fri Dec 7 18:15:12 2012
New Revision: 1418421
URL: http://svn.apache.org/viewvc?rev=1418421&view=rev
Log:
#121445# Added transparency support to the gallery
Modified:
openoffice/trunk/main/extras/source/gallery/gallery_system/sg1.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg1.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg10.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg10.sdv
openoffice/trunk/main/extras/source/gallery/gallery_system/sg10.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg11.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg11.sdv
openoffice/trunk/main/extras/source/gallery/gallery_system/sg11.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg12.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg12.sdv
openoffice/trunk/main/extras/source/gallery/gallery_system/sg12.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg13.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg13.sdv
openoffice/trunk/main/extras/source/gallery/gallery_system/sg13.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg14.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg14.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg15.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg15.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg16.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg16.sdv
openoffice/trunk/main/extras/source/gallery/gallery_system/sg16.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg17.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg17.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg18.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg18.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg19.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg19.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg2.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg2.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg24.sdv
openoffice/trunk/main/extras/source/gallery/gallery_system/sg3.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg3.sdv
openoffice/trunk/main/extras/source/gallery/gallery_system/sg3.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg36.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg36.sdv
openoffice/trunk/main/extras/source/gallery/gallery_system/sg36.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg4.sdg
openoffice/trunk/main/extras/source/gallery/gallery_system/sg4.thm
openoffice/trunk/main/extras/source/gallery/gallery_system/sg9.sdv
openoffice/trunk/main/svx/inc/galobj.hxx
openoffice/trunk/main/svx/inc/galtheme.hrc
openoffice/trunk/main/svx/inc/svx/fontworkgallery.hxx
openoffice/trunk/main/svx/inc/svx/gallery.hxx
openoffice/trunk/main/svx/inc/svx/galtheme.hxx
openoffice/trunk/main/svx/source/gallery2/galctrl.cxx
openoffice/trunk/main/svx/source/gallery2/galexpl.cxx
openoffice/trunk/main/svx/source/gallery2/galobj.cxx
openoffice/trunk/main/svx/source/gallery2/galtheme.cxx
openoffice/trunk/main/svx/source/gallery2/galtheme.src
openoffice/trunk/main/svx/source/tbxctrls/fontworkgallery.cxx
openoffice/trunk/main/vcl/inc/vcl/outdev.hxx
openoffice/trunk/main/vcl/source/gdi/outdev6.cxx
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg1.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg1.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg1.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg1.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg10.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg10.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg10.sdv
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg10.sdv?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg10.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg10.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg11.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg11.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg11.sdv
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg11.sdv?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg11.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg11.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg12.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg12.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg12.sdv
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg12.sdv?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg12.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg12.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg13.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg13.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg13.sdv
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg13.sdv?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg13.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg13.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg14.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg14.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg14.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg14.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg15.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg15.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg15.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg15.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg16.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg16.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg16.sdv
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg16.sdv?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg16.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg16.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg17.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg17.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg17.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg17.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg18.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg18.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg18.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg18.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg19.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg19.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg19.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg19.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg2.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg2.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg2.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg2.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg24.sdv
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg24.sdv?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg3.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg3.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg3.sdv
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg3.sdv?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg3.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg3.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg36.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg36.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg36.sdv
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg36.sdv?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg36.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg36.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg4.sdg
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg4.sdg?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg4.thm
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg4.thm?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/extras/source/gallery/gallery_system/sg9.sdv
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/extras/source/gallery/gallery_system/sg9.sdv?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
Binary files - no diff available.
Modified: openoffice/trunk/main/svx/inc/galobj.hxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/inc/galobj.hxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/inc/galobj.hxx (original)
+++ openoffice/trunk/main/svx/inc/galobj.hxx Fri Dec 7 18:15:12 2012
@@ -74,7 +74,7 @@ private:
protected:
- Bitmap aThumbBmp;
+ BitmapEx aThumbBmp; // Allow
transparence to survive
GDIMetaFile aThumbMtf;
INetURLObject aURL;
String aUserName;
@@ -95,7 +95,7 @@ public:
virtual SgaObjKind GetObjKind() const = 0;
virtual sal_uInt16 GetVersion() const = 0;
- virtual Bitmap GetThumbBmp() const { return aThumbBmp;
}
+ virtual BitmapEx GetThumbBmp() const { return aThumbBmp;
}
const GDIMetaFile& GetThumbMtf() const { return aThumbMtf;
}
const INetURLObject& GetURL() const { return aURL; }
sal_Bool IsValid() const {
return bIsValid; }
@@ -130,7 +130,7 @@ public:
virtual ~SgaObjectSound();
virtual SgaObjKind GetObjKind() const { return SGA_OBJ_SOUND; }
- virtual Bitmap GetThumbBmp() const;
+ virtual BitmapEx GetThumbBmp() const;
GalSoundType GetSoundType() const { return eSoundType; }
};
@@ -161,10 +161,6 @@ public:
virtual ~SgaObjectSvDraw() {};
virtual SgaObjKind GetObjKind() const { return SGA_OBJ_SVDRAW; }
-
-public:
-
- static sal_Bool DrawCentered( OutputDevice* pOut, const
FmFormModel& rModel );
};
// ----------------
Modified: openoffice/trunk/main/svx/inc/galtheme.hrc
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/inc/galtheme.hrc?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/inc/galtheme.hrc (original)
+++ openoffice/trunk/main/svx/inc/galtheme.hrc Fri Dec 7 18:15:12 2012
@@ -25,6 +25,12 @@
#define RID_GALLERYSTR_THEME_START (6000)
+// These defines are used to map gallery names to translated string
ressources. Since
+// galleries may be copied from older offices to newer, do *never* change this
+// IDs except adding new ones (and adapting RID_GALLERYSTR_THEME_LAST). The ID
+// *is* written into the binary file *.thm (which is a galler theme combined of
+// three files, *.thm, *.sdv and *.sdg)
+
#define RID_GALLERYSTR_THEME_3D
(RID_GALLERYSTR_THEME_START + 1)
#define RID_GALLERYSTR_THEME_ANIMATIONS
(RID_GALLERYSTR_THEME_START + 2)
#define RID_GALLERYSTR_THEME_BULLETS
(RID_GALLERYSTR_THEME_START + 3)
Modified: openoffice/trunk/main/svx/inc/svx/fontworkgallery.hxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/inc/svx/fontworkgallery.hxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/inc/svx/fontworkgallery.hxx (original)
+++ openoffice/trunk/main/svx/inc/svx/fontworkgallery.hxx Fri Dec 7 18:15:12
2012
@@ -107,12 +107,12 @@ class SVX_DLLPUBLIC FontWorkGalleryDialo
SdrObject** mppSdrObject;
SdrModel* mpDestModel;
- void initfavorites(sal_uInt16 nThemeId, std::vector<
Bitmap * >& rFavorites);
+ void initFavorites(sal_uInt16 nThemeId);
void insertSelectedFontwork();
void changeText( SdrTextObj* pObj );
- void fillFavorites( sal_uInt16 nThemeId,
std::vector< Bitmap * >& rFavorites );
+ void fillFavorites(sal_uInt16 nThemeId);
- std::vector< Bitmap * > maFavoritesHorizontal;
+ std::vector< BitmapEx> maFavoritesHorizontal;
public:
FontWorkGalleryDialog( SdrView* pView, Window* pParent, sal_uInt16 nSID
);
Modified: openoffice/trunk/main/svx/inc/svx/gallery.hxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/inc/svx/gallery.hxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/inc/svx/gallery.hxx (original)
+++ openoffice/trunk/main/svx/inc/svx/gallery.hxx Fri Dec 7 18:15:12 2012
@@ -96,7 +96,7 @@ class FmFormModel;
class SdrModel;
class Graphic;
class FmFormModel;
-class Bitmap;
+class BitmapEx;
class OutputDevice;
class SVX_DLLPUBLIC GalleryExplorer
@@ -138,10 +138,10 @@ public:
static sal_uIntPtr GetObjCount(
sal_uIntPtr nThemeId );
static sal_Bool GetGraphicObj( const
String& rThemeName, sal_uIntPtr nPos,
-
Graphic* pGraphic = NULL, Bitmap* pThumb = NULL,
+
Graphic* pGraphic = NULL, BitmapEx* pThumb = NULL,
sal_Bool bProgess = sal_False );
static sal_Bool GetGraphicObj(
sal_uIntPtr nThemeId, sal_uIntPtr nPos,
-
Graphic* pGraphic = NULL, Bitmap* pThumb = NULL,
+
Graphic* pGraphic = NULL, BitmapEx* pThumb = NULL,
sal_Bool bProgess = sal_False );
static sal_Bool InsertGraphicObj( const
String& rThemeName, const Graphic& rGraphic );
@@ -151,9 +151,9 @@ public:
static sal_uIntPtr GetSdrObjCount(
sal_uIntPtr nThemeId );
static sal_Bool GetSdrObj( const
String& rThemeName, sal_uIntPtr nSdrModelPos,
-
SdrModel* pModel = NULL, Bitmap* pThumb = NULL );
+
SdrModel* pModel = NULL, BitmapEx* pThumb = NULL );
static sal_Bool GetSdrObj( sal_uIntPtr
nThemeId, sal_uIntPtr nSdrModelPos,
-
SdrModel* pModel = NULL, Bitmap* pThumb = NULL );
+
SdrModel* pModel = NULL, BitmapEx* pThumb = NULL );
static sal_Bool InsertSdrObj( const
String& rThemeName, FmFormModel& rModel );
static sal_Bool InsertSdrObj(
sal_uIntPtr nThemeId, FmFormModel& rModel );
@@ -163,8 +163,6 @@ public:
static sal_Bool EndLocking( const
String& rThemeName );
static sal_Bool EndLocking( sal_uIntPtr
nThemeId );
-
- static sal_Bool DrawCentered(
OutputDevice* pOut, const FmFormModel& rModel );
};
#endif // _GALLERY_HXX_
Modified: openoffice/trunk/main/svx/inc/svx/galtheme.hxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/inc/svx/galtheme.hxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/inc/svx/galtheme.hxx (original)
+++ openoffice/trunk/main/svx/inc/svx/galtheme.hxx Fri Dec 7 18:15:12 2012
@@ -194,7 +194,7 @@ public:
return
ImplGetGalleryObject( nPos )->aURL;
}
- sal_Bool GetThumb(
sal_uIntPtr nPos, Bitmap& rBmp, sal_Bool bProgress = sal_False );
+ sal_Bool GetThumb(
sal_uIntPtr nPos, BitmapEx& rBmp, sal_Bool bProgress = sal_False );
SVX_DLLPUBLIC sal_Bool
GetGraphic( sal_uIntPtr nPos, Graphic& rGraphic, sal_Bool bProgress = sal_False
);
SVX_DLLPUBLIC sal_Bool
InsertGraphic( const Graphic& rGraphic, sal_uIntPtr nInsertPos = LIST_APPEND );
Modified: openoffice/trunk/main/svx/source/gallery2/galctrl.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/gallery2/galctrl.cxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/gallery2/galctrl.cxx (original)
+++ openoffice/trunk/main/svx/source/gallery2/galctrl.cxx Fri Dec 7 18:15:12
2012
@@ -300,6 +300,16 @@ void GalleryPreview::PreviewMedia( const
// ------------------------------------------------------------------------
+void drawCheckered(OutputDevice& rOut, const Point& rPos, const Size& rSize)
+{
+ // draw checkered background
+ static const sal_uInt32 nLen(8);
+ static const Color aW(COL_WHITE);
+ static const Color aG(0xef, 0xef, 0xef);
+
+ rOut.DrawCheckered(rPos, rSize, nLen, aW, aG);
+}
+
// -------------------
// - GalleryIconView -
// -------------------
@@ -364,21 +374,37 @@ void GalleryIconView::UserDraw( const Us
const Rectangle& rRect = rUDEvt.GetRect();
OutputDevice* pDev = rUDEvt.GetDevice();
Graphic aGraphic;
+ bool bTransparent(false);
if( pObj->IsThumbBitmap() )
{
- Bitmap aBmp( pObj->GetThumbBmp() );
+ BitmapEx aBitmapEx;
if( pObj->GetObjKind() == SGA_OBJ_SOUND )
- aBmp.Replace( COL_LIGHTMAGENTA,
COL_WHITE );
-
- if( ( pDev->GetBitCount() <= 8 ) && (
aBmp.GetBitCount() >= 8 ) )
- aBmp.Dither( BMP_DITHER_FLOYD );
+ {
+ Bitmap aTemp = pObj->GetThumbBmp().GetBitmap();
+
+ aTemp.Replace( COL_LIGHTMAGENTA, COL_WHITE );
+ aBitmapEx = BitmapEx(aTemp);
+ }
+ else
+ {
+ aBitmapEx = pObj->GetThumbBmp();
+ bTransparent = aBitmapEx.IsTransparent();
+ }
+
+ if( ( pDev->GetBitCount() <= 8 ) && (
aBitmapEx.GetBitCount() >= 8 ) )
+ {
+ aBitmapEx.Dither( BMP_DITHER_FLOYD );
+ }
- aGraphic = aBmp;
+ aGraphic = aBitmapEx;
}
else
+ {
aGraphic = pObj->GetThumbMtf();
+ bTransparent = true;
+ }
Size aSize( aGraphic.GetSizePixel( pDev ) );
@@ -406,6 +432,12 @@ void GalleryIconView::UserDraw( const Us
const Point aPos( ( ( rRect.GetWidth() -
aSize.Width() ) >> 1 ) + rRect.Left(),
( (
rRect.GetHeight() - aSize.Height() ) >> 1 ) + rRect.Top() );
+ if(bTransparent)
+ {
+ // draw checkered background
+ drawCheckered(*pDev, aPos, aSize);
+ }
+
aGraphic.Draw( pDev, aPos, aSize );
}
@@ -604,13 +636,24 @@ void GalleryListView::PaintField( Output
{
Rectangle aOutputRect( rRect.TopLeft(), Size(
rRect.GetHeight(), rRect.GetHeight() ) );
GraphicObject aGrfObj;
+ bool bTransparent(false);
if( pObj->GetObjKind() == SGA_OBJ_SOUND )
+ {
aGrfObj = Graphic( BitmapEx( GAL_RESID(
RID_SVXBMP_GALLERY_MEDIA ) ) );
+ }
else if( pObj->IsThumbBitmap() )
- aGrfObj = Graphic( pObj->GetThumbBmp() );
+ {
+ const BitmapEx aBitmapEx(pObj->GetThumbBmp());
+
+ bTransparent = aBitmapEx.IsTransparent();
+ aGrfObj = Graphic(aBitmapEx);
+ }
else
+ {
aGrfObj = Graphic( pObj->GetThumbMtf() );
+ bTransparent = true;
+ }
Size aSize( rDev.LogicToPixel(
aGrfObj.GetPrefSize(), aGrfObj.GetPrefMapMode() ) );
@@ -641,7 +684,13 @@ void GalleryListView::PaintField( Output
const Point aPos( ( (
aOutputRect.GetWidth() - aSize.Width() ) >> 1 ) + aOutputRect.Left(),
( (
aOutputRect.GetHeight() - aSize.Height() ) >> 1 ) + aOutputRect.Top() );
- aGrfObj.Draw( &rDev, aPos, aSize );
+ if(bTransparent)
+ {
+ // draw checkered background
+ drawCheckered(rDev, aPos, aSize);
+ }
+
+ aGrfObj.Draw( &rDev, aPos, aSize );
}
rDev.DrawText( Point( aOutputRect.Right() + 6,
nTextPosY ), GalleryBrowser2::GetItemText( *mpTheme, *pObj, GALLERY_ITEM_TITLE
) );
Modified: openoffice/trunk/main/svx/source/gallery2/galexpl.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/gallery2/galexpl.cxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/gallery2/galexpl.cxx (original)
+++ openoffice/trunk/main/svx/source/gallery2/galexpl.cxx Fri Dec 7 18:15:12
2012
@@ -260,7 +260,7 @@ sal_uIntPtr GalleryExplorer::GetObjCount
// ------------------------------------------------------------------------
sal_Bool GalleryExplorer::GetGraphicObj( const String& rThemeName, sal_uIntPtr
nPos,
-
Graphic* pGraphic, Bitmap* pThumb,
+
Graphic* pGraphic, BitmapEx* pThumb,
sal_Bool bProgress )
{
Gallery* pGal = ImplGetGallery();
@@ -289,7 +289,7 @@ sal_Bool GalleryExplorer::GetGraphicObj(
// ------------------------------------------------------------------------
sal_Bool GalleryExplorer::GetGraphicObj( sal_uIntPtr nThemeId, sal_uIntPtr
nPos,
-
Graphic* pGraphic, Bitmap* pThumb,
+
Graphic* pGraphic, BitmapEx* pThumb,
sal_Bool bProgress )
{
Gallery* pGal = ImplGetGallery();
@@ -362,7 +362,7 @@ sal_uIntPtr GalleryExplorer::GetSdrObjCo
// ------------------------------------------------------------------------
sal_Bool GalleryExplorer::GetSdrObj( const String& rThemeName, sal_uIntPtr
nSdrModelPos,
- SdrModel*
pModel, Bitmap* pThumb )
+ SdrModel*
pModel, BitmapEx* pThumb )
{
Gallery* pGal = ImplGetGallery();
sal_Bool bRet = sal_False;
@@ -399,7 +399,7 @@ sal_Bool GalleryExplorer::GetSdrObj( con
// ------------------------------------------------------------------------
sal_Bool GalleryExplorer::GetSdrObj( sal_uIntPtr nThemeId, sal_uIntPtr
nSdrModelPos,
- SdrModel*
pModel, Bitmap* pThumb )
+ SdrModel*
pModel, BitmapEx* pThumb )
{
Gallery* pGal = ImplGetGallery();
return( pGal ? GetSdrObj( pGal->GetThemeName( nThemeId ), nSdrModelPos,
pModel, pThumb ) : sal_False );
@@ -504,8 +504,4 @@ sal_Bool GalleryExplorer::EndLocking( sa
}
//
-----------------------------------------------------------------------------
-
-sal_Bool GalleryExplorer::DrawCentered( OutputDevice* pOut, const FmFormModel&
rModel )
-{
- return SgaObjectSvDraw::DrawCentered( pOut, rModel );
-}
+// eof
Modified: openoffice/trunk/main/svx/source/gallery2/galobj.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/gallery2/galobj.cxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/gallery2/galobj.cxx (original)
+++ openoffice/trunk/main/svx/source/gallery2/galobj.cxx Fri Dec 7 18:15:12
2012
@@ -95,7 +95,8 @@ sal_Bool SgaObject::CreateThumb( const G
}
}
- aThumbBmp = aBmpEx.GetBitmap( &aWhite );
+ // take over BitmapEx
+ aThumbBmp = aBmpEx;
if( ( aBmpSize.Width() <= S_THUMB ) && (
aBmpSize.Height() <= S_THUMB ) )
{
@@ -130,7 +131,7 @@ sal_Bool SgaObject::CreateThumb( const G
aSize.Height() = (sal_Int32)( S_THUMB / fFactor );
const GraphicConversionParameters aParameters(aSize, false, true,
true, true);
- aThumbBmp = rGraphic.GetBitmap(aParameters);
+ aThumbBmp = rGraphic.GetBitmapEx(aParameters);
if( !aThumbBmp.IsEmpty() )
{
@@ -354,7 +355,7 @@ SgaObjectSound::~SgaObjectSound()
// ------------------------------------------------------------------------
-Bitmap SgaObjectSound::GetThumbBmp() const
+BitmapEx SgaObjectSound::GetThumbBmp() const
{
sal_uInt16 nId;
@@ -375,9 +376,8 @@ Bitmap SgaObjectSound::GetThumbBmp() con
}
const BitmapEx aBmpEx( GAL_RESID( nId ) );
- const Color aTransColor( COL_WHITE );
-
- return aBmpEx.GetBitmap( &aTransColor );
+
+ return aBmpEx;
}
// ------------------------------------------------------------------------
@@ -521,24 +521,50 @@ sal_Bool SgaObjectSvDraw::CreateThumb( c
sal_Bool bRet = sal_False;
if ( CreateIMapGraphic( rModel, aGraphic, aImageMap ) )
+ {
bRet = SgaObject::CreateThumb( aGraphic );
+ }
else
{
- VirtualDevice aVDev;
+ const FmFormPage* pPage = static_cast< const FmFormPage*
>(rModel.GetPage(0));
- aVDev.SetOutputSizePixel( Size( S_THUMB*2, S_THUMB*2 ) );
-
- bRet = DrawCentered( &aVDev, rModel );
- if( bRet )
+ if(pPage)
{
- aThumbBmp = aVDev.GetBitmap( Point(), aVDev.GetOutputSizePixel() );
+ const Rectangle aObjRect(pPage->GetAllObjBoundRect());
- Size aMS( 2, 2 );
- BmpFilterParam aParam( aMS );
- aThumbBmp.Filter( BMP_FILTER_MOSAIC, &aParam );
- aThumbBmp.Scale( Size( S_THUMB, S_THUMB ) );
+ if(aObjRect.GetWidth() && aObjRect.GetHeight())
+ {
+ VirtualDevice aVDev;
+ FmFormView aView(const_cast< FmFormModel* >(&rModel), &aVDev);
- aThumbBmp.Convert( BMP_CONVERSION_8BIT_COLORS );
+ aView.ShowSdrPage(const_cast< FmFormPage* >(pPage));
+ aView.MarkAllObj();
+ aThumbBmp = aView.GetMarkedObjBitmapEx();
+
+ const Size aDiscreteSize(aThumbBmp.GetSizePixel());
+
+ if(aDiscreteSize.Width() && aDiscreteSize.Height())
+ {
+ sal_uInt32 nTargetSizeX(S_THUMB);
+ sal_uInt32 nTargetSizeY(S_THUMB);
+
+ if(aDiscreteSize.Width() > aDiscreteSize.Height())
+ {
+ nTargetSizeY = (aDiscreteSize.Height() * nTargetSizeX)
/ aDiscreteSize.Width();
+ }
+ else
+ {
+ nTargetSizeX = (aDiscreteSize.Width() * nTargetSizeY)
/ aDiscreteSize.Height();
+ }
+
+ if(!!aThumbBmp)
+ {
+ aThumbBmp.Scale(Size(nTargetSizeX, nTargetSizeY),
BMP_SCALE_BESTQUALITY);
+ aThumbBmp.Convert(BMP_CONVERSION_8BIT_COLORS);
+ bRet = true;
+ }
+ }
+ }
}
}
@@ -547,56 +573,6 @@ sal_Bool SgaObjectSvDraw::CreateThumb( c
// ------------------------------------------------------------------------
-sal_Bool SgaObjectSvDraw::DrawCentered( OutputDevice* pOut, const FmFormModel&
rModel )
-{
- const FmFormPage* pPage = static_cast< const FmFormPage* >(
rModel.GetPage( 0 ) );
- sal_Bool bRet = sal_False;
-
- if( pOut && pPage )
- {
- const Rectangle aObjRect( pPage->GetAllObjBoundRect() );
- const Size aOutSizePix( pOut->GetOutputSizePixel() );
-
- if( aObjRect.GetWidth() && aObjRect.GetHeight() && aOutSizePix.Width()
> 2 && aOutSizePix.Height() > 2 )
- {
- FmFormView aView( const_cast< FmFormModel* >( &rModel ), pOut
);
- MapMode aMap( rModel.GetScaleUnit() );
- Rectangle aDrawRectPix( Point( 1, 1 ), Size(
aOutSizePix.Width() - 2, aOutSizePix.Height() - 2 ) );
- const double fFactor = (double) aObjRect.GetWidth() /
aObjRect.GetHeight();
- Fraction aFrac( FRound( fFactor < 1. ?
aDrawRectPix.GetWidth() * fFactor : aDrawRectPix.GetWidth() ),
- pOut->LogicToPixel( aObjRect.GetSize(),
aMap ).Width() );
-
- aMap.SetScaleX( aFrac );
- aMap.SetScaleY( aFrac );
-
- const Size aDrawSize( pOut->PixelToLogic( aDrawRectPix.GetSize(),
aMap ) );
- Point aOrigin( pOut->PixelToLogic( aDrawRectPix.TopLeft(), aMap )
);
-
- aOrigin.X() += ( ( aDrawSize.Width() - aObjRect.GetWidth() ) >> 1
) - aObjRect.Left();
- aOrigin.Y() += ( ( aDrawSize.Height() - aObjRect.GetHeight() ) >>
1 ) - aObjRect.Top();
- aMap.SetOrigin( aOrigin );
-
- aView.SetPageVisible( sal_False );
- aView.SetBordVisible( sal_False );
- aView.SetGridVisible( sal_False );
- aView.SetHlplVisible( sal_False );
- aView.SetGlueVisible( sal_False );
-
- pOut->Push();
- pOut->SetMapMode( aMap );
- aView.ShowSdrPage( const_cast< FmFormPage* >( pPage ));
- aView.CompleteRedraw( pOut, Rectangle( pOut->PixelToLogic( Point()
), pOut->GetOutputSize() ) );
- pOut->Pop();
-
- bRet = sal_True;
- }
- }
-
- return bRet;
-}
-
-// ------------------------------------------------------------------------
-
void SgaObjectSvDraw::WriteData( SvStream& rOut, const String& rDestDir ) const
{
SgaObject::WriteData( rOut, rDestDir );
@@ -615,3 +591,5 @@ void SgaObjectSvDraw::ReadData( SvStream
rIn >> aTmpStr; aTitle = String( aTmpStr.GetBuffer(),
RTL_TEXTENCODING_UTF8 );
}
}
+
+// eof
Modified: openoffice/trunk/main/svx/source/gallery2/galtheme.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/gallery2/galtheme.cxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/gallery2/galtheme.cxx (original)
+++ openoffice/trunk/main/svx/source/gallery2/galtheme.cxx Fri Dec 7 18:15:12
2012
@@ -790,7 +790,7 @@ GalleryThemeEntry* GalleryTheme::CreateT
//
-----------------------------------------------------------------------------
-sal_Bool GalleryTheme::GetThumb( sal_uIntPtr nPos, Bitmap& rBmp, sal_Bool )
+sal_Bool GalleryTheme::GetThumb( sal_uIntPtr nPos, BitmapEx& rBmp, sal_Bool )
{
SgaObject* pObj = AcquireObject( nPos );
sal_Bool bRet = sal_False;
@@ -862,9 +862,10 @@ sal_Bool GalleryTheme::GetGraphic( sal_u
if( pObj )
{
- Bitmap aBmp( pObj->GetThumbBmp() );
- aBmp.Replace( COL_LIGHTMAGENTA,
COL_WHITE );
- rGraphic = aBmp;
+ rGraphic = pObj->GetThumbBmp();
+ //Bitmap aBmp( pObj->GetThumbBmp() );
+ //aBmp.Replace( COL_LIGHTMAGENTA,
COL_WHITE );
+ //rGraphic = aBmp;
ReleaseObject( pObj );
bRet = sal_True;
}
Modified: openoffice/trunk/main/svx/source/gallery2/galtheme.src
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/gallery2/galtheme.src?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/gallery2/galtheme.src (original)
+++ openoffice/trunk/main/svx/source/gallery2/galtheme.src Fri Dec 7 18:15:12
2012
@@ -145,36 +145,36 @@ String RID_GALLERYSTR_THEME_RULERS
};
//
-----------------------------------------------------------------------------
-
-String RID_GALLERYSTR_THEME_COMPUTERS
-{
- Text [ en-US ] = "Computers";
-};
-
-String RID_GALLERYSTR_THEME_DIAGRAMS
-{
- Text [ en-US ] = "Diagrams";
-};
-
-String RID_GALLERYSTR_THEME_ENVIRONMENT
-{
- Text [ en-US ] = "Environment";
-};
-
-String RID_GALLERYSTR_THEME_FINANCE
-{
- Text [ en-US ] = "Finance";
-};
-
-String RID_GALLERYSTR_THEME_TRANSPORT
-{
- Text [ en-US ] = "Transport";
-};
-
-String RID_GALLERYSTR_THEME_TXTSHAPES
-{
- Text [ en-US ] = "Textshapes";
-};
+
+String RID_GALLERYSTR_THEME_COMPUTERS
+{
+ Text [ en-US ] = "Computers";
+};
+
+String RID_GALLERYSTR_THEME_DIAGRAMS
+{
+ Text [ en-US ] = "Diagrams";
+};
+
+String RID_GALLERYSTR_THEME_ENVIRONMENT
+{
+ Text [ en-US ] = "Environment";
+};
+
+String RID_GALLERYSTR_THEME_FINANCE
+{
+ Text [ en-US ] = "Finance";
+};
+
+String RID_GALLERYSTR_THEME_TRANSPORT
+{
+ Text [ en-US ] = "Transport";
+};
+
+String RID_GALLERYSTR_THEME_TXTSHAPES
+{
+ Text [ en-US ] = "Textshapes";
+};
//
-----------------------------------------------------------------------------
Modified: openoffice/trunk/main/svx/source/tbxctrls/fontworkgallery.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/tbxctrls/fontworkgallery.cxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/tbxctrls/fontworkgallery.cxx (original)
+++ openoffice/trunk/main/svx/source/tbxctrls/fontworkgallery.cxx Fri Dec 7
18:15:12 2012
@@ -100,21 +100,18 @@ FontWorkGalleryDialog::FontWorkGalleryDi
maCtlFavorites.SetLineCount( nLineCount );
maCtlFavorites.SetExtraSpacing( 3 );
- initfavorites( GALLERY_THEME_FONTWORK, maFavoritesHorizontal );
- fillFavorites( GALLERY_THEME_FONTWORK, maFavoritesHorizontal );
+ initFavorites( GALLERY_THEME_FONTWORK );
+ fillFavorites( GALLERY_THEME_FONTWORK );
}
-static void delete_bitmap( Bitmap* p ) { delete p; }
-
// -----------------------------------------------------------------------
FontWorkGalleryDialog::~FontWorkGalleryDialog()
{
- std::for_each( maFavoritesHorizontal.begin(),
maFavoritesHorizontal.end(), delete_bitmap );
}
// -----------------------------------------------------------------------
-void FontWorkGalleryDialog::initfavorites(sal_uInt16 nThemeId, std::vector<
Bitmap * >& rFavorites)
+void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId)
{
// Ueber die Gallery werden die Favoriten eingelesen
sal_uIntPtr nFavCount = GalleryExplorer::GetSdrObjCount( nThemeId );
@@ -126,35 +123,32 @@ void FontWorkGalleryDialog::initfavorite
FmFormModel *pModel = NULL;
for( nModelPos = 0; nModelPos < nFavCount; nModelPos++ )
{
- Bitmap* pThumb = new Bitmap;
-
- if( GalleryExplorer::GetSdrObj( nThemeId, nModelPos, pModel,
pThumb ) )
- {
-/*
- VirtualDevice aVDev;
- Size aRenderSize( aThumbSize.Width() * 4,
aThumbSize.Height() * 4 );
- aVDev.SetOutputSizePixel( aRenderSize );
+ BitmapEx aThumb;
- if( GalleryExplorer::DrawCentered( &aVDev, *pModel ) )
- {
- aThumb = aVDev.GetBitmap( Point(),
aVDev.GetOutputSizePixel() );
+ GalleryExplorer::GetSdrObj(nThemeId, nModelPos, pModel, &aThumb);
- Size aMS( 4, 4 );
- BmpFilterParam aParam( aMS );
- aThumb.Filter( BMP_FILTER_MOSAIC, &aParam );
- aThumb.Scale( aThumbSize );
- }
-*/
- }
+ if(!!aThumb)
+ {
+ static const sal_uInt32 nLen(8);
+ static const Color aW(COL_WHITE);
+ static const Color aG(0xef, 0xef, 0xef);
+ VirtualDevice aVDev;
+ const Point aNull(0, 0);
+ const Size aSize(aThumb.GetSizePixel());
+
+ aVDev.SetOutputSizePixel(aSize);
+ aVDev.DrawCheckered(aNull, aSize, nLen, aW, aG);
+ aVDev.DrawBitmapEx(aNull, aThumb);
- rFavorites.push_back( pThumb );
+ maFavoritesHorizontal.push_back(aVDev.GetBitmap(aNull, aSize));
+ }
}
// Gallery thema freigeben
GalleryExplorer::EndLocking(nThemeId);
}
-void FontWorkGalleryDialog::fillFavorites( sal_uInt16 nThemeId, std::vector<
Bitmap * >& rFavorites )
+void FontWorkGalleryDialog::fillFavorites(sal_uInt16 nThemeId)
{
mnThemeId = nThemeId;
@@ -164,7 +158,7 @@ void FontWorkGalleryDialog::fillFavorite
aThumbSize.Width() -= 12;
aThumbSize.Height() -= 12;
- std::vector< Bitmap * >::size_type nFavCount = rFavorites.size();
+ std::vector< Bitmap * >::size_type nFavCount =
maFavoritesHorizontal.size();
// ValueSet Favoriten
if( nFavCount > (nColCount * nLineCount) )
@@ -182,7 +176,7 @@ void FontWorkGalleryDialog::fillFavorite
String aStr(SVX_RES(RID_SVXFLOAT3D_FAVORITE));
aStr += sal_Unicode(' ');
aStr += String::CreateFromInt32((sal_Int32)nFavorite);
- Image aThumbImage( *rFavorites[nFavorite-1] );
+ Image aThumbImage( maFavoritesHorizontal[nFavorite-1] );
maCtlFavorites.InsertItem( (sal_uInt16)nFavorite, aThumbImage,
aStr );
}
}
Modified: openoffice/trunk/main/vcl/inc/vcl/outdev.hxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/outdev.hxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/outdev.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/outdev.hxx Fri Dec 7 18:15:12 2012
@@ -820,6 +820,14 @@ public:
bool DrawEPS( const Point& rPt, const Size& rSz,
const GfxLink& rGfxLink, GDIMetaFile* pSubst
= NULL );
+ /// Fill the given rectangle with checkered rectangles of size nLen x nLen
using the colors aStart and aEnd
+ void DrawCheckered(
+ const Point& rPos,
+ const Size& rSize,
+ sal_uInt32 nLen = 8,
+ Color aStart = Color(COL_WHITE),
+ Color aEnd = Color(COL_BLACK));
+
Color GetPixel( const Point& rPt ) const;
Color* GetPixel( const Polygon& rPts ) const;
Modified: openoffice/trunk/main/vcl/source/gdi/outdev6.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/outdev6.cxx?rev=1418421&r1=1418420&r2=1418421&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/outdev6.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/outdev6.cxx Fri Dec 7 18:15:12 2012
@@ -1248,3 +1248,31 @@ bool OutputDevice::DrawEPS( const Point&
return bDrawn;
}
+// -----------------------------------------------------------------------
+
+void OutputDevice::DrawCheckered(const Point& rPos, const Size& rSize,
sal_uInt32 nLen, Color aStart, Color aEnd)
+{
+ const sal_uInt32 nMaxX(rPos.X() + rSize.Width());
+ const sal_uInt32 nMaxY(rPos.Y() + rSize.Height());
+
+ Push();
+ SetLineColor();
+
+ for(sal_uInt32 x(0), nX(rPos.X()); nX < nMaxX; x++, nX += nLen)
+ {
+ const sal_uInt32 nRight(std::min(nMaxX, nX + nLen));
+
+ for(sal_uInt32 y(0), nY(rPos.Y()); nY < nMaxY; y++, nY += nLen)
+ {
+ const sal_uInt32 nBottom(std::min(nMaxY, nY + nLen));
+
+ SetFillColor((x & 0x0001) ^ (y & 0x0001) ? aStart : aEnd);
+ DrawRect(Rectangle(nX, nY, nRight, nBottom));
+ }
+ }
+
+ Pop();
+}
+
+// -----------------------------------------------------------------------
+// eof