[Libreoffice-commits] core.git: 2 commits - include/tools include/vcl rsc/inc rsc/source sc/inc sc/source sc/uiconfig sc/UIConfig_scalc.mk vcl/source
Caolán McNamara
caolanm at redhat.com
Mon Oct 24 14:07:10 UTC 2016
include/tools/rc.h | 3
include/tools/rcid.h | 2
include/vcl/fixed.hxx | 3
rsc/inc/rscdb.hxx | 1
rsc/source/parser/rscicpx.cxx | 18 -----
rsc/source/parser/rscinit.cxx | 4 -
sc/UIConfig_scalc.mk | 1
sc/inc/sc.hrc | 2
sc/source/ui/condformat/condformatdlgentry.cxx | 89 +++++++++++++++----------
sc/source/ui/inc/condformatdlg.hrc | 4 -
sc/source/ui/src/condformatdlg.src | 38 ----------
sc/uiconfig/scalc/ui/functionpanel.ui | 2
vcl/source/control/fixed.cxx | 25 -------
13 files changed, 55 insertions(+), 137 deletions(-)
New commits:
commit eac3793d4d92d75bffd9b282f75a9df20ec19299
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 24 14:35:15 2016 +0100
no FixedImage is loaded from .src anymore
Change-Id: I7c5acd18b14822d6344af3709c6d8cfb343104ef
diff --git a/include/tools/rc.h b/include/tools/rc.h
index 7eab5bf..5355e8f 100644
--- a/include/tools/rc.h
+++ b/include/tools/rc.h
@@ -48,9 +48,6 @@ namespace o3tl {
template<> struct typed_flags<RscWindowFlags> : is_typed_flags<RscWindowFlags, 0x37F> {};
}
-// For "FixedImage" resource:
-#define RSC_FIXEDIMAGE_IMAGE 0x0001
-
// For all menu resources:
enum class RscMenu {
Items = 0x01,
diff --git a/include/tools/rcid.h b/include/tools/rcid.h
index c88ee3c..5c2ed2f 100644
--- a/include/tools/rcid.h
+++ b/include/tools/rcid.h
@@ -55,8 +55,6 @@
#define RSC_TEXT (RSC_NOTYPE + 0x57)
-#define RSC_FIXEDIMAGE (RSC_NOTYPE + 0x5a)
-
#define RSC_STRINGARRAY (RSC_NOTYPE + 0x79)
// (RSC_NOTYPE + 0x200) - (RSC_NOTYPE + 0x300) reserved for Sfx
diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx
index 93dafda..0096a7e 100644
--- a/include/vcl/fixed.hxx
+++ b/include/vcl/fixed.hxx
@@ -161,11 +161,8 @@ private:
protected:
SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
const Point& rPos, const Size& rSize );
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
-
public:
explicit FixedImage( vcl::Window* pParent, WinBits nStyle = 0 );
- explicit FixedImage( vcl::Window* pParent, const ResId& );
virtual void ApplySettings(vcl::RenderContext&) override;
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index cbcafe0..4be970f 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -179,7 +179,6 @@ class RscTypCont
RscTop * InitClassEdit( RscTop * pSuper );
RscTop * InitClassListBox( RscTop * pSuper, RscArray * pStrLst );
RscTop * InitClassFixedText( RscTop * pSuper );
- RscTop * InitClassFixedImage( RscTop * pSuper, RscTop * pClassImage );
RscTop * InitClassKeyCode( RscTop * pSuper, RscEnum * pKey );
RscTop * InitClassMenuItem( RscTop * pSuper );
RscTop * InitClassMenu( RscTop * pSuper, RscTop * pMenuItem );
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index c502047..01c310d 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -360,24 +360,6 @@ RscTop * RscTypCont::InitClassFixedText( RscTop * pSuper )
return pClassFixedText;
}
-RscTop * RscTypCont::InitClassFixedImage( RscTop * pSuper, RscTop * pClassImage )
-{
- Atom nId;
- RscTop * pClassFixedImage;
-
- // initialize class
- nId = pHS->getID( "FixedImage" );
- pClassFixedImage = new RscClass( nId, RSC_FIXEDIMAGE, pSuper );
- pClassFixedImage->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType );
- aNmTb.Put( nId, CLASSNAME, pClassFixedImage );
-
- // initialize variables
- nId = aNmTb.Put( "Fixed", VARNAME );
- pClassFixedImage->SetVariable( nId, pClassImage, nullptr, 0, RSC_FIXEDIMAGE_IMAGE );
-
- return pClassFixedImage;
-}
-
RscTop * RscTypCont::InitClassKeyCode( RscTop * pSuper, RscEnum * pKey )
{
Atom nId;
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index 68bb4f7..7bd5ea7 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -68,7 +68,6 @@ void RscTypCont::Init()
RscTop * pClassEdit;
RscTop * pClassListBox;
RscTop * pClassFixedText;
- RscTop * pClassFixedImage;
RscTop * pClassKeyCode;
RscTop * pLangClassKeyCode;
@@ -315,9 +314,6 @@ void RscTypCont::Init()
pClassFixedText = InitClassFixedText( pClassControl );
pRoot->Insert( pClassFixedText );
- pClassFixedImage = InitClassFixedImage( pClassControl, pClassImage );
- pRoot->Insert( pClassFixedImage );
-
pClassKeyCode = InitClassKeyCode( pClassMgr, pKey );
pRoot->Insert( pClassKeyCode );
{
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 4e42bca..7af35fc 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -841,37 +841,12 @@ WinBits FixedImage::ImplInitStyle( WinBits nStyle )
return nStyle;
}
-void FixedImage::ImplLoadRes( const ResId& rResId )
-{
- Control::ImplLoadRes();
-
- sal_uLong nObjMask = ReadLongRes();
-
- if ( RSC_FIXEDIMAGE_IMAGE & nObjMask )
- {
- maImage = Image( ResId( static_cast<RSHEADER_TYPE*>(GetClassRes()), *rResId.GetResMgr() ) );
- IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE*>(GetClassRes()) ) );
- }
-}
-
FixedImage::FixedImage( vcl::Window* pParent, WinBits nStyle ) :
Control( WINDOW_FIXEDIMAGE )
{
ImplInit( pParent, nStyle );
}
-FixedImage::FixedImage( vcl::Window* pParent, const ResId& rResId ) :
- Control( WINDOW_FIXEDIMAGE )
-{
- rResId.SetRT( RSC_FIXEDIMAGE );
- WinBits nStyle = ImplInitRes( rResId );
- ImplInit( pParent, nStyle );
- ImplLoadRes( rResId );
-
- if ( !(nStyle & WB_HIDE) )
- Show();
-}
-
void FixedImage::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
const Point& rPos, const Size& rSize )
{
commit d0e204942332cd825edc3a38ebf331c02fd4dcfe
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 24 14:29:00 2016 +0100
convert ScIconSetFrmtDataEntry to .ui and layout
Change-Id: I38ab8ef4ac642b73f4a4bcd5b1c44ba987e2a55c
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index d50164b..db0f9a2 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -101,6 +101,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/colwidthdialog \
sc/uiconfig/scalc/ui/condformatmanager \
sc/uiconfig/scalc/ui/conditionalformatdialog \
+ sc/uiconfig/scalc/ui/conditionaliconset \
sc/uiconfig/scalc/ui/conflictsdialog \
sc/uiconfig/scalc/ui/consolidatedialog \
sc/uiconfig/scalc/ui/correlationdialog \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 8cfc7f3..07844b5 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1094,8 +1094,6 @@
#define RID_POPUP_FILTER (SC_DIALOGS_START + 153)
#define RID_COND_ENTRY (SC_DIALOGS_START + 156)
-#define RID_ICON_SET_ENTRY (SC_DIALOGS_START + 158)
-
#define RID_SCDLG_COND_FORMAT_MANAGER (SC_DIALOGS_START + 159)
#define WID_CONDFRMT_REF (SC_DIALOGS_START + 163)
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 32ba4ed..8bfabee 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1392,32 +1392,38 @@ IMPL_LINK_NOARG( ScDateFrmtEntry, StyleSelectHdl, ListBox&, void )
mbIsInStyleCreate = false;
}
-class ScIconSetFrmtDataEntry : public Control
-{
- private:
- VclPtr<FixedImage> maImgIcon;
- VclPtr<FixedText> maFtEntry;
- VclPtr<Edit> maEdEntry;
- VclPtr<ListBox> maLbEntryType;
-
- public:
- ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc,
- sal_Int32 i, const ScColorScaleEntry* pEntry = nullptr );
- virtual ~ScIconSetFrmtDataEntry() override;
- virtual void dispose() override;
-
- ScColorScaleEntry* CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const;
-
- void SetFirstEntry();
+class ScIconSetFrmtDataEntry : public VclContainer
+ , public VclBuilderContainer
+{
+private:
+ VclPtr<VclGrid> maGrid;
+ VclPtr<FixedImage> maImgIcon;
+ VclPtr<FixedText> maFtEntry;
+ VclPtr<Edit> maEdEntry;
+ VclPtr<ListBox> maLbEntryType;
+
+public:
+ ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc,
+ sal_Int32 i, const ScColorScaleEntry* pEntry = nullptr );
+ virtual ~ScIconSetFrmtDataEntry() override;
+ virtual Size calculateRequisition() const override;
+ virtual void setAllocation(const Size &rAllocation) override;
+ virtual void dispose() override;
+
+ ScColorScaleEntry* CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const;
+
+ void SetFirstEntry();
};
-ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc, sal_Int32 i, const ScColorScaleEntry* pEntry ):
- Control( pParent, ScResId( RID_ICON_SET_ENTRY ) ),
- maImgIcon( VclPtr<FixedImage>::Create( this, ScResId( IMG_ICON ) ) ),
- maFtEntry( VclPtr<FixedText>::Create( this, ScResId( FT_ICON_SET_ENTRY_TEXT ) ) ),
- maEdEntry( VclPtr<Edit>::Create( this, ScResId( ED_ICON_SET_ENTRY_VALUE ) ) ),
- maLbEntryType( VclPtr<ListBox>::Create( this, ScResId( LB_ICON_SET_ENTRY_TYPE ) ) )
+ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc, sal_Int32 i, const ScColorScaleEntry* pEntry)
+ : VclContainer(pParent)
{
+ m_pUIBuilder = new VclBuilder(this, getUIRootDir(), "modules/scalc/ui/conditionaliconset.ui");
+ get(maGrid, "ConditionalIconSet");
+ get(maImgIcon, "icon");
+ get(maFtEntry, "label");
+ get(maEdEntry, "entry");
+ get(maLbEntryType, "listbox");
maImgIcon->SetImage(Image(ScIconSetFormat::getBitmap(pDoc->GetIconSetBitmapMap(), eType, i)));
if(pEntry)
{
@@ -1447,7 +1453,16 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetT
{
maLbEntryType->SelectEntryPos(1);
}
- FreeResource();
+}
+
+Size ScIconSetFrmtDataEntry::calculateRequisition() const
+{
+ return getLayoutRequisition(*maGrid);
+}
+
+void ScIconSetFrmtDataEntry::setAllocation(const Size &rAllocation)
+{
+ setLayoutPosSize(*maGrid, Point(0, 0), rAllocation);
}
ScIconSetFrmtDataEntry::~ScIconSetFrmtDataEntry()
@@ -1457,11 +1472,13 @@ ScIconSetFrmtDataEntry::~ScIconSetFrmtDataEntry()
void ScIconSetFrmtDataEntry::dispose()
{
- maImgIcon.disposeAndClear();
- maFtEntry.disposeAndClear();
- maEdEntry.disposeAndClear();
- maLbEntryType.disposeAndClear();
- Control::dispose();
+ maImgIcon.clear();
+ maFtEntry.clear();
+ maEdEntry.clear();
+ maLbEntryType.clear();
+ maGrid.clear();
+ disposeBuilder();
+ VclContainer::dispose();
}
ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const
@@ -1528,9 +1545,10 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc,
{
maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create(
this, eType, pDoc, i, pIconSetFormatData->m_Entries[i].get()));
- Point aPos = maEntries[0]->GetPosPixel();
- aPos.Y() += maEntries[0]->GetSizePixel().Height() * i * 1.2;
- maEntries[i]->SetPosPixel( aPos );
+ Size aSize(maEntries[0]->get_preferred_size());
+ Point aPos(0, LogicToPixel(Size(0, 35), MapMode(MapUnit::MapAppFont)).getHeight());
+ aPos.Y() += aSize.Height() * i * 1.2;
+ maEntries[i]->SetPosSizePixel(aPos, aSize);
}
maEntries[0]->SetFirstEntry();
}
@@ -1576,9 +1594,10 @@ IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl, ListBox&, void )
for(size_t i = 0; i < nElements; ++i)
{
maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create( this, static_cast<ScIconSetType>(nPos), mpDoc, i ) );
- Point aPos = maEntries[0]->GetPosPixel();
- aPos.Y() += maEntries[0]->GetSizePixel().Height() * i * 1.2;
- maEntries[i]->SetPosPixel( aPos );
+ Size aSize(maEntries[0]->get_preferred_size());
+ Point aPos(0, LogicToPixel(Size(0, 35), MapMode(MapUnit::MapAppFont)).getHeight());
+ aPos.Y() += aSize.Height() * i * 1.2;
+ maEntries[i]->SetPosSizePixel(aPos, aSize);
maEntries[i]->Show();
}
maEntries[0]->SetFirstEntry();
diff --git a/sc/source/ui/inc/condformatdlg.hrc b/sc/source/ui/inc/condformatdlg.hrc
index a35e9d6..5390597 100644
--- a/sc/source/ui/inc/condformatdlg.hrc
+++ b/sc/source/ui/inc/condformatdlg.hrc
@@ -48,11 +48,7 @@
#define LB_DATE_TYPE 45
-#define IMG_ICON 46
#define LB_ICONSET_TYPE 47
-#define LB_ICON_SET_ENTRY_TYPE 48
-#define FT_ICON_SET_ENTRY_TEXT 49
-#define ED_ICON_SET_ENTRY_VALUE 50
#define FT_VAL 51
diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src
index ded2aa6..70d5b36 100644
--- a/sc/source/ui/src/condformatdlg.src
+++ b/sc/source/ui/src/condformatdlg.src
@@ -291,42 +291,4 @@ Control RID_COND_ENTRY
};
};
-Control RID_ICON_SET_ENTRY
-{
- Pos = MAP_APPFONT( 0, 35 );
- Size = MAP_APPFONT(300, 16);
- // Picture of the Icon
- FixedImage IMG_ICON
- {
- Pos = MAP_APPFONT( 5, 0 );
- Size = MAP_APPFONT( 16, 16 );
- };
- FixedText FT_ICON_SET_ENTRY_TEXT
- {
- Pos = MAP_APPFONT( 40, 0 );
- Size = MAP_APPFONT(40, 14);
- Text [en-US] = " >= ";
- };
- Edit ED_ICON_SET_ENTRY_VALUE
- {
- Pos = MAP_APPFONT( 90, 0 );
- Size = MAP_APPFONT( 40, 14 );
- Border = TRUE;
- };
- ListBox LB_ICON_SET_ENTRY_TYPE
- {
- Pos = MAP_APPFONT( 140, 0 );
- Size = MAP_APPFONT( 60, 40 );
- Border = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- "Value";
- "Percent";
- "Percentile";
- "Formula";
- };
- };
-};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/uiconfig/scalc/ui/functionpanel.ui b/sc/uiconfig/scalc/ui/functionpanel.ui
index c069660..1f367ce 100644
--- a/sc/uiconfig/scalc/ui/functionpanel.ui
+++ b/sc/uiconfig/scalc/ui/functionpanel.ui
@@ -101,7 +101,6 @@
</object>
<packing>
<property name="resize">True</property>
- <property name="shrink">True</property>
</packing>
</child>
<child>
@@ -117,7 +116,6 @@
</object>
<packing>
<property name="resize">False</property>
- <property name="shrink">True</property>
</packing>
</child>
</object>
More information about the Libreoffice-commits
mailing list