[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - cui/source include/svx sal/rtl sd/source svx/source vcl/inc
Noel Grandin
noel.grandin at collabora.co.uk
Mon May 28 20:01:34 UTC 2018
cui/source/tabpages/textattr.cxx | 2
include/svx/dlgctrl.hxx | 8 -
sal/rtl/alloc_arena.hxx | 2
sd/source/ui/table/TableDesignPane.cxx | 6
sd/source/ui/table/TableDesignPane.hxx | 3
svx/source/dialog/dlgctrl.cxx | 227 ++++++++++++++-------------------
vcl/inc/salwtype.hxx | 1
7 files changed, 101 insertions(+), 148 deletions(-)
New commits:
commit d1ceb421883fd4c05d146c109f906127d2b2ee31
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri May 25 16:34:11 2018 +0200
loplugin:unusedfields
Change-Id: I625b73152c0c277c6e0ce3e24e4704094fc4e8ff
Reviewed-on: https://gerrit.libreoffice.org/54822
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
(cherry picked from commit 96d7c67d98527b1ccc1cfba3ca817238e582d63b)
Reviewed-on: https://gerrit.libreoffice.org/54943
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index 3013bd6038d7..9cb423211176 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -81,7 +81,7 @@ SvxTextAttrPage::SvxTextAttrPage(TabPageParent pPage, const SfxItemSet& rInAttrs
, m_xCtlPosition(new weld::CustomWeld(*m_xBuilder, "CTL_POSITION", m_aCtlPosition))
, m_xTsbFullWidth(m_xBuilder->weld_check_button("TSB_FULL_WIDTH"))
{
- m_aCtlPosition.SetControlSettings(RectPoint::MM, 240, 100);
+ m_aCtlPosition.SetControlSettings(RectPoint::MM, 240);
FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs );
SetFieldUnit( *m_xMtrFldLeft, eFUnit );
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index c14761bd8017..c7a1e1087765 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -100,7 +100,6 @@ protected:
BitmapEx* pBitmap;
CTL_STATE m_nState;
- bool mbCompleteDisable : 1;
bool mbUpdateForeground : 1;
bool mbUpdateBackground : 1;
@@ -143,8 +142,6 @@ public:
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
RectPoint GetApproxRPFromPixPt( const css::awt::Point& rPixelPoint ) const;
-
- bool IsCompletelyDisabled() const { return mbCompleteDisable; }
};
class SAL_WARN_UNUSED SVX_DLLPUBLIC RectCtl : public weld::CustomWidgetController
@@ -163,7 +160,6 @@ private:
protected:
rtl::Reference<RectCtlAccessibleContext> pAccContext;
sal_uInt16 nBorderWidth;
- sal_uInt16 nRadius;
Point aPtLT, aPtMT, aPtRT;
Point aPtLM, aPtMM, aPtRM;
Point aPtLB, aPtMB, aPtRB;
@@ -180,8 +176,8 @@ protected:
Point GetApproxLogPtFromPixPt( const Point& rRoughPixelPoint ) const;
public:
- RectCtl(SvxTabPage* pPage, RectPoint eRpt = RectPoint::MM, sal_uInt16 nBorder = 200, sal_uInt16 nCircle = 80);
- void SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder, sal_uInt16 nCircl);
+ RectCtl(SvxTabPage* pPage, RectPoint eRpt = RectPoint::MM, sal_uInt16 nBorder = 200);
+ void SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder);
virtual ~RectCtl() override;
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
diff --git a/sal/rtl/alloc_arena.hxx b/sal/rtl/alloc_arena.hxx
index 120d0ec5ac45..061fc0cf044f 100644
--- a/sal/rtl/alloc_arena.hxx
+++ b/sal/rtl/alloc_arena.hxx
@@ -100,8 +100,6 @@ struct rtl_arena_st
rtl_arena_segment_type * m_hash_table_0[RTL_ARENA_HASH_SIZE];
sal_Size m_hash_size; /* m_hash_mask + 1 */
sal_Size m_hash_shift; /* log2(m_hash_size) */
-
- rtl_cache_type ** m_qcache_ptr;
};
/** gp_default_arena
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index 1a61bf6f100e..23a8dd2499e4 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -86,8 +86,6 @@ static const OUStringLiteral gPropNames[CB_COUNT] =
TableDesignWidget::TableDesignWidget( VclBuilderContainer* pParent, ViewShellBase& rBase )
: mrBase(rBase)
- , mbStyleSelected(false)
- , mbOptionsChanged(false)
{
pParent->get(m_pValueSet, "previews");
m_pValueSet->SetStyle(m_pValueSet->GetStyle() | WB_NO_DIRECTSELECT | WB_FLATVALUESET | WB_ITEMBORDER);
@@ -146,7 +144,6 @@ static SfxDispatcher* getDispatcher( ViewShellBase const & rBase )
IMPL_LINK_NOARG(TableDesignWidget, implValueSetHdl, ValueSet*, void)
{
- mbStyleSelected = true;
ApplyStyle();
}
@@ -202,10 +199,7 @@ void TableDesignWidget::ApplyStyle()
IMPL_LINK_NOARG(TableDesignWidget, implCheckBoxHdl, Button*, void)
{
- mbOptionsChanged = true;
-
ApplyOptions();
-
FillDesignPreviewControl();
}
diff --git a/sd/source/ui/table/TableDesignPane.hxx b/sd/source/ui/table/TableDesignPane.hxx
index 1111149ce0ae..a8a641291656 100644
--- a/sd/source/ui/table/TableDesignPane.hxx
+++ b/sd/source/ui/table/TableDesignPane.hxx
@@ -98,9 +98,6 @@ private:
css::uno::Reference< css::beans::XPropertySet > mxSelectedTable;
css::uno::Reference< css::drawing::XDrawView > mxView;
css::uno::Reference< css::container::XIndexAccess > mxTableFamily;
-
- bool mbStyleSelected;
- bool mbOptionsChanged;
};
class TableDesignPane : public PanelLayout
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 389e6ec06857..3f72131aa1bd 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -75,7 +75,6 @@ SvxRectCtl::SvxRectCtl(vcl::Window* pParent, RectPoint eRpt,
, eDefRP(eRpt)
, pBitmap(nullptr)
, m_nState(CTL_STATE::NONE)
- , mbCompleteDisable(false)
, mbUpdateForeground(true)
, mbUpdateBackground(true)
{
@@ -217,110 +216,102 @@ void SvxRectCtl::InitSettings(vcl::RenderContext& rRenderContext)
// is notified that the item was changed
void SvxRectCtl::MouseButtonDown( const MouseEvent& rMEvt )
{
- // CompletelyDisabled() added to have a disabled state for SvxRectCtl
- if(!IsCompletelyDisabled())
- {
- Point aPtLast = aPtNew;
+ Point aPtLast = aPtNew;
- aPtNew = GetApproxLogPtFromPixPt( rMEvt.GetPosPixel() );
+ aPtNew = GetApproxLogPtFromPixPt( rMEvt.GetPosPixel() );
- Invalidate( tools::Rectangle( aPtLast - Point( nRadius, nRadius ),
- aPtLast + Point( nRadius, nRadius ) ) );
- Invalidate( tools::Rectangle( aPtNew - Point( nRadius, nRadius ),
- aPtNew + Point( nRadius, nRadius ) ) );
- eRP = GetRPFromPoint( aPtNew );
+ Invalidate( tools::Rectangle( aPtLast - Point( nRadius, nRadius ),
+ aPtLast + Point( nRadius, nRadius ) ) );
+ Invalidate( tools::Rectangle( aPtNew - Point( nRadius, nRadius ),
+ aPtNew + Point( nRadius, nRadius ) ) );
+ eRP = GetRPFromPoint( aPtNew );
- SetActualRP( eRP );
+ SetActualRP( eRP );
- vcl::Window *pTabPage = getNonLayoutParent(this);
- if (pTabPage && WindowType::TABPAGE == pTabPage->GetType())
- static_cast<SvxTabPage*>(pTabPage)->PointChanged( this, eRP );
- }
+ vcl::Window *pTabPage = getNonLayoutParent(this);
+ if (pTabPage && WindowType::TABPAGE == pTabPage->GetType())
+ static_cast<SvxTabPage*>(pTabPage)->PointChanged( this, eRP );
}
void SvxRectCtl::KeyInput( const KeyEvent& rKeyEvt )
{
- // CompletelyDisabled() added to have a disabled state for SvxRectCtl
- if(!IsCompletelyDisabled())
- {
- RectPoint eNewRP = eRP;
+ RectPoint eNewRP = eRP;
- switch( rKeyEvt.GetKeyCode().GetCode() )
+ switch( rKeyEvt.GetKeyCode().GetCode() )
+ {
+ case KEY_DOWN:
{
- case KEY_DOWN:
- {
- if( !(m_nState & CTL_STATE::NOVERT) )
- switch( eNewRP )
- {
- case RectPoint::LT: eNewRP = RectPoint::LM; break;
- case RectPoint::MT: eNewRP = RectPoint::MM; break;
- case RectPoint::RT: eNewRP = RectPoint::RM; break;
- case RectPoint::LM: eNewRP = RectPoint::LB; break;
- case RectPoint::MM: eNewRP = RectPoint::MB; break;
- case RectPoint::RM: eNewRP = RectPoint::RB; break;
- default: ; //prevent warning
- }
- }
- break;
- case KEY_UP:
- {
- if( !(m_nState & CTL_STATE::NOVERT) )
- switch( eNewRP )
- {
- case RectPoint::LM: eNewRP = RectPoint::LT; break;
- case RectPoint::MM: eNewRP = RectPoint::MT; break;
- case RectPoint::RM: eNewRP = RectPoint::RT; break;
- case RectPoint::LB: eNewRP = RectPoint::LM; break;
- case RectPoint::MB: eNewRP = RectPoint::MM; break;
- case RectPoint::RB: eNewRP = RectPoint::RM; break;
- default: ; //prevent warning
- }
- }
- break;
- case KEY_LEFT:
- {
- if( !(m_nState & CTL_STATE::NOHORZ) )
- switch( eNewRP )
- {
- case RectPoint::MT: eNewRP = RectPoint::LT; break;
- case RectPoint::RT: eNewRP = RectPoint::MT; break;
- case RectPoint::MM: eNewRP = RectPoint::LM; break;
- case RectPoint::RM: eNewRP = RectPoint::MM; break;
- case RectPoint::MB: eNewRP = RectPoint::LB; break;
- case RectPoint::RB: eNewRP = RectPoint::MB; break;
- default: ; //prevent warning
- }
- }
- break;
- case KEY_RIGHT:
- {
- if( !(m_nState & CTL_STATE::NOHORZ) )
- switch( eNewRP )
- {
- case RectPoint::LT: eNewRP = RectPoint::MT; break;
- case RectPoint::MT: eNewRP = RectPoint::RT; break;
- case RectPoint::LM: eNewRP = RectPoint::MM; break;
- case RectPoint::MM: eNewRP = RectPoint::RM; break;
- case RectPoint::LB: eNewRP = RectPoint::MB; break;
- case RectPoint::MB: eNewRP = RectPoint::RB; break;
- default: ; //prevent warning
- }
- }
- break;
- default:
- Control::KeyInput( rKeyEvt );
- return;
+ if( !(m_nState & CTL_STATE::NOVERT) )
+ switch( eNewRP )
+ {
+ case RectPoint::LT: eNewRP = RectPoint::LM; break;
+ case RectPoint::MT: eNewRP = RectPoint::MM; break;
+ case RectPoint::RT: eNewRP = RectPoint::RM; break;
+ case RectPoint::LM: eNewRP = RectPoint::LB; break;
+ case RectPoint::MM: eNewRP = RectPoint::MB; break;
+ case RectPoint::RM: eNewRP = RectPoint::RB; break;
+ default: ; //prevent warning
+ }
}
- if( eNewRP != eRP )
+ break;
+ case KEY_UP:
{
- SetActualRP( eNewRP );
+ if( !(m_nState & CTL_STATE::NOVERT) )
+ switch( eNewRP )
+ {
+ case RectPoint::LM: eNewRP = RectPoint::LT; break;
+ case RectPoint::MM: eNewRP = RectPoint::MT; break;
+ case RectPoint::RM: eNewRP = RectPoint::RT; break;
+ case RectPoint::LB: eNewRP = RectPoint::LM; break;
+ case RectPoint::MB: eNewRP = RectPoint::MM; break;
+ case RectPoint::RB: eNewRP = RectPoint::RM; break;
+ default: ; //prevent warning
+ }
+ }
+ break;
+ case KEY_LEFT:
+ {
+ if( !(m_nState & CTL_STATE::NOHORZ) )
+ switch( eNewRP )
+ {
+ case RectPoint::MT: eNewRP = RectPoint::LT; break;
+ case RectPoint::RT: eNewRP = RectPoint::MT; break;
+ case RectPoint::MM: eNewRP = RectPoint::LM; break;
+ case RectPoint::RM: eNewRP = RectPoint::MM; break;
+ case RectPoint::MB: eNewRP = RectPoint::LB; break;
+ case RectPoint::RB: eNewRP = RectPoint::MB; break;
+ default: ; //prevent warning
+ }
+ }
+ break;
+ case KEY_RIGHT:
+ {
+ if( !(m_nState & CTL_STATE::NOHORZ) )
+ switch( eNewRP )
+ {
+ case RectPoint::LT: eNewRP = RectPoint::MT; break;
+ case RectPoint::MT: eNewRP = RectPoint::RT; break;
+ case RectPoint::LM: eNewRP = RectPoint::MM; break;
+ case RectPoint::MM: eNewRP = RectPoint::RM; break;
+ case RectPoint::LB: eNewRP = RectPoint::MB; break;
+ case RectPoint::MB: eNewRP = RectPoint::RB; break;
+ default: ; //prevent warning
+ }
+ }
+ break;
+ default:
+ Control::KeyInput( rKeyEvt );
+ return;
+ }
+ if( eNewRP != eRP )
+ {
+ SetActualRP( eNewRP );
- vcl::Window *pTabPage = getNonLayoutParent(this);
- if (pTabPage && WindowType::TABPAGE == pTabPage->GetType())
- static_cast<SvxTabPage*>(pTabPage)->PointChanged(this, eRP);
+ vcl::Window *pTabPage = getNonLayoutParent(this);
+ if (pTabPage && WindowType::TABPAGE == pTabPage->GetType())
+ static_cast<SvxTabPage*>(pTabPage)->PointChanged(this, eRP);
- SetFocusRect();
- }
+ SetFocusRect();
}
}
@@ -387,46 +378,26 @@ void SvxRectCtl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangl
BitmapEx& rBitmap = GetRectBitmap();
- // CompletelyDisabled() added to have a disabled state for SvxRectCtl
- if (IsCompletelyDisabled())
- {
- rRenderContext.DrawBitmap(aPtLT - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtMT - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtRT - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtLM - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtMM - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtRM - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtLB - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtMB - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtRB - aToCenter, aDstBtnSize, aBtnPnt3, aBtnSize, rBitmap.GetBitmap());
- }
- else
- {
- rRenderContext.DrawBitmap(aPtLT - aToCenter, aDstBtnSize, (bNoHorz || bNoVert)?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtMT - aToCenter, aDstBtnSize, bNoVert?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtRT - aToCenter, aDstBtnSize, (bNoHorz || bNoVert)?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtLM - aToCenter, aDstBtnSize, bNoHorz?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
+ rRenderContext.DrawBitmap(aPtLT - aToCenter, aDstBtnSize, (bNoHorz || bNoVert)?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
+ rRenderContext.DrawBitmap(aPtMT - aToCenter, aDstBtnSize, bNoVert?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
+ rRenderContext.DrawBitmap(aPtRT - aToCenter, aDstBtnSize, (bNoHorz || bNoVert)?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
+ rRenderContext.DrawBitmap(aPtLM - aToCenter, aDstBtnSize, bNoHorz?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
- // Center for rectangle and line
- rRenderContext.DrawBitmap(aPtMM - aToCenter, aDstBtnSize, aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
+ // Center for rectangle and line
+ rRenderContext.DrawBitmap(aPtMM - aToCenter, aDstBtnSize, aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtRM - aToCenter, aDstBtnSize, bNoHorz?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtLB - aToCenter, aDstBtnSize, (bNoHorz || bNoVert)?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtMB - aToCenter, aDstBtnSize, bNoVert?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
- rRenderContext.DrawBitmap(aPtRB - aToCenter, aDstBtnSize, (bNoHorz || bNoVert)?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
- }
+ rRenderContext.DrawBitmap(aPtRM - aToCenter, aDstBtnSize, bNoHorz?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
+ rRenderContext.DrawBitmap(aPtLB - aToCenter, aDstBtnSize, (bNoHorz || bNoVert)?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
+ rRenderContext.DrawBitmap(aPtMB - aToCenter, aDstBtnSize, bNoVert?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
+ rRenderContext.DrawBitmap(aPtRB - aToCenter, aDstBtnSize, (bNoHorz || bNoVert)?aBtnPnt3:aBtnPnt1, aBtnSize, rBitmap.GetBitmap());
// draw active button, avoid center pos for angle
- // CompletelyDisabled() added to have a disabled state for SvxRectCtl
- if (!IsCompletelyDisabled())
+ if (IsEnabled())
{
- if (IsEnabled())
- {
- Point aCenterPt(aPtNew);
- aCenterPt -= aToCenter;
+ Point aCenterPt(aPtNew);
+ aCenterPt -= aToCenter;
- rRenderContext.DrawBitmap(aCenterPt, aDstBtnSize, aBtnPnt2, aBtnSize, rBitmap.GetBitmap());
- }
+ rRenderContext.DrawBitmap(aCenterPt, aDstBtnSize, aBtnPnt2, aBtnSize, rBitmap.GetBitmap());
}
}
@@ -652,10 +623,9 @@ BitmapEx& RectCtl::GetRectBitmap()
return *pBitmap;
}
-RectCtl::RectCtl(SvxTabPage* pPage, RectPoint eRpt, sal_uInt16 nBorder, sal_uInt16 nCircle)
+RectCtl::RectCtl(SvxTabPage* pPage, RectPoint eRpt, sal_uInt16 nBorder)
: m_pPage(pPage)
, nBorderWidth(Application::GetDefaultDevice()->LogicToPixel(Size(nBorder, 0), MapMode(MapUnit::Map100thMM)).Width())
- , nRadius(Application::GetDefaultDevice()->LogicToPixel(Size(nCircle, 0), MapMode(MapUnit::Map100thMM)).Width())
, eDefRP(eRpt)
, pBitmap(nullptr)
, m_nState(CTL_STATE::NONE)
@@ -670,10 +640,9 @@ void RectCtl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
CustomWidgetController::SetDrawingArea(pDrawingArea);
}
-void RectCtl::SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder, sal_uInt16 nCircle)
+void RectCtl::SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder)
{
nBorderWidth = Application::GetDefaultDevice()->LogicToPixel(Size(nBorder, 0), MapMode(MapUnit::Map100thMM)).Width();
- nRadius = Application::GetDefaultDevice()->LogicToPixel(Size(nCircle, 0), MapMode(MapUnit::Map100thMM)).Width();
eDefRP = eRpt;
Resize_Impl();
}
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index a7384090a20f..34ca43664a25 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -186,7 +186,6 @@ struct SalExtTextInputPosEvent
struct SalInputContextChangeEvent
{
- LanguageType meLanguage; // new language
};
struct SalSurroundingTextRequestEvent
More information about the Libreoffice-commits
mailing list