[Libreoffice-commits] core.git: 2 commits - cui/source vcl/CustomTarget_nativecode.mk
Caolán McNamara
caolanm at redhat.com
Wed Dec 21 13:54:18 UTC 2016
cui/source/inc/border.hxx | 2 -
cui/source/inc/cuires.hrc | 5 ++
cui/source/tabpages/border.cxx | 73 ++++++++++++++++++-----------------------
cui/source/tabpages/border.hrc | 7 ---
cui/source/tabpages/border.src | 33 ++++++++++++------
vcl/CustomTarget_nativecode.mk | 2 -
6 files changed, 62 insertions(+), 60 deletions(-)
New commits:
commit 263bec579fb5045d2e50a027778a0aec17c70f4b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 21 13:52:39 2016 +0000
no java code for fuzzing
Change-Id: I902eb7521b6384d41cd4b8a9f58c0c0f6cd76d1b
diff --git a/vcl/CustomTarget_nativecode.mk b/vcl/CustomTarget_nativecode.mk
index 93656aa..debd9ef 100644
--- a/vcl/CustomTarget_nativecode.mk
+++ b/vcl/CustomTarget_nativecode.mk
@@ -13,6 +13,6 @@ wmffuzzer_PYTHONCOMMAND := $(call gb_ExternalExecutable_get_command,python)
wmffuzzer_Native_cxx=$(call gb_CustomTarget_get_workdir,vcl/workben)/native-code.cxx
$(wmffuzzer_Native_cxx): $(SRCDIR)/solenv/bin/native-code.py | $(call gb_CustomTarget_get_workdir,vcl/workben)/.dir
- $(call gb_Helper_abbreviate_dirs, $(wmffuzzer_PYTHONCOMMAND) $(SRCDIR)/solenv/bin/native-code.py -j -g core) > $@
+ $(call gb_Helper_abbreviate_dirs, $(wmffuzzer_PYTHONCOMMAND) $(SRCDIR)/solenv/bin/native-code.py -g core) > $@
# vim: set noet sw=4 ts=4:
commit 910f91a3e5228f26f0692f870a3fd3919835eb27
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 21 13:04:30 2016 +0000
unwind IL_SDW_BITMAPS ImageList
Change-Id: I3018bdc08e3b1ef957215b74c743e6c80f7e38b5
diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index 915deba..5957d98 100644
--- a/cui/source/inc/border.hxx
+++ b/cui/source/inc/border.hxx
@@ -101,7 +101,7 @@ private:
VclPtr<CheckBox> m_pMergeAdjacentBordersCB;
VclPtr<CheckBox> m_pRemoveAdjcentCellBordersCB;
- ImageList aShadowImgLst;
+ std::vector<BitmapEx> m_aShadowImgVec;
ImageList aBorderImgLst;
long nMinValue; ///< minimum distance
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index 4f2ea36..dba8ec9 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -179,6 +179,11 @@
#define RID_SVXBMP_BOTTOMLOCK (RID_SVX_START + 560)
#define RID_SVXBMP_TOPLOCK (RID_SVX_START + 561)
#define RID_SVXBMP_CELLLOCK (RID_SVX_START + 562)
+#define RID_SVXBMP_SHADOWNONE (RID_SVX_START + 563)
+#define RID_SVXBMP_SHADOW_BOT_RIGHT (RID_SVX_START + 564)
+#define RID_SVXBMP_SHADOW_BOT_LEFT (RID_SVX_START + 565)
+#define RID_SVXBMP_SHADOW_TOP_RIGHT (RID_SVX_START + 566)
+#define RID_SVXBMP_SHADOW_TOP_LEFT (RID_SVX_START + 567)
#define RID_SVXPAGE_HYPERLINK_INTERNET (RID_SVX_START + 228)
#define RID_SVXPAGE_HYPERLINK_MAIL (RID_SVX_START + 229)
#define RID_SVXPAGE_HYPERLINK_DOCUMENT (RID_SVX_START + 230)
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index d67df7f..8ce16b9 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -79,7 +79,6 @@ const sal_uInt16 SvxBorderTabPage::pRanges[] =
0
};
-
static void lcl_SetDecimalDigitsTo1(MetricField& rField)
{
sal_Int64 nMin = rField.Denormalize( rField.GetMin( FUNIT_TWIP ) );
@@ -87,26 +86,26 @@ static void lcl_SetDecimalDigitsTo1(MetricField& rField)
rField.SetMin( rField.Normalize( nMin ), FUNIT_TWIP );
}
+// number of preset images to show
+const sal_uInt16 SVX_BORDER_PRESET_COUNT = 5;
+
+// number of shadow images to show
+const sal_uInt16 SVX_BORDER_SHADOW_COUNT = 5;
SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCoreAttrs)
: SfxTabPage(pParent, "BorderPage", "cui/ui/borderpage.ui", &rCoreAttrs)
-
-,
-
- aShadowImgLst( CUI_RES(IL_SDW_BITMAPS)),
- aBorderImgLst( CUI_RES(IL_PRE_BITMAPS)),
- nMinValue(0),
- nSWMode(SwBorderModes::NONE),
- mbHorEnabled( false ),
- mbVerEnabled( false ),
- mbTLBREnabled( false ),
- mbBLTREnabled( false ),
- mbUseMarginItem( false ),
- mbAllowPaddingWithoutBorders( true ),
- mbSync(true),
- mbRemoveAdjacentCellBorders( false ),
- bIsCalcDoc( false )
-
+ , aBorderImgLst( CUI_RES(IL_PRE_BITMAPS))
+ , nMinValue(0)
+ , nSWMode(SwBorderModes::NONE)
+ , mbHorEnabled(false)
+ , mbVerEnabled(false)
+ , mbTLBREnabled(false)
+ , mbBLTREnabled(false)
+ , mbUseMarginItem(false)
+ , mbAllowPaddingWithoutBorders(true)
+ , mbSync(true)
+ , mbRemoveAdjacentCellBorders(false)
+ , bIsCalcDoc(false)
{
get(m_pWndPresets, "presets");
get(m_pUserDefFT, "userdefft");
@@ -138,6 +137,19 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
get(m_pMergeAdjacentBordersCB, "mergeadjacent");
get(m_pRemoveAdjcentCellBordersCB, "rmadjcellborders");
+ static const sal_uInt16 pnImgIds[SVX_BORDER_SHADOW_COUNT] =
+ {
+ RID_SVXBMP_SHADOWNONE,
+ RID_SVXBMP_SHADOW_BOT_RIGHT,
+ RID_SVXBMP_SHADOW_BOT_LEFT,
+ RID_SVXBMP_SHADOW_TOP_RIGHT,
+ RID_SVXBMP_SHADOW_TOP_LEFT
+ };
+
+ for (size_t i = 0; i < SAL_N_ELEMENTS(pnImgIds); ++i)
+ m_aShadowImgVec.push_back(BitmapEx(CUI_RES(pnImgIds[i])));
+ assert(m_aShadowImgVec.size() == SVX_BORDER_SHADOW_COUNT);
+
if ( GetDPIScaleFactor() > 1 )
{
for (short i = 0; i < aBorderImgLst.GetImageCount(); i++)
@@ -148,13 +160,8 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
aBorderImgLst.ReplaceImage(rImageName, Image(b));
}
- for (short i = 0; i < aShadowImgLst.GetImageCount(); i++)
- {
- OUString rImageName = aShadowImgLst.GetImageName(i);
- BitmapEx b = aShadowImgLst.GetImage(rImageName).GetBitmapEx();
- b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
- aShadowImgLst.ReplaceImage(rImageName, Image(b));
- }
+ for (size_t i = 0; i < m_aShadowImgVec.size(); i++)
+ m_aShadowImgVec[i].Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BmpScaleFlag::Fast);
}
// this page needs ExchangeSupport
@@ -881,15 +888,6 @@ IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox&, rLb, void )
// ValueSet handling
-
-
-// number of preset images to show
-const sal_uInt16 SVX_BORDER_PRESET_COUNT = 5;
-
-// number of shadow images to show
-const sal_uInt16 SVX_BORDER_SHADOW_COUNT = 5;
-
-
sal_uInt16 SvxBorderTabPage::GetPresetImageId( sal_uInt16 nValueSetIdx ) const
{
// table with all sets of predefined border styles
@@ -981,15 +979,10 @@ void SvxBorderTabPage::FillPresetVS()
void SvxBorderTabPage::FillShadowVS()
{
- ImageList& rImgList = aShadowImgLst;
-
// basic initialization of the ValueSet
m_pWndShadows->SetStyle( m_pWndShadows->GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER );
m_pWndShadows->SetColCount( SVX_BORDER_SHADOW_COUNT );
- // image resource IDs
- static const sal_uInt16 pnImgIds[ SVX_BORDER_SHADOW_COUNT ] =
- { IID_SHADOWNONE, IID_SHADOW_BOT_RIGHT, IID_SHADOW_TOP_RIGHT, IID_SHADOW_BOT_LEFT, IID_SHADOW_TOP_LEFT };
// string resource IDs for each image
static const sal_uInt16 pnStrIds[ SVX_BORDER_SHADOW_COUNT ] =
{ RID_SVXSTR_SHADOW_STYLE_NONE, RID_SVXSTR_SHADOW_STYLE_BOTTOMRIGHT, RID_SVXSTR_SHADOW_STYLE_TOPRIGHT, RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT, RID_SVXSTR_SHADOW_STYLE_TOPLEFT };
@@ -998,7 +991,7 @@ void SvxBorderTabPage::FillShadowVS()
for( sal_uInt16 nVSIdx = 1; nVSIdx <= SVX_BORDER_SHADOW_COUNT; ++nVSIdx )
{
m_pWndShadows->InsertItem( nVSIdx );
- m_pWndShadows->SetItemImage( nVSIdx, rImgList.GetImage( pnImgIds[ nVSIdx - 1 ] ) );
+ m_pWndShadows->SetItemImage(nVSIdx, Image(m_aShadowImgVec[nVSIdx-1]));
m_pWndShadows->SetItemText( nVSIdx, CUI_RESSTR( pnStrIds[ nVSIdx - 1 ] ) );
}
diff --git a/cui/source/tabpages/border.hrc b/cui/source/tabpages/border.hrc
index 4909cf4..31b7b97 100644
--- a/cui/source/tabpages/border.hrc
+++ b/cui/source/tabpages/border.hrc
@@ -43,13 +43,6 @@
#define IID_PRE_TABLE_ALL 20
#define IID_PRE_TABLE_OUTER2 21
-#define IL_SDW_BITMAPS 1500
-#define IID_SHADOWNONE 1
-#define IID_SHADOW_BOT_RIGHT 2
-#define IID_SHADOW_BOT_LEFT 3
-#define IID_SHADOW_TOP_RIGHT 4
-#define IID_SHADOW_TOP_LEFT 5
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/border.src b/cui/source/tabpages/border.src
index 2024616..00dc0f7 100644
--- a/cui/source/tabpages/border.src
+++ b/cui/source/tabpages/border.src
@@ -52,18 +52,29 @@ ImageList IL_PRE_BITMAPS
IdCount = { 21 ; };
};
-ImageList IL_SDW_BITMAPS
+Bitmap RID_SVXBMP_SHADOWNONE
{
- Prefix = "sh";
- IdList =
- {
- IID_SHADOWNONE ;
- IID_SHADOW_BOT_RIGHT ;
- IID_SHADOW_BOT_LEFT ;
- IID_SHADOW_TOP_RIGHT ;
- IID_SHADOW_TOP_LEFT ;
- };
- IdCount = { 5 ; };
+ File = "sh01.png";
+};
+
+Bitmap RID_SVXBMP_SHADOW_BOT_RIGHT
+{
+ File = "sh02.png";
+};
+
+Bitmap RID_SVXBMP_SHADOW_BOT_LEFT
+{
+ File = "sh03.png";
+};
+
+Bitmap RID_SVXBMP_SHADOW_TOP_RIGHT
+{
+ File = "sh04.png";
+};
+
+Bitmap RID_SVXBMP_SHADOW_TOP_LEFT
+{
+ File = "sh05.png";
};
String RID_SVXSTR_TABLE_PRESET_NONE
More information about the Libreoffice-commits
mailing list