[Libreoffice-commits] core.git: 6 commits - cui/source cui/uiconfig cui/UIConfig_cui.mk extras/source include/svx svx/source
Caolán McNamara
caolanm at redhat.com
Fri Jan 31 13:22:10 PST 2014
cui/UIConfig_cui.mk | 2
cui/source/dialogs/cuigrfflt.cxx | 230 ++++++++++++++++++-------
cui/source/dialogs/grfflt.hrc | 15 -
cui/source/dialogs/grfflt.src | 154 ----------------
cui/source/factory/dlgfact.cxx | 24 +-
cui/source/factory/dlgfact.hxx | 13 -
cui/source/inc/cuigrfflt.hxx | 100 +++++++---
cui/uiconfig/ui/smoothdialog.ui | 188 ++++++++++++++++++++
cui/uiconfig/ui/solarizedialog.ui | 202 +++++++++++++++++++++
extras/source/glade/libreoffice-catalog.xml.in | 3
include/svx/dialogs.hrc | 2
include/svx/svxdlg.hxx | 4
svx/source/dialog/grfflt.cxx | 4
13 files changed, 669 insertions(+), 272 deletions(-)
New commits:
commit f86b075ebe0ce6abbe573b0663275de7baa0bd57
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 31 17:25:55 2014 +0000
drop unused resource id argument
it's the wrong resource id anyway
Change-Id: Ie1880d2b745f3da6ddf173d98b326aa2d45ce0fd
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index f751bb4..ea0341e 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1536,8 +1536,8 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterPos
return 0;
}
-AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSmooth ( Window* pParent,
- const Graphic& rGraphic, double nRadius, sal_uInt32)
+AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(Window* pParent,
+ const Graphic& rGraphic, double nRadius)
{
GraphicFilterDialog* pDlg = new GraphicFilterSmooth( pParent, rGraphic, nRadius );
return new AbstractGraphicFilterDialog_Impl( pDlg );
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index f455952..416a440 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -667,8 +667,7 @@ public:
const Graphic& rGraphic, sal_uInt16 nCount,
sal_uInt32 nResId);
virtual AbstractGraphicFilterDialog * CreateGraphicFilterSmooth (Window* pParent,
- const Graphic& rGraphic, double nRadius,
- sal_uInt32 nResId);
+ const Graphic& rGraphic, double nRadius);
virtual AbstractGraphicFilterDialog * CreateGraphicFilterSolarize (Window* pParent,
const Graphic& rGraphic, sal_uInt8 nGreyThreshold,
sal_Bool bInvert);
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 87da99f..f07f935 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -421,7 +421,7 @@ public:
sal_uInt32 nResId)=0;
virtual AbstractGraphicFilterDialog * CreateGraphicFilterSmooth (Window* pParent,
const Graphic& rGraphic,
- double nRadius, sal_uInt32 nResId)=0;
+ double nRadius)=0;
virtual AbstractGraphicFilterDialog * CreateGraphicFilterSolarize (Window* pParent,
const Graphic& rGraphic,
sal_uInt8 nGreyThreshold, sal_Bool bInvert)=0;
diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx
index 845166f..a7e974c 100644
--- a/svx/source/dialog/grfflt.cxx
+++ b/svx/source/dialog/grfflt.cxx
@@ -77,7 +77,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- AbstractGraphicFilterDialog* aDlg = pFact->CreateGraphicFilterSmooth( pWindow, rGraphic, 0.7, RID_SVX_GRFFILTER_DLG_SEPIA);
+ AbstractGraphicFilterDialog* aDlg = pFact->CreateGraphicFilterSmooth(pWindow, rGraphic, 0.7);
DBG_ASSERT(aDlg, "Dialogdiet fail!");
if( aDlg->Execute() == RET_OK )
aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 );
commit c8cae05ee8cfa0742865224b31d344317ceb996f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 31 16:37:01 2014 +0000
convert solarize dialog to .ui
Change-Id: I1aab18d8e0aa12d39584266a6657436ea100b521
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index d647970..d7b2fc6 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -148,6 +148,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/similaritysearchdialog \
cui/uiconfig/ui/slantcornertabpage \
cui/uiconfig/ui/smoothdialog \
+ cui/uiconfig/ui/solarizedialog \
cui/uiconfig/ui/specialcharacters \
cui/uiconfig/ui/spellingdialog \
cui/uiconfig/ui/spelloptionsdialog \
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index ccf1276..9c0bd8a 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -421,25 +421,18 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double
// ------------------
GraphicFilterSolarize::GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
- sal_uInt8 cGreyThreshold, sal_Bool bInvert ) :
- oldGraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_SOLARIZE ), rGraphic ),
- maFtThreshold ( this, CUI_RES( DLG_FILTERSOLARIZE_FT_THRESHOLD ) ),
- maMtrThreshold ( this, CUI_RES( DLG_FILTERSOLARIZE_MTR_THRESHOLD ) ),
- maCbxInvert ( this, CUI_RES( DLG_FILTERSOLARIZE_CBX_INVERT ) )
+ sal_uInt8 cGreyThreshold, sal_Bool bInvert )
+ : GraphicFilterDialog(pParent, "SolarizeDialog",
+ "cui/ui/solarizedialog.ui", rGraphic)
{
- FreeResource();
-
- maMtrThreshold.SetValue( FRound( cGreyThreshold / 2.55 ) );
- maMtrThreshold.SetModifyHdl( GetModifyHdl() );
-
- maCbxInvert.Check( bInvert );
- maCbxInvert.SetToggleHdl( GetModifyHdl() );
-}
+ get(mpMtrThreshold, "value");
+ get(mpCbxInvert, "invert");
-// -----------------------------------------------------------------------------
+ mpMtrThreshold->SetValue( FRound( cGreyThreshold / 2.55 ) );
+ mpMtrThreshold->SetModifyHdl( GetModifyHdl() );
-GraphicFilterSolarize::~GraphicFilterSolarize()
-{
+ mpCbxInvert->Check( bInvert );
+ mpCbxInvert->SetToggleHdl( GetModifyHdl() );
}
// -----------------------------------------------------------------------------
diff --git a/cui/source/dialogs/grfflt.hrc b/cui/source/dialogs/grfflt.hrc
index da6abb3..5b82014 100644
--- a/cui/source/dialogs/grfflt.hrc
+++ b/cui/source/dialogs/grfflt.hrc
@@ -40,14 +40,6 @@
#define DLG_FILTERMOSAIC_MTR_HEIGHT 4
#define DLG_FILTERMOSAIC_CBX_EDGES 5
-// ----------------------
-// - DLG_FILTERSOLARIZE -
-// ----------------------
-
-#define DLG_FILTERSOLARIZE_FT_THRESHOLD 1
-#define DLG_FILTERSOLARIZE_MTR_THRESHOLD 2
-#define DLG_FILTERSOLARIZE_CBX_INVERT 3
-
// -------------------
// - DLG_FILTERSEPIA -
// -------------------
diff --git a/cui/source/dialogs/grfflt.src b/cui/source/dialogs/grfflt.src
index 23192ec..4b34f90 100644
--- a/cui/source/dialogs/grfflt.src
+++ b/cui/source/dialogs/grfflt.src
@@ -130,88 +130,6 @@ ModalDialog RID_SVX_GRFFILTER_DLG_MOSAIC
};
};
-// ----------------------
-// - DLG_FILTERSOLARIZE -
-// ----------------------
-
-ModalDialog RID_SVX_GRFFILTER_DLG_SOLARIZE
-{
- HelpID = CMD_SID_GRFFILTER_SOLARIZE;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 250, 100 ) ;
-
- Text [ en-US ] = "Solarization" ;
-
- FixedLine FL_PARAMETER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 182, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Parameters";
- };
- Control CTL_PREVIEW
- {
- Pos = MAP_APPFONT ( 104 , 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( 81, 73 ) ;
- };
-#define MA_Y5 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- FixedText DLG_FILTERSOLARIZE_FT_THRESHOLD
- {
- Pos = MAP_APPFONT ( 12, MA_Y5 ) ;
- Size = MAP_APPFONT ( 77 , 10 ) ;
- Text [ en-US ] = "Threshold ~value" ;
- };
-#define MA_Y6 MA_Y5 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
- MetricField DLG_FILTERSOLARIZE_MTR_THRESHOLD
- {
- HelpID = "cui:MetricField:RID_SVX_GRFFILTER_DLG_SOLARIZE:DLG_FILTERSOLARIZE_MTR_THRESHOLD";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , MA_Y6 ) ;
- Size = MAP_APPFONT ( 35 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_PERCENT ;
- Last = 100 ;
- SpinSize = 1 ;
- };
-#define MA_Y7 MA_Y6 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y
- CheckBox DLG_FILTERSOLARIZE_CBX_INVERT
- {
- HelpID = "cui:CheckBox:RID_SVX_GRFFILTER_DLG_SOLARIZE:DLG_FILTERSOLARIZE_CBX_INVERT";
- Pos = MAP_APPFONT ( 12, 46 ) ;
- Size = MAP_APPFONT ( 77, 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Invert" ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 194, 6 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 194, 23 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 194, 43 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-// ----------------------
-// - DLG_FILTERSOLARIZE -
-// ----------------------
-
ModalDialog RID_SVX_GRFFILTER_DLG_SEPIA
{
HelpID = CMD_SID_GRFFILTER_SEPIA;
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index a1f2063..f751bb4 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1544,10 +1544,10 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSmo
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSolarize (Window* pParent,
- const Graphic& rGraphic, sal_uInt8 nGreyThreshold, sal_Bool bInvert, sal_uInt32 )
+ const Graphic& rGraphic, sal_uInt8 nGreyThreshold, sal_Bool bInvert)
{
- oldGraphicFilterDialog* pDlg = new GraphicFilterSolarize( pParent, rGraphic, nGreyThreshold, bInvert );
- return new oldAbstractGraphicFilterDialog_Impl( pDlg );
+ GraphicFilterDialog* pDlg = new GraphicFilterSolarize( pParent, rGraphic, nGreyThreshold, bInvert );
+ return new AbstractGraphicFilterDialog_Impl( pDlg );
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMosaic (Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 4408c03..f455952 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -671,7 +671,7 @@ public:
sal_uInt32 nResId);
virtual AbstractGraphicFilterDialog * CreateGraphicFilterSolarize (Window* pParent,
const Graphic& rGraphic, sal_uInt8 nGreyThreshold,
- sal_Bool bInvert, sal_uInt32 nResId);
+ sal_Bool bInvert);
virtual AbstractGraphicFilterDialog * CreateGraphicFilterMosaic (Window* pParent,
const Graphic& rGraphic, sal_uInt16 nTileWidth, sal_uInt16 nTileHeight,
sal_Bool bEnhanceEdges, sal_uInt32 nResId);
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index edd3143..79c836b 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -185,23 +185,20 @@ public:
// - GraphicFilterSolarize -
// -------------------------
-class GraphicFilterSolarize : public oldGraphicFilterDialog
+class GraphicFilterSolarize : public GraphicFilterDialog
{
private:
-
- FixedText maFtThreshold;
- MetricField maMtrThreshold;
- CheckBox maCbxInvert;
+ MetricField* mpMtrThreshold;
+ CheckBox* mpCbxInvert;
public:
- GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
+ GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
sal_uInt8 nGreyThreshold, sal_Bool bInvert );
- ~GraphicFilterSolarize();
- virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
- sal_uInt8 GetGreyThreshold() const { return( (sal_uInt8) FRound( maMtrThreshold.GetValue() * 2.55 ) ); }
- sal_Bool IsInvert() const { return maCbxInvert.IsChecked(); }
+ virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
+ sal_uInt8 GetGreyThreshold() const { return( (sal_uInt8) FRound( mpMtrThreshold->GetValue() * 2.55 ) ); }
+ sal_Bool IsInvert() const { return mpCbxInvert->IsChecked(); }
};
// ----------------------
diff --git a/cui/uiconfig/ui/solarizedialog.ui b/cui/uiconfig/ui/solarizedialog.ui
new file mode 100644
index 0000000..c1f7c92
--- /dev/null
+++ b/cui/uiconfig/ui/solarizedialog.ui
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkDialog" id="SolarizeDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Solarization</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="column_spacing">24</property>
+ <child>
+ <object class="cuilo-GraphicPreviewWindow" id="preview">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkSpinButton" id="value:0%">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Threshold _value</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">value:0%</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="invert">
+ <property name="label" translatable="yes">_Invert</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Parameters</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ <action-widget response="0">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 0041752..de78b8d 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -101,7 +101,6 @@
#define RID_SVX_GRFFILTER_DLG_SEPIA (RID_SVX_START + 334)
#define RID_SVX_GRFFILTER_DLG_POSTER (RID_SVX_START + 335)
#define RID_SVX_GRFFILTER_DLG_MOSAIC (RID_SVX_START + 332)
-#define RID_SVX_GRFFILTER_DLG_SOLARIZE (RID_SVX_START + 333)
#define RID_SVX_GRFFILTER_DLG_EMBOSS (RID_SVX_START + 336)
#define RID_SVXDLG_CHARMAP ( RID_SVX_START + 10 )
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 4d51d1c..87da99f 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -424,7 +424,7 @@ public:
double nRadius, sal_uInt32 nResId)=0;
virtual AbstractGraphicFilterDialog * CreateGraphicFilterSolarize (Window* pParent,
const Graphic& rGraphic,
- sal_uInt8 nGreyThreshold, sal_Bool bInvert, sal_uInt32 nResId)=0;
+ sal_uInt8 nGreyThreshold, sal_Bool bInvert)=0;
virtual AbstractGraphicFilterDialog * CreateGraphicFilterMosaic (Window* pParent,
const Graphic& rGraphic,
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges, sal_uInt32 nResId)=0;
diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx
index 74ad3d1..845166f 100644
--- a/svx/source/dialog/grfflt.cxx
+++ b/svx/source/dialog/grfflt.cxx
@@ -247,7 +247,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- AbstractGraphicFilterDialog* aDlg = pFact->CreateGraphicFilterSolarize( pWindow, rGraphic, 128, sal_False, RID_SVX_GRFFILTER_DLG_SOLARIZE );
+ AbstractGraphicFilterDialog* aDlg = pFact->CreateGraphicFilterSolarize(pWindow, rGraphic, 128, sal_False);
DBG_ASSERT(aDlg, "Dialogdiet fail!");
if( aDlg->Execute() == RET_OK )
aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 );
commit e70fb08305fdb3ad54c17f979c64996a7f043dcd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 31 10:06:06 2014 +0000
convert smooth dialog to .ui
Change-Id: If2894cef70bf6b9848a1338afaa36dc8b0d7d6be
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index d57d883..d647970 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -147,6 +147,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/showcoldialog \
cui/uiconfig/ui/similaritysearchdialog \
cui/uiconfig/ui/slantcornertabpage \
+ cui/uiconfig/ui/smoothdialog \
cui/uiconfig/ui/specialcharacters \
cui/uiconfig/ui/spellingdialog \
cui/uiconfig/ui/spelloptionsdialog \
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 06381de..ccf1276 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -18,6 +18,7 @@
*/
#include <tools/shl.hxx>
+#include <vcl/builder.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/viewsh.hxx>
@@ -143,7 +144,7 @@ IMPL_LINK_NOARG(oldGraphicFilterDialog, ImplModifyHdl)
return 0;
}
-GraphicFilterDialog::PreviewWindow::PreviewWindow(Window* pParent,
+GraphicPreviewWindow::GraphicPreviewWindow(Window* pParent,
const WinBits nStyle)
: Control(pParent, nStyle)
, mpOrigGraphic(NULL)
@@ -152,14 +153,25 @@ GraphicFilterDialog::PreviewWindow::PreviewWindow(Window* pParent,
{
}
-Size GraphicFilterDialog::PreviewWindow::GetOptimalSize() const
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeGraphicPreviewWindow(Window *pParent, VclBuilder::stringmap &rMap)
+{
+ WinBits nWinBits = WB_TABSTOP;
+
+ OString sBorder = VclBuilder::extractCustomProperty(rMap);
+ if (!sBorder.isEmpty())
+ nWinBits |= WB_BORDER;
+
+ return new GraphicPreviewWindow(pParent, nWinBits);
+}
+
+Size GraphicPreviewWindow::GetOptimalSize() const
{
return LogicToPixel(Size(81, 73), MAP_APPFONT);
}
// -----------------------------------------------------------------------------
-void GraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
+void GraphicPreviewWindow::Paint( const Rectangle& rRect )
{
Control::Paint( rRect );
@@ -183,21 +195,19 @@ void GraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
// -----------------------------------------------------------------------------
-void GraphicFilterDialog::PreviewWindow::SetPreview( const Graphic& rGraphic )
+void GraphicPreviewWindow::SetPreview( const Graphic& rGraphic )
{
maPreview = rGraphic;
-
- if( maPreview.IsAnimated() || maPreview.IsTransparent() )
- Invalidate();
- else
- Paint( Rectangle( Point(), GetOutputSizePixel() ) );
+ Invalidate();
}
-void GraphicFilterDialog::PreviewWindow::ScaleImageToFit()
+void GraphicPreviewWindow::ScaleImageToFit()
{
if (!mpOrigGraphic)
return;
+ maScaledOrig = *mpOrigGraphic;
+
const Size aPreviewSize( GetOutputSizePixel() );
Size aSizePixel(LogicToPixel(mpOrigGraphic->GetPrefSize(),
mpOrigGraphic->GetPrefMapMode()));
@@ -229,12 +239,14 @@ void GraphicFilterDialog::PreviewWindow::ScaleImageToFit()
BitmapEx aBmpEx( mpOrigGraphic->GetBitmapEx() );
if( aBmpEx.Scale( aGrfSize, BMP_SCALE_DEFAULT ) )
- maPreview = aBmpEx;
+ maScaledOrig = aBmpEx;
}
}
+
+ maModifyHdl.Call(this);
}
-void GraphicFilterDialog::PreviewWindow::Resize()
+void GraphicPreviewWindow::Resize()
{
Control::Resize();
ScaleImageToFit();
@@ -250,14 +262,12 @@ GraphicFilterDialog::GraphicFilterDialog(Window* pParent,
{
bIsBitmap = rGraphic.GetType() == GRAPHIC_BITMAP;
- get(mpPreview, "preview");
- mpPreview->init(&rGraphic);
-
maTimer.SetTimeoutHdl( LINK( this, GraphicFilterDialog, ImplPreviewTimeoutHdl ) );
- maTimer.SetTimeout( 100 );
- ImplModifyHdl( NULL );
-}
+ maTimer.SetTimeout( 5 );
+ get(mpPreview, "preview");
+ mpPreview->init(&rGraphic, maModifyHdl);
+}
// -----------------------------------------------------------------------------
@@ -366,22 +376,15 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
// - GraphicFilterSmooth -
// ------------------
-GraphicFilterSmooth::GraphicFilterSmooth( Window* pParent, const Graphic& rGraphic, double nRadius) :
- oldGraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_SMOOTH ), rGraphic ),
- maFtRadius ( this, CUI_RES( DLG_FILTERSMOOTH_FT_RADIUS ) ),
- maMtrRadius ( this, CUI_RES( DLG_FILTERSMOOTH_MTR_RADIUS ) )
+GraphicFilterSmooth::GraphicFilterSmooth( Window* pParent, const Graphic& rGraphic, double nRadius)
+ : GraphicFilterDialog(pParent, "SmoothDialog",
+ "cui/ui/smoothdialog.ui", rGraphic)
{
- FreeResource();
-
- maMtrRadius.SetValue( nRadius* 10 );
- maMtrRadius.SetModifyHdl( GetModifyHdl() );
- maMtrRadius.GrabFocus();
-}
+ get(mpMtrRadius, "radius");
-// -----------------------------------------------------------------------------
-
-GraphicFilterSmooth::~GraphicFilterSmooth()
-{
+ mpMtrRadius->SetValue( nRadius* 10 );
+ mpMtrRadius->SetModifyHdl( GetModifyHdl() );
+ mpMtrRadius->GrabFocus();
}
// -----------------------------------------------------------------------------
diff --git a/cui/source/dialogs/grfflt.hrc b/cui/source/dialogs/grfflt.hrc
index 976d8b0..da6abb3 100644
--- a/cui/source/dialogs/grfflt.hrc
+++ b/cui/source/dialogs/grfflt.hrc
@@ -41,13 +41,6 @@
#define DLG_FILTERMOSAIC_CBX_EDGES 5
// ----------------------
-// - DLG_FILTERSMOOTH -
-// ----------------------
-
-#define DLG_FILTERSMOOTH_FT_RADIUS 1
-#define DLG_FILTERSMOOTH_MTR_RADIUS 2
-
-// ----------------------
// - DLG_FILTERSOLARIZE -
// ----------------------
diff --git a/cui/source/dialogs/grfflt.src b/cui/source/dialogs/grfflt.src
index ff1cfb2..23192ec 100644
--- a/cui/source/dialogs/grfflt.src
+++ b/cui/source/dialogs/grfflt.src
@@ -412,76 +412,4 @@ ModalDialog RID_SVX_GRFFILTER_DLG_EMBOSS
};
};
-// --------------------
-// - DLG_FILTERSMOOTH -
-// --------------------
-
-ModalDialog RID_SVX_GRFFILTER_DLG_SMOOTH
-{
- HelpID = CMD_SID_GRFFILTER_SMOOTH;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 250, 100 ) ;
-
- Text [ en-US ] = "Smooth" ;
-
- FixedLine FL_PARAMETER
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 182, RSC_CD_FIXEDLINE_HEIGHT ) ;
- Text [ en-US ] = "Parameters";
- };
- Control CTL_PREVIEW
- {
- Pos = MAP_APPFONT ( 104 , 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ) ;
- Size = MAP_APPFONT ( 81, 73 ) ;
- };
-#define MA_Y14 3 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP
- FixedText DLG_FILTERSMOOTH_FT_RADIUS
- {
- Pos = MAP_APPFONT ( 12 , MA_Y14 ) ;
- Size = MAP_APPFONT ( 77 , 10 ) ;
- Text [ en-US ] = "Smooth Radius" ;
- };
-#define MA_Y15 MA_Y14 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_DESC_Y
- NumericField DLG_FILTERSMOOTH_MTR_RADIUS
- {
- HelpID = "cui:NumericField:RID_SVX_GRFFILTER_DLG_SMOOTH:DLG_FILTERSMOOTH_MTR_RADIUS";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , MA_Y15 );
- Size = MAP_APPFONT ( 35 , 12 );
- TabStop = TRUE;
- Right = TRUE;
- Repeat = TRUE;
- Spin = TRUE;
- Minimum = 0;
- Maximum = 1000;
- StrictFormat = TRUE;
- First = 1;
- DecimalDigits = 1;
- Last = 1000;
- SpinSize = 2;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 194, 6 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 194, 23 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 194, 43 ) ;
- Size = MAP_APPFONT ( 50, 14 ) ;
- TabStop = TRUE ;
- };
-};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 730d819..a1f2063 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -140,6 +140,7 @@ IMPL_ABSTDLG_BASE(AbstractSvxMultiFileDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractSvxHpLinkDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractFmSearchDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractGraphicFilterDialog_Impl);
+IMPL_ABSTDLG_BASE(oldAbstractGraphicFilterDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractSvxAreaTabDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractPasteDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractInsertObjectDialog_Impl);
@@ -877,6 +878,11 @@ Graphic AbstractGraphicFilterDialog_Impl::GetFilteredGraphic( const Graphic& rGr
return pDlg->GetFilteredGraphic( rGraphic, fScaleX, fScaleY );
}
+Graphic oldAbstractGraphicFilterDialog_Impl::GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY )
+{
+ return pDlg->GetFilteredGraphic( rGraphic, fScaleX, fScaleY );
+}
+
// AbstractSvxAreaTabDialog implementations just forwards everything to the dialog
void AbstractSvxAreaTabDialog_Impl::SetCurPageId( sal_uInt16 nId )
{
@@ -1503,7 +1509,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterEmb
sal_uInt32)
{
oldGraphicFilterDialog* pDlg = new GraphicFilterEmboss( pParent, rGraphic, eLightSource );
- return new AbstractGraphicFilterDialog_Impl( pDlg );
+ return new oldAbstractGraphicFilterDialog_Impl( pDlg );
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterPosterSepia (Window* pParent,
@@ -1526,14 +1532,14 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterPos
}
if ( pDlg )
- return new AbstractGraphicFilterDialog_Impl( pDlg );
+ return new oldAbstractGraphicFilterDialog_Impl( pDlg );
return 0;
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSmooth ( Window* pParent,
const Graphic& rGraphic, double nRadius, sal_uInt32)
{
- oldGraphicFilterDialog* pDlg = new GraphicFilterSmooth( pParent, rGraphic, nRadius );
+ GraphicFilterDialog* pDlg = new GraphicFilterSmooth( pParent, rGraphic, nRadius );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1541,7 +1547,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSol
const Graphic& rGraphic, sal_uInt8 nGreyThreshold, sal_Bool bInvert, sal_uInt32 )
{
oldGraphicFilterDialog* pDlg = new GraphicFilterSolarize( pParent, rGraphic, nGreyThreshold, bInvert );
- return new AbstractGraphicFilterDialog_Impl( pDlg );
+ return new oldAbstractGraphicFilterDialog_Impl( pDlg );
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMosaic (Window* pParent,
@@ -1559,7 +1565,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMos
}
if ( pDlg )
- return new AbstractGraphicFilterDialog_Impl( pDlg );
+ return new oldAbstractGraphicFilterDialog_Impl( pDlg );
return 0;
}
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 909c8fd..4408c03 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -47,6 +47,7 @@ class SvxHpLinkDlg;
class FmSearchDialog;
class Graphic;
class oldGraphicFilterDialog;
+class GraphicFilterDialog;
class SvxAreaTabDialog;
class InsertObjectDialog_Impl;
class SvPasteObjectDialog;
@@ -438,7 +439,13 @@ class AbstractFmSearchDialog_Impl :public AbstractFmSearchDialog
class AbstractGraphicFilterDialog_Impl :public AbstractGraphicFilterDialog
{
- DECL_ABSTDLG_BASE(AbstractGraphicFilterDialog_Impl,oldGraphicFilterDialog)
+ DECL_ABSTDLG_BASE(AbstractGraphicFilterDialog_Impl,GraphicFilterDialog)
+ virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
+};
+
+class oldAbstractGraphicFilterDialog_Impl :public AbstractGraphicFilterDialog
+{
+ DECL_ABSTDLG_BASE(oldAbstractGraphicFilterDialog_Impl,oldGraphicFilterDialog)
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
};
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index 04d8da2..edd3143 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -80,40 +80,40 @@ public:
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0;
};
-class GraphicFilterDialog : public ModalDialog
+class GraphicPreviewWindow : public Control
{
private:
+ const Graphic* mpOrigGraphic;
+ Link maModifyHdl;
+ Graphic maScaledOrig;
+ Graphic maPreview;
+ double mfScaleX;
+ double mfScaleY;
- class PreviewWindow : public Control
- {
- private:
- const Graphic* mpOrigGraphic;
- Graphic maScaledOrig;
- Graphic maPreview;
- double mfScaleX;
- double mfScaleY;
+ virtual void Paint(const Rectangle& rRect);
+ virtual void Resize();
+ virtual Size GetOptimalSize() const;
- virtual void Paint(const Rectangle& rRect);
- virtual void Resize();
- virtual Size GetOptimalSize() const;
+ void ScaleImageToFit();
- void ScaleImageToFit();
-
- public:
+public:
- PreviewWindow(Window* pParent, WinBits nStyle);
- void init(const Graphic *pOrigGraphic)
- {
- mpOrigGraphic = pOrigGraphic;
- ScaleImageToFit();
- }
-
- void SetPreview(const Graphic& rGraphic);
- const Graphic& GetScaledOriginal() const { return maScaledOrig; }
- double GetScaleX() const { return mfScaleX; }
- double GetScaleY() const { return mfScaleY; }
- };
+ GraphicPreviewWindow(Window* pParent, WinBits nStyle);
+ void init(const Graphic* pOrigGraphic, const Link& rLink)
+ {
+ mpOrigGraphic = pOrigGraphic;
+ maModifyHdl = rLink;
+ ScaleImageToFit();
+ }
+
+ void SetPreview(const Graphic& rGraphic);
+ const Graphic& GetScaledOriginal() const { return maScaledOrig; }
+ double GetScaleX() const { return mfScaleX; }
+ double GetScaleY() const { return mfScaleY; }
+};
+class GraphicFilterDialog : public ModalDialog
+{
private:
Timer maTimer;
@@ -125,7 +125,7 @@ private:
DECL_LINK( ImplModifyHdl, void* p );
protected:
- PreviewWindow* mpPreview;
+ GraphicPreviewWindow* mpPreview;
const Link& GetModifyHdl() const { return maModifyHdl; }
const Size& GetGraphicSizePixel() const { return maSizePixel; }
@@ -142,20 +142,17 @@ public:
// - GraphicFilterSmooth -
// -------------------------
-class GraphicFilterSmooth : public oldGraphicFilterDialog
+class GraphicFilterSmooth : public GraphicFilterDialog
{
private:
-
- FixedText maFtRadius;
- NumericField maMtrRadius;
+ NumericField* mpMtrRadius;
public:
GraphicFilterSmooth( Window* pParent, const Graphic& rGraphic, double nRadius);
- ~GraphicFilterSmooth();
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
- double GetRadius() const { return maMtrRadius.GetValue() / 10.0; }
+ double GetRadius() const { return mpMtrRadius->GetValue() / 10.0; }
};
// -----------------------
diff --git a/cui/uiconfig/ui/smoothdialog.ui b/cui/uiconfig/ui/smoothdialog.ui
new file mode 100644
index 0000000..b5619cf
--- /dev/null
+++ b/cui/uiconfig/ui/smoothdialog.ui
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="lower">0.10000000000000001</property>
+ <property name="upper">100</property>
+ <property name="value">0.59999999999999998</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkDialog" id="SmoothDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Smooth</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="column_spacing">24</property>
+ <child>
+ <object class="cuilo-GraphicPreviewWindow" id="preview">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkSpinButton" id="radius">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">adjustment1</property>
+ <property name="digits">1</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Smooth Radius</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">radius</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Parameters</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ <action-widget response="0">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 659be28..3ce5a4b 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -235,6 +235,9 @@
<glade-widget-class title="Number Preview" name="cuilo-SvxNumberPreview"
generic-name="Number Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
+ <glade-widget-class title="Graphic Preview" name="cuilo-GraphicPreviewWindow"
+ generic-name="Graphic Preview Window" parent="GtkDrawingArea"
+ icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Writer Number Preview" name="swuilo-NumberingPreview"
generic-name="Writer Number Preview Window" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 3a2307a..0041752 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -103,7 +103,6 @@
#define RID_SVX_GRFFILTER_DLG_MOSAIC (RID_SVX_START + 332)
#define RID_SVX_GRFFILTER_DLG_SOLARIZE (RID_SVX_START + 333)
#define RID_SVX_GRFFILTER_DLG_EMBOSS (RID_SVX_START + 336)
-#define RID_SVX_GRFFILTER_DLG_SMOOTH (RID_SVX_START + 337)
#define RID_SVXDLG_CHARMAP ( RID_SVX_START + 10 )
// IDs of options pages of applications
commit 344a1abd2f28f4556746f72a06358a08dd23abbe
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 31 09:57:37 2014 +0000
introduce a layout aware GraphicFilterDialog
Change-Id: I932e4be6b7f4a2717748de561c424302ef429d63
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index d7ac4ba..06381de 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -29,10 +29,6 @@
#include <cuires.hrc>
#include <svx/dialogs.hrc>
-// --------------------------------------
-// - oldGraphicFilterDialog::PreviewWindow -
-// --------------------------------------
-
oldGraphicFilterDialog::PreviewWindow::PreviewWindow( Window* pParent, const ResId& rResId ) :
Control( pParent, rResId )
{
@@ -74,10 +70,6 @@ void oldGraphicFilterDialog::PreviewWindow::SetGraphic( const Graphic& rGraphic
Paint( Rectangle( Point(), GetOutputSizePixel() ) );
}
-// -----------------------
-// - oldGraphicFilterDialog -
-// -----------------------
-
oldGraphicFilterDialog::oldGraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic ) :
ModalDialog ( pParent, rResId ),
maModifyHdl ( LINK( this, oldGraphicFilterDialog, ImplModifyHdl ) ),
@@ -151,6 +143,146 @@ IMPL_LINK_NOARG(oldGraphicFilterDialog, ImplModifyHdl)
return 0;
}
+GraphicFilterDialog::PreviewWindow::PreviewWindow(Window* pParent,
+ const WinBits nStyle)
+ : Control(pParent, nStyle)
+ , mpOrigGraphic(NULL)
+ , mfScaleX(0.0)
+ , mfScaleY(0.0)
+{
+}
+
+Size GraphicFilterDialog::PreviewWindow::GetOptimalSize() const
+{
+ return LogicToPixel(Size(81, 73), MAP_APPFONT);
+}
+
+// -----------------------------------------------------------------------------
+
+void GraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
+{
+ Control::Paint( rRect );
+
+ const Size aOutputSize( GetOutputSizePixel() );
+
+ if( maPreview.IsAnimated() )
+ {
+ const Size aGraphicSize( LogicToPixel( maPreview.GetPrefSize(), maPreview.GetPrefMapMode() ) );
+ const Point aGraphicPosition( ( aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
+ ( aOutputSize.Height() - aGraphicSize.Height() ) >> 1 );
+ maPreview.StartAnimation( this, aGraphicPosition, aGraphicSize );
+ }
+ else
+ {
+ const Size aGraphicSize( maPreview.GetSizePixel() );
+ const Point aGraphicPosition( ( aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
+ ( aOutputSize.Height() - aGraphicSize.Height() ) >> 1 );
+ maPreview.Draw( this, aGraphicPosition, aGraphicSize );
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void GraphicFilterDialog::PreviewWindow::SetPreview( const Graphic& rGraphic )
+{
+ maPreview = rGraphic;
+
+ if( maPreview.IsAnimated() || maPreview.IsTransparent() )
+ Invalidate();
+ else
+ Paint( Rectangle( Point(), GetOutputSizePixel() ) );
+}
+
+void GraphicFilterDialog::PreviewWindow::ScaleImageToFit()
+{
+ if (!mpOrigGraphic)
+ return;
+
+ const Size aPreviewSize( GetOutputSizePixel() );
+ Size aSizePixel(LogicToPixel(mpOrigGraphic->GetPrefSize(),
+ mpOrigGraphic->GetPrefMapMode()));
+ Size aGrfSize(aSizePixel);
+
+ if( mpOrigGraphic->GetType() == GRAPHIC_BITMAP &&
+ aPreviewSize.Width() && aPreviewSize.Height() &&
+ aGrfSize.Width() && aGrfSize.Height() )
+ {
+ const double fGrfWH = (double) aGrfSize.Width() / aGrfSize.Height();
+ const double fPreWH = (double) aPreviewSize.Width() / aPreviewSize.Height();
+
+ if( fGrfWH < fPreWH )
+ {
+ aGrfSize.Width() = (long) ( aPreviewSize.Height() * fGrfWH );
+ aGrfSize.Height() = aPreviewSize.Height();
+ }
+ else
+ {
+ aGrfSize.Width() = aPreviewSize.Width();
+ aGrfSize.Height() = (long) ( aPreviewSize.Width() / fGrfWH );
+ }
+
+ mfScaleX = (double) aGrfSize.Width() / aSizePixel.Width();
+ mfScaleY = (double) aGrfSize.Height() / aSizePixel.Height();
+
+ if( !mpOrigGraphic->IsAnimated() )
+ {
+ BitmapEx aBmpEx( mpOrigGraphic->GetBitmapEx() );
+
+ if( aBmpEx.Scale( aGrfSize, BMP_SCALE_DEFAULT ) )
+ maPreview = aBmpEx;
+ }
+ }
+}
+
+void GraphicFilterDialog::PreviewWindow::Resize()
+{
+ Control::Resize();
+ ScaleImageToFit();
+}
+
+GraphicFilterDialog::GraphicFilterDialog(Window* pParent,
+ const OString& rID, const OUString& rUIXMLDescription,
+ const Graphic& rGraphic)
+ : ModalDialog(pParent, rID, rUIXMLDescription)
+ , maModifyHdl(LINK( this, GraphicFilterDialog, ImplModifyHdl))
+ , maSizePixel(LogicToPixel(rGraphic.GetPrefSize(),
+ rGraphic.GetPrefMapMode()))
+{
+ bIsBitmap = rGraphic.GetType() == GRAPHIC_BITMAP;
+
+ get(mpPreview, "preview");
+ mpPreview->init(&rGraphic);
+
+ maTimer.SetTimeoutHdl( LINK( this, GraphicFilterDialog, ImplPreviewTimeoutHdl ) );
+ maTimer.SetTimeout( 100 );
+ ImplModifyHdl( NULL );
+}
+
+
+// -----------------------------------------------------------------------------
+
+IMPL_LINK_NOARG(GraphicFilterDialog, ImplPreviewTimeoutHdl)
+{
+ maTimer.Stop();
+ mpPreview->SetPreview(GetFilteredGraphic(mpPreview->GetScaledOriginal(),
+ mpPreview->GetScaleX(), mpPreview->GetScaleY()));
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------------
+
+IMPL_LINK_NOARG(GraphicFilterDialog, ImplModifyHdl)
+{
+ if (bIsBitmap)
+ {
+ maTimer.Stop();
+ maTimer.Start();
+ }
+
+ return 0;
+}
+
// ----------------
// - FilterMosaic -
// ----------------
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index b4fcfac..04d8da2 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -32,10 +32,6 @@
#include <svx/dlgctrl.hxx>
#include <svx/rectenum.hxx>
-// -----------------------
-// - oldGraphicFilterDialog -
-// -----------------------
-
class oldGraphicFilterDialog : public ModalDialog
{
private:
@@ -84,6 +80,64 @@ public:
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0;
};
+class GraphicFilterDialog : public ModalDialog
+{
+private:
+
+ class PreviewWindow : public Control
+ {
+ private:
+ const Graphic* mpOrigGraphic;
+ Graphic maScaledOrig;
+ Graphic maPreview;
+ double mfScaleX;
+ double mfScaleY;
+
+ virtual void Paint(const Rectangle& rRect);
+ virtual void Resize();
+ virtual Size GetOptimalSize() const;
+
+ void ScaleImageToFit();
+
+ public:
+
+ PreviewWindow(Window* pParent, WinBits nStyle);
+ void init(const Graphic *pOrigGraphic)
+ {
+ mpOrigGraphic = pOrigGraphic;
+ ScaleImageToFit();
+ }
+
+ void SetPreview(const Graphic& rGraphic);
+ const Graphic& GetScaledOriginal() const { return maScaledOrig; }
+ double GetScaleX() const { return mfScaleX; }
+ double GetScaleY() const { return mfScaleY; }
+ };
+
+private:
+
+ Timer maTimer;
+ Link maModifyHdl;
+ Size maSizePixel;
+ bool bIsBitmap;
+
+ DECL_LINK(ImplPreviewTimeoutHdl, void *);
+ DECL_LINK( ImplModifyHdl, void* p );
+
+protected:
+ PreviewWindow* mpPreview;
+
+ const Link& GetModifyHdl() const { return maModifyHdl; }
+ const Size& GetGraphicSizePixel() const { return maSizePixel; }
+
+public:
+
+ GraphicFilterDialog(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const Graphic& rGraphic);
+
+ virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0;
+};
+
+
// -------------------------
// - GraphicFilterSmooth -
// -------------------------
commit b0da0f644330b78a2c11842a90ff71fe95d8419d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 31 09:07:26 2014 +0000
GraphicFilterDialog->oldGraphicFilterDialog
Change-Id: I13eb7c462538520c119391ad54fac2c0e0d052e9
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 4009454..d7ac4ba 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -30,17 +30,17 @@
#include <svx/dialogs.hrc>
// --------------------------------------
-// - GraphicFilterDialog::PreviewWindow -
+// - oldGraphicFilterDialog::PreviewWindow -
// --------------------------------------
-GraphicFilterDialog::PreviewWindow::PreviewWindow( Window* pParent, const ResId& rResId ) :
+oldGraphicFilterDialog::PreviewWindow::PreviewWindow( Window* pParent, const ResId& rResId ) :
Control( pParent, rResId )
{
}
// -----------------------------------------------------------------------------
-void GraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
+void oldGraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
{
Control::Paint( rRect );
@@ -64,7 +64,7 @@ void GraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
// -----------------------------------------------------------------------------
-void GraphicFilterDialog::PreviewWindow::SetGraphic( const Graphic& rGraphic )
+void oldGraphicFilterDialog::PreviewWindow::SetGraphic( const Graphic& rGraphic )
{
maGraphic = rGraphic;
@@ -75,12 +75,12 @@ void GraphicFilterDialog::PreviewWindow::SetGraphic( const Graphic& rGraphic )
}
// -----------------------
-// - GraphicFilterDialog -
+// - oldGraphicFilterDialog -
// -----------------------
-GraphicFilterDialog::GraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic ) :
+oldGraphicFilterDialog::oldGraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic ) :
ModalDialog ( pParent, rResId ),
- maModifyHdl ( LINK( this, GraphicFilterDialog, ImplModifyHdl ) ),
+ maModifyHdl ( LINK( this, oldGraphicFilterDialog, ImplModifyHdl ) ),
mfScaleX ( 0.0 ),
mfScaleY ( 0.0 ),
maSizePixel ( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ),
@@ -123,14 +123,14 @@ GraphicFilterDialog::GraphicFilterDialog( Window* pParent, const ResId& rResId,
}
}
- maTimer.SetTimeoutHdl( LINK( this, GraphicFilterDialog, ImplPreviewTimeoutHdl ) );
+ maTimer.SetTimeoutHdl( LINK( this, oldGraphicFilterDialog, ImplPreviewTimeoutHdl ) );
maTimer.SetTimeout( 100 );
ImplModifyHdl( NULL );
}
// -----------------------------------------------------------------------------
-IMPL_LINK_NOARG(GraphicFilterDialog, ImplPreviewTimeoutHdl)
+IMPL_LINK_NOARG(oldGraphicFilterDialog, ImplPreviewTimeoutHdl)
{
maTimer.Stop();
maPreview.SetGraphic( GetFilteredGraphic( maGraphic, mfScaleX, mfScaleY ) );
@@ -140,7 +140,7 @@ IMPL_LINK_NOARG(GraphicFilterDialog, ImplPreviewTimeoutHdl)
// -----------------------------------------------------------------------------
-IMPL_LINK_NOARG(GraphicFilterDialog, ImplModifyHdl)
+IMPL_LINK_NOARG(oldGraphicFilterDialog, ImplModifyHdl)
{
if( maGraphic.GetType() == GRAPHIC_BITMAP )
{
@@ -157,7 +157,7 @@ IMPL_LINK_NOARG(GraphicFilterDialog, ImplModifyHdl)
GraphicFilterMosaic::GraphicFilterMosaic( Window* pParent, const Graphic& rGraphic,
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges ) :
- GraphicFilterDialog( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_MOSAIC ), rGraphic ),
+ oldGraphicFilterDialog( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_MOSAIC ), rGraphic ),
maFtWidth ( this, CUI_RES( DLG_FILTERMOSAIC_FT_WIDTH ) ),
maMtrWidth ( this, CUI_RES( DLG_FILTERMOSAIC_MTR_WIDTH ) ),
maFtHeight ( this, CUI_RES( DLG_FILTERMOSAIC_FT_HEIGHT ) ),
@@ -235,7 +235,7 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
// ------------------
GraphicFilterSmooth::GraphicFilterSmooth( Window* pParent, const Graphic& rGraphic, double nRadius) :
- GraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_SMOOTH ), rGraphic ),
+ oldGraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_SMOOTH ), rGraphic ),
maFtRadius ( this, CUI_RES( DLG_FILTERSMOOTH_FT_RADIUS ) ),
maMtrRadius ( this, CUI_RES( DLG_FILTERSMOOTH_MTR_RADIUS ) )
{
@@ -287,7 +287,7 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double
GraphicFilterSolarize::GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
sal_uInt8 cGreyThreshold, sal_Bool bInvert ) :
- GraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_SOLARIZE ), rGraphic ),
+ oldGraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_SOLARIZE ), rGraphic ),
maFtThreshold ( this, CUI_RES( DLG_FILTERSOLARIZE_FT_THRESHOLD ) ),
maMtrThreshold ( this, CUI_RES( DLG_FILTERSOLARIZE_MTR_THRESHOLD ) ),
maCbxInvert ( this, CUI_RES( DLG_FILTERSOLARIZE_CBX_INVERT ) )
@@ -349,7 +349,7 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic,
GraphicFilterSepia::GraphicFilterSepia( Window* pParent, const Graphic& rGraphic,
sal_uInt16 nSepiaPercent ) :
- GraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_SEPIA ), rGraphic ),
+ oldGraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_SEPIA ), rGraphic ),
maFtSepia ( this, CUI_RES( DLG_FILTERSEPIA_FT_SEPIA ) ),
maMtrSepia ( this, CUI_RES( DLG_FILTERSEPIA_MTR_SEPIA ) )
{
@@ -397,7 +397,7 @@ Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic,
GraphicFilterPoster::GraphicFilterPoster( Window* pParent, const Graphic& rGraphic,
sal_uInt16 nPosterCount ) :
- GraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_POSTER ), rGraphic ),
+ oldGraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_POSTER ), rGraphic ),
maFtPoster ( this, CUI_RES( DLG_FILTERPOSTER_FT_POSTER ) ),
maNumPoster ( this, CUI_RES( DLG_FILTERPOSTER_NUM_POSTER ) )
{
@@ -459,7 +459,7 @@ void GraphicFilterEmboss::EmbossControl::MouseButtonDown( const MouseEvent& rEvt
GraphicFilterEmboss::GraphicFilterEmboss( Window* pParent, const Graphic& rGraphic,
RECT_POINT eLightSource ) :
- GraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_EMBOSS ), rGraphic ),
+ oldGraphicFilterDialog ( pParent, CUI_RES( RID_SVX_GRFFILTER_DLG_EMBOSS ), rGraphic ),
maFtLight ( this, CUI_RES( DLG_FILTEREMBOSS_FT_LIGHT ) ),
maCtlLight ( this, CUI_RES( DLG_FILTEREMBOSS_CTL_LIGHT ), eLightSource )
{
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index ea8c22d..730d819 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1502,7 +1502,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterEmb
RECT_POINT eLightSource,
sal_uInt32)
{
- GraphicFilterDialog* pDlg = new GraphicFilterEmboss( pParent, rGraphic, eLightSource );
+ oldGraphicFilterDialog* pDlg = new GraphicFilterEmboss( pParent, rGraphic, eLightSource );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1511,7 +1511,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterPos
sal_uInt16 nCount,
sal_uInt32 nResId)
{
- GraphicFilterDialog* pDlg=NULL;
+ oldGraphicFilterDialog* pDlg=NULL;
switch ( nResId )
{
case RID_SVX_GRFFILTER_DLG_POSTER :
@@ -1533,14 +1533,14 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterPos
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSmooth ( Window* pParent,
const Graphic& rGraphic, double nRadius, sal_uInt32)
{
- GraphicFilterDialog* pDlg = new GraphicFilterSmooth( pParent, rGraphic, nRadius );
+ oldGraphicFilterDialog* pDlg = new GraphicFilterSmooth( pParent, rGraphic, nRadius );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSolarize (Window* pParent,
const Graphic& rGraphic, sal_uInt8 nGreyThreshold, sal_Bool bInvert, sal_uInt32 )
{
- GraphicFilterDialog* pDlg = new GraphicFilterSolarize( pParent, rGraphic, nGreyThreshold, bInvert );
+ oldGraphicFilterDialog* pDlg = new GraphicFilterSolarize( pParent, rGraphic, nGreyThreshold, bInvert );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1548,7 +1548,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMos
const Graphic& rGraphic, sal_uInt16 nTileWidth, sal_uInt16 nTileHeight,
sal_Bool bEnhanceEdges, sal_uInt32 nResId)
{
- GraphicFilterDialog* pDlg=NULL;
+ oldGraphicFilterDialog* pDlg=NULL;
switch ( nResId )
{
case RID_SVX_GRFFILTER_DLG_MOSAIC :
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 0d17161..909c8fd 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -46,7 +46,7 @@ class SvxMultiFileDialog;
class SvxHpLinkDlg;
class FmSearchDialog;
class Graphic;
-class GraphicFilterDialog;
+class oldGraphicFilterDialog;
class SvxAreaTabDialog;
class InsertObjectDialog_Impl;
class SvPasteObjectDialog;
@@ -436,10 +436,9 @@ class AbstractFmSearchDialog_Impl :public AbstractFmSearchDialog
virtual void SetActiveField(const OUString& strField);
};
-class GraphicFilterDialog;
class AbstractGraphicFilterDialog_Impl :public AbstractGraphicFilterDialog
{
- DECL_ABSTDLG_BASE(AbstractGraphicFilterDialog_Impl,GraphicFilterDialog)
+ DECL_ABSTDLG_BASE(AbstractGraphicFilterDialog_Impl,oldGraphicFilterDialog)
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY );
};
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index 29f3546..b4fcfac 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -33,10 +33,10 @@
#include <svx/rectenum.hxx>
// -----------------------
-// - GraphicFilterDialog -
+// - oldGraphicFilterDialog -
// -----------------------
-class GraphicFilterDialog : public ModalDialog
+class oldGraphicFilterDialog : public ModalDialog
{
private:
@@ -79,7 +79,7 @@ protected:
public:
- GraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic );
+ oldGraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic );
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0;
};
@@ -88,7 +88,7 @@ public:
// - GraphicFilterSmooth -
// -------------------------
-class GraphicFilterSmooth : public GraphicFilterDialog
+class GraphicFilterSmooth : public oldGraphicFilterDialog
{
private:
@@ -108,7 +108,7 @@ public:
// - GraphicFilterMosaic -
// -----------------------
-class GraphicFilterMosaic : public GraphicFilterDialog
+class GraphicFilterMosaic : public oldGraphicFilterDialog
{
private:
@@ -134,7 +134,7 @@ public:
// - GraphicFilterSolarize -
// -------------------------
-class GraphicFilterSolarize : public GraphicFilterDialog
+class GraphicFilterSolarize : public oldGraphicFilterDialog
{
private:
@@ -157,7 +157,7 @@ public:
// - GraphicFilterSepia -
// ----------------------
-class GraphicFilterSepia : public GraphicFilterDialog
+class GraphicFilterSepia : public oldGraphicFilterDialog
{
private:
@@ -179,7 +179,7 @@ public:
// - GraphicFilterPoster -
// -----------------------
-class GraphicFilterPoster : public GraphicFilterDialog
+class GraphicFilterPoster : public oldGraphicFilterDialog
{
private:
@@ -200,7 +200,7 @@ public:
// - GraphicFilterEmboss -
// -----------------------
-class GraphicFilterEmboss : public GraphicFilterDialog
+class GraphicFilterEmboss : public oldGraphicFilterDialog
{
private:
commit 54e1c8977629a1098cb677edffca5b76f51e8aa7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 31 08:53:39 2014 +0000
drop unnecessary dtors
Change-Id: I033349bc554bca46a4b1d622cd8fb64d4c1f4866
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 4d0fcb9..4009454 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -40,12 +40,6 @@ GraphicFilterDialog::PreviewWindow::PreviewWindow( Window* pParent, const ResId&
// -----------------------------------------------------------------------------
-GraphicFilterDialog::PreviewWindow::~PreviewWindow()
-{
-}
-
-// -----------------------------------------------------------------------------
-
void GraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
{
Control::Paint( rRect );
@@ -136,12 +130,6 @@ GraphicFilterDialog::GraphicFilterDialog( Window* pParent, const ResId& rResId,
// -----------------------------------------------------------------------------
-GraphicFilterDialog::~GraphicFilterDialog()
-{
-}
-
-// -----------------------------------------------------------------------------
-
IMPL_LINK_NOARG(GraphicFilterDialog, ImplPreviewTimeoutHdl)
{
maTimer.Stop();
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index 77f1fc1..29f3546 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -50,8 +50,7 @@ private:
public:
- PreviewWindow( Window* pParent, const ResId& rResId );
- ~PreviewWindow();
+ PreviewWindow( Window* pParent, const ResId& rResId );
void SetGraphic( const Graphic& rGraphic );
};
@@ -80,8 +79,7 @@ protected:
public:
- GraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic );
- ~GraphicFilterDialog();
+ GraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic );
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0;
};
More information about the Libreoffice-commits
mailing list