summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-21 17:09:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-22 20:28:23 +0200
commit32eac27a2c22aae63941479482ef21e8d75a5122 (patch)
tree64e7e5dff4ac0fbd7c117b398e365a0728fdde1e /svx/source
parent47f84e024344d9a50e44dda4f947945e8fc643b5 (diff)
weld AlignmentTabPage
Change-Id: I253a01b053efe836b0657f9a711cecd060b6782b Reviewed-on: https://gerrit.libreoffice.org/60883 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/dialcontrol.cxx67
-rw-r--r--svx/source/dialog/frmdirlbox.cxx28
-rw-r--r--svx/source/dialog/orienthelper.cxx28
3 files changed, 30 insertions, 93 deletions
diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx
index ab0b12dcff86..73674cb5c66e 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -517,7 +517,8 @@ SvxDialControl::DialControl_Impl::DialControl_Impl(OutputDevice& rReference) :
mnInitialAngle( 0 ),
mnOldAngle( 0 ),
mnCenterX( 0 ),
- mnCenterY( 0 )
+ mnCenterY( 0 ),
+ mbNoRot( false )
{
}
@@ -620,6 +621,17 @@ void SvxDialControl::LoseFocus()
HandleEscapeEvent();
}
+void SvxDialControl::SetNoRotation()
+{
+ if( !mpImpl->mbNoRot )
+ {
+ mpImpl->mbNoRot = true;
+ InvalidateControl();
+ if (mpImpl->mpLinkField)
+ mpImpl->mpLinkField->set_text("");
+ }
+}
+
sal_Int32 SvxDialControl::GetRotation() const
{
return mpImpl->mnAngle;
@@ -633,7 +645,7 @@ void SvxDialControl::SetLinkedField(weld::SpinButton* pField, sal_Int32 nDecimal
if( mpImpl->mpLinkField )
{
weld::SpinButton& rField = *mpImpl->mpLinkField;
- rField.connect_value_changed(Link<weld::SpinButton&,void>());
+ rField.connect_changed(Link<weld::Entry&,void>());
}
// remember the new linked field
mpImpl->mpLinkField = pField;
@@ -641,11 +653,11 @@ void SvxDialControl::SetLinkedField(weld::SpinButton* pField, sal_Int32 nDecimal
if( mpImpl->mpLinkField )
{
weld::SpinButton& rField = *mpImpl->mpLinkField;
- rField.connect_value_changed(LINK(this, SvxDialControl, LinkedFieldModifyHdl));
+ rField.connect_changed(LINK(this, SvxDialControl, LinkedFieldModifyHdl));
}
}
-IMPL_LINK_NOARG(SvxDialControl, LinkedFieldModifyHdl, weld::SpinButton&, void)
+IMPL_LINK_NOARG(SvxDialControl, LinkedFieldModifyHdl, weld::Entry&, void)
{
LinkedFieldModifyHdl();
}
@@ -689,19 +701,26 @@ void SvxDialControl::Init( const Size& rWinSize )
void SvxDialControl::InvalidateControl()
{
mpImpl->mxBmpBuffered->CopyBackground( IsEnabled() ? *mpImpl->mxBmpEnabled : *mpImpl->mxBmpDisabled );
- mpImpl->mxBmpBuffered->DrawElements( OUString(), mpImpl->mnAngle );
+ if( !mpImpl->mbNoRot )
+ mpImpl->mxBmpBuffered->DrawElements(GetText(), mpImpl->mnAngle);
Invalidate();
}
-void SvxDialControl::SetRotation( sal_Int32 nAngle )
+void SvxDialControl::SetRotation(sal_Int32 nAngle)
{
- while( nAngle < 0 )
+ bool bOldSel = mpImpl->mbNoRot;
+ mpImpl->mbNoRot = false;
+
+ while (nAngle < 0)
nAngle += 36000;
- mpImpl->mnAngle = nAngle;
- InvalidateControl();
- if( mpImpl->mpLinkField )
- mpImpl->mpLinkField->set_value(GetRotation() / mpImpl->mnLinkedFieldValueMultiplyer);
+ if (!bOldSel || (mpImpl->mnAngle != nAngle))
+ {
+ mpImpl->mnAngle = nAngle;
+ InvalidateControl();
+ if( mpImpl->mpLinkField )
+ mpImpl->mpLinkField->set_value(GetRotation() / mpImpl->mnLinkedFieldValueMultiplyer);
+ }
}
void SvxDialControl::HandleMouseEvent( const Point& rPos, bool bInitial )
@@ -734,32 +753,6 @@ void SvxDialControl::HandleEscapeEvent()
}
}
-DialControlWrapper::DialControlWrapper( DialControl& rDial ) :
- SingleControlWrapperType( rDial )
-{
-}
-
-bool DialControlWrapper::IsControlDontKnow() const
-{
- return !GetControl().HasRotation();
-}
-
-void DialControlWrapper::SetControlDontKnow( bool bSet )
-{
- if( bSet )
- GetControl().SetNoRotation();
-}
-
-sal_Int32 DialControlWrapper::GetControlValue() const
-{
- return GetControl().GetRotation();
-}
-
-void DialControlWrapper::SetControlValue( sal_Int32 nValue )
-{
- GetControl().SetRotation( nValue );
-}
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/frmdirlbox.cxx b/svx/source/dialog/frmdirlbox.cxx
index 035d5099e874..12b342db79c1 100644
--- a/svx/source/dialog/frmdirlbox.cxx
+++ b/svx/source/dialog/frmdirlbox.cxx
@@ -71,34 +71,6 @@ SvxFrameDirection FrameDirectionListBox::GetSelectEntryValue() const
return lclVoidToEnum( GetEntryData( nPos ) );
}
-
-FrameDirectionListBoxWrapper::FrameDirectionListBoxWrapper( FrameDirectionListBox& rListBox ) :
- SingleControlWrapperType( rListBox )
-{
-}
-
-bool FrameDirectionListBoxWrapper::IsControlDontKnow() const
-{
- return GetControl().GetSelectedEntryCount() == 0;
-}
-
-void FrameDirectionListBoxWrapper::SetControlDontKnow( bool bSet )
-{
- if( bSet )
- GetControl().SetNoSelection();
-}
-
-SvxFrameDirection FrameDirectionListBoxWrapper::GetControlValue() const
-{
- return GetControl().GetSelectEntryValue();
-}
-
-void FrameDirectionListBoxWrapper::SetControlValue( SvxFrameDirection eValue )
-{
- GetControl().SelectEntryValue( eValue );
-}
-
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/orienthelper.cxx b/svx/source/dialog/orienthelper.cxx
index f69831c1d9e5..b8b4833c808b 100644
--- a/svx/source/dialog/orienthelper.cxx
+++ b/svx/source/dialog/orienthelper.cxx
@@ -149,34 +149,6 @@ void OrientationHelper::EnableStackedTriState( bool bEnable )
mpImpl->mrCbStacked.EnableTriState( bEnable );
}
-
-OrientStackedWrapper::OrientStackedWrapper( OrientationHelper& rOrientHlp ) :
- SingleControlWrapperType( rOrientHlp )
-{
-}
-
-bool OrientStackedWrapper::IsControlDontKnow() const
-{
- return GetControl().GetStackedState() == TRISTATE_INDET;
-}
-
-void OrientStackedWrapper::SetControlDontKnow( bool bSet )
-{
- GetControl().EnableStackedTriState( bSet );
- GetControl().SetStackedState( bSet ? TRISTATE_INDET : TRISTATE_FALSE );
-}
-
-bool OrientStackedWrapper::GetControlValue() const
-{
- return GetControl().GetStackedState() == TRISTATE_TRUE;
-}
-
-void OrientStackedWrapper::SetControlValue( bool bValue )
-{
- GetControl().SetStackedState( bValue ? TRISTATE_TRUE : TRISTATE_FALSE );
-}
-
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */