[Libreoffice-commits] core.git: cui/source include/svx include/vcl svx/source vcl/source

2019-04-09 Thread Tomaž Vajngerl (via logerrit)
 cui/source/tabpages/tppattern.cxx |9 +++--
 include/svx/xbtmpit.hxx   |2 --
 include/vcl/BitmapTools.hxx   |2 +-
 svx/source/dialog/dlgctrl.cxx |   21 -
 svx/source/xoutdev/xattrbmp.cxx   |2 +-
 vcl/source/bitmap/BitmapTools.cxx |6 +++---
 6 files changed, 12 insertions(+), 30 deletions(-)

New commits:
commit 05a8749ee6f251d4b92eecb97763fa1fe94c68c8
Author: Tomaž Vajngerl 
AuthorDate: Tue Apr 9 09:58:27 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Apr 9 12:07:36 2019 +0200

remove some usages of BitmapColor outside of VCL

You get BitmapColor only from reading pixels from a Bitmap and
we want to avoid usage of Bitmap outside of VCL (and use BitmapEx
as the alternative which will eventually replace Bitmap).

Change-Id: Iddfa3ef739bfdd4dce5fb47fd9f67a5a36f3388b
Reviewed-on: https://gerrit.libreoffice.org/70447
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/cui/source/tabpages/tppattern.cxx 
b/cui/source/tabpages/tppattern.cxx
index 878c1ae8b98d..0bb433f00c65 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -296,9 +296,9 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, 
SvtValueSet*, void)
 
 if(pGraphicObject)
 {
-BitmapColor aBack;
-BitmapColor aFront;
-bool 
bIs8x8(vcl::bitmap::isHistorical8x8(pGraphicObject->GetGraphic().GetBitmapEx(), 
aBack, aFront));
+Color aBackColor;
+Color aPixelColor;
+bool 
bIs8x8(vcl::bitmap::isHistorical8x8(pGraphicObject->GetGraphic().GetBitmapEx(), 
aBackColor, aPixelColor));
 
 m_xLbColor->SetNoSelection();
 m_xLbBackgroundColor->SetNoSelection();
@@ -313,9 +313,6 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, 
SvtValueSet*, void)
 
 
m_xCtlPixel->SetXBitmap(pGraphicObject->GetGraphic().GetBitmapEx());
 
-Color aPixelColor = aFront.GetColor();
-Color aBackColor = aBack.GetColor();
-
 m_xLbColor->SelectEntry( aPixelColor );
 m_xLbBackgroundColor->SelectEntry( aBackColor );
 
diff --git a/include/svx/xbtmpit.hxx b/include/svx/xbtmpit.hxx
index 463fc6e78d63..7da764f7f9ac 100644
--- a/include/svx/xbtmpit.hxx
+++ b/include/svx/xbtmpit.hxx
@@ -26,8 +26,6 @@
 #include 
 
 class SdrModel;
-class BitmapColor;
-
 
 // class XFillBitmapItem
 
diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx
index 0099358476c0..81b062fefdc1 100644
--- a/include/vcl/BitmapTools.hxx
+++ b/include/vcl/BitmapTools.hxx
@@ -125,7 +125,7 @@ VCL_DLLPUBLIC css::uno::Sequence< sal_Int8 > 
CanvasExtractBitmapData(BitmapEx co
 // helper to construct historical 8x8 bitmaps with two colors
 
 BitmapEx VCL_DLLPUBLIC createHistorical8x8FromArray(std::array 
const & pArray, Color aColorPix, Color aColorBack);
-bool VCL_DLLPUBLIC isHistorical8x8(const BitmapEx& rBitmapEx, BitmapColor& 
o_rBack, BitmapColor& o_rFront);
+bool VCL_DLLPUBLIC isHistorical8x8(const BitmapEx& rBitmapEx, Color& o_rBack, 
Color& o_rFront);
 
 VCL_DLLPUBLIC bool convertBitmap32To24Plus8(BitmapEx const & rInput, BitmapEx 
& rResult);
 
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 8b280e334051..01ad02c96341 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -873,25 +873,12 @@ void SvxPixelCtl::LoseFocus()
 
 void SvxPixelCtl::SetXBitmap(const BitmapEx& rBitmapEx)
 {
-BitmapColor aBack;
-BitmapColor aFront;
-
-if (vcl::bitmap::isHistorical8x8(rBitmapEx, aBack, aFront))
+if (vcl::bitmap::isHistorical8x8(rBitmapEx, aBackgroundColor, aPixelColor))
 {
-Bitmap aBitmap(rBitmapEx.GetBitmap());
-Bitmap::ScopedReadAccess pRead(aBitmap);
-
-aBackgroundColor = aBack.GetColor();
-aPixelColor = aFront.GetColor();
-
-for(sal_uInt16 i(0); i < nSquares; i++)
+for (sal_uInt16 i = 0; i < nSquares; i++)
 {
-const BitmapColor aColor(pRead->GetColor(i/8, i%8));
-
-if (aColor == aBack)
-maPixelData[i] = 0;
-else
-maPixelData[i] = 1;
+Color aColor = rBitmapEx.GetPixelColor(i%8, i/8);
+maPixelData[i] = (aColor == aBackgroundColor) ? 0 : 1;
 }
 }
 }
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index e15e11bc808c..140718bd056f 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -164,7 +164,7 @@ bool XFillBitmapItem::operator==(const SfxPoolItem& rItem) 
const
 
 bool XFillBitmapItem::isPattern() const
 {
-BitmapColor aBack, aFront;
+Color aBack, aFront;
 return 
vcl::bitmap::isHistorical8x8(GetGraphicObject().GetGraphic().GetBitmapEx(), 
aBack, aFront);
 }
 
diff --git a/vcl/source/bitmap/BitmapTools.cxx 
b/vcl/source/bitmap/BitmapTools.cxx
index 6f14c3526d42..5610c7347755 100644
--- a/vcl/source/bitmap/BitmapT

[Libreoffice-commits] core.git: cui/source include/svx include/vcl svx/source vcl/source

2017-08-15 Thread Akshay Deep
 cui/source/dialogs/cuicharmap.cxx   |   12 ++
 cui/source/inc/cuicharmap.hxx   |1 
 include/svx/charmap.hxx |   19 +++
 include/svx/strings.hrc |5 
 include/vcl/textview.hxx|   26 
 svx/source/dialog/charmap.cxx   |  202 +++-
 svx/source/dialog/searchcharmap.cxx |1 
 vcl/source/edit/textview.cxx|   25 
 8 files changed, 264 insertions(+), 27 deletions(-)

New commits:
commit f9af8a35fc1aad055af2b5e6b6eab45a7d060719
Author: Akshay Deep 
Date:   Tue Aug 15 17:21:26 2017 +

tdf#111337 - Introduce alternative workflows at the special characters 
dialog

Change-Id: I6a8fe2476adc5c4379c76dfaef090d1b5cd81ea0
Reviewed-on: https://gerrit.libreoffice.org/41170
Reviewed-by: Heiko Tietze 
Tested-by: Heiko Tietze 

diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index d148676dc645..0831604b408b 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -243,6 +243,8 @@ void SvxCharacterMap::getRecentCharacterList()
 
 void SvxCharacterMap::getFavCharacterList()
 {
+maFavCharList.clear();
+maFavCharFontList.clear();
 //retrieve recent character list
 css::uno::Sequence< OUString > rFavCharList( 
officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::get() );
 for (int i = 0; i < rFavCharList.getLength(); ++i)
@@ -385,6 +387,8 @@ void SvxCharacterMap::updateFavCharControl()
 m_pFavCharView[i]->SetText(OUString());
 m_pFavCharView[i]->Hide();
 }
+m_pShowSet->getFavCharacterList();
+m_pSearchSet->getFavCharacterList();
 }
 
 
@@ -476,11 +480,13 @@ void SvxCharacterMap::init()
 m_pShowSet->SetSelectHdl( LINK( this, SvxCharacterMap, CharSelectHdl ) );
 m_pShowSet->SetHighlightHdl( LINK( this, SvxCharacterMap, CharHighlightHdl 
) );
 m_pShowSet->SetPreSelectHdl( LINK( this, SvxCharacterMap, CharPreSelectHdl 
) );
+m_pShowSet->SetFavClickHdl( LINK( this, SvxCharacterMap, FavClickHdl ) );
 
 m_pSearchSet->SetDoubleClickHdl( LINK( this, SvxCharacterMap, 
SearchCharDoubleClickHdl ) );
 m_pSearchSet->SetSelectHdl( LINK( this, SvxCharacterMap, 
SearchCharSelectHdl ) );
 m_pSearchSet->SetHighlightHdl( LINK( this, SvxCharacterMap, 
SearchCharHighlightHdl ) );
 m_pSearchSet->SetPreSelectHdl( LINK( this, SvxCharacterMap, 
SearchCharPreSelectHdl ) );
+m_pSearchSet->SetFavClickHdl( LINK( this, SvxCharacterMap, FavClickHdl ) );
 
 m_pDecimalCodeText->SetModifyHdl( LINK( this, SvxCharacterMap, 
DecimalCodeChangeHdl ) );
 m_pHexCodeText->SetModifyHdl( LINK( this, SvxCharacterMap, 
HexCodeChangeHdl ) );
@@ -955,6 +961,12 @@ IMPL_LINK_NOARG(SvxCharacterMap, FavSelectHdl, Button*, 
void)
 updateFavCharControl();
 }
 
+IMPL_LINK_NOARG(SvxCharacterMap, FavClickHdl, SvxShowCharSet*, void)
+{
+getFavCharacterList();
+updateFavCharControl();
+}
+
 IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void)
 {
 OUString aText;
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index e7c63c29429c..2ba12e34f212 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -106,6 +106,7 @@ private:
 DECL_LINK(CharSelectHdl, SvxShowCharSet*, void);
 DECL_LINK(CharHighlightHdl, SvxShowCharSet*, void);
 DECL_LINK(CharPreSelectHdl, SvxShowCharSet*, void);
+DECL_LINK(FavClickHdl, SvxShowCharSet*,void);
 DECL_LINK(SearchCharDoubleClickHdl, SvxShowCharSet*,void);
 DECL_LINK(SearchCharSelectHdl, SvxShowCharSet*, void);
 DECL_LINK(SearchCharHighlightHdl, SvxShowCharSet*, void);
diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index 86c95fc0cad5..bee07bbad2aa 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com { namespace sun { namespace star {
 namespace accessibility { class XAccessible; }
@@ -40,6 +41,8 @@ namespace com { namespace sun { namespace star {
 
 namespace vcl { class Font; }
 
+using namespace ::com::sun::star;
+
 #define COLUMN_COUNT16
 #define ROW_COUNT8
 
@@ -62,15 +65,20 @@ public:
 
 virtual voidRecalculateFont(vcl::RenderContext& 
rRenderContext);
 
-voidSelectCharacter( sal_uInt32 cNew );
+voidSelectCharacter( sal_uInt32 cNew );
 virtual sal_UCS4GetSelectCharacter() const;
+voidcreateContextMenu();
 
 voidSetDoubleClickHdl( const Link& rLink 
) { aDoubleClkHdl = rLink; }
 voidSetSelectHdl( const Link& rHdl ) { 
aSelectHdl = rHdl; }
 voidSetHighlightHdl( const Link& rHdl ) 
{ aHighHdl = rHdl; }
 voidSetPreSelectHdl( const Link& rHdl ) 
{ aPreSelectHdl = rHdl; }
+voidSetFavClickHdl( const Link& rHdl ) { 
aFavClickHdl = rHdl; }
 static sal_uInt32&