Kaydet (Commit) 4f344f02 authored tarafından Kshitij Pathania's avatar Kshitij Pathania Kaydeden (comit) Tamás Zolnai

tdf#111747 Enabled position protection immediately after protection is checked

Change-Id: I10409fe9e6eb7b932496346224952a7c4012cb38
Reviewed-on: https://gerrit.libreoffice.org/46192Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst f2fd69e3
......@@ -93,7 +93,7 @@ class SvxSwPosSizeTabPage : public SfxTabPage
bool m_bPositioningDisabled;
bool m_bIsMultiSelection;
bool m_bIsInRightToLeft;
TriState m_nProtectSizeState;
DECL_LINK(RangeModifyHdl, Control&, void);
DECL_LINK(RangeModifyClickHdl, Button*, void);
......
......@@ -525,6 +525,7 @@ SvxSwPosSizeTabPage::SvxSwPosSizeTabPage(vcl::Window* pParent, const SfxItemSet&
, m_bPositioningDisabled(false)
, m_bIsMultiSelection(false)
, m_bIsInRightToLeft(false)
, m_nProtectSizeState(TRISTATE_FALSE)
{
get(m_pWidthMF, "width");
get(m_pHeightMF, "height");
......@@ -1087,7 +1088,13 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet* rSet)
DeactivateRC SvxSwPosSizeTabPage::DeactivatePage( SfxItemSet* _pSet )
{
if( _pSet )
{
_pSet->Put(SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ),
m_pPositionCB->GetState() == TRISTATE_TRUE ));
_pSet->Put(SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ),
m_pSizeCB->GetState() == TRISTATE_TRUE ));
FillItemSet( _pSet );
}
return DeactivateRC::LeavePage;
}
......@@ -1393,6 +1400,12 @@ IMPL_LINK( SvxSwPosSizeTabPage, ModifyHdl, Edit&, rEdit, void )
IMPL_LINK_NOARG(SvxSwPosSizeTabPage, ProtectHdl, Button*, void)
{
if( m_pSizeCB->IsEnabled() )
{
m_nProtectSizeState = m_pSizeCB->GetState();
}
m_pSizeCB->SetState( m_pPositionCB->GetState() == TRISTATE_TRUE ? TRISTATE_TRUE : m_nProtectSizeState );
m_pSizeCB->Enable(m_pPositionCB->IsEnabled() && !m_pPositionCB->IsChecked());
}
......
......@@ -327,8 +327,14 @@ VclPtr<SfxTabPage> SvxAngleTabPage::Create( vcl::Window* pWindow, const SfxItemS
}
void SvxAngleTabPage::ActivatePage(const SfxItemSet& /*rSet*/)
void SvxAngleTabPage::ActivatePage(const SfxItemSet& rSet)
{
SfxBoolItem const * bPosProtect = nullptr;
if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_POS ) , false, reinterpret_cast<SfxPoolItem const **>(&bPosProtect) ))
{
m_pFlPosition->Enable(!bPosProtect->GetValue());
m_pFlAngle->Enable(!bPosProtect->GetValue());
}
}
......@@ -698,6 +704,18 @@ void SvxSlantTabPage::ActivatePage( const SfxItemSet& rSet )
const ::tools::Rectangle aTempRect(pRectItem->GetValue());
maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
}
SfxBoolItem const * bPosProtect = nullptr;
if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_POS ) , false, reinterpret_cast<SfxPoolItem const **>(&bPosProtect) ))
{
m_pFlAngle->Enable(!bPosProtect->GetValue());
}
SfxBoolItem const * bSizeProtect = nullptr;
if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_SIZE ) , false, reinterpret_cast<SfxPoolItem const **>(&bSizeProtect) ))
{
m_pFlAngle->Enable(!bSizeProtect->GetValue());
}
}
......@@ -1168,7 +1186,10 @@ DeactivateRC SvxPositionSizeTabPage::DeactivatePage( SfxItemSet* _pSet )
basegfx::fround(fX), basegfx::fround(fY),
basegfx::fround(fX + maRange.getWidth()), basegfx::fround(fY + maRange.getHeight()));
_pSet->Put(SfxRectangleItem(SID_ATTR_TRANSFORM_INTERN, aOutRectangle));
_pSet->Put(SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ),
m_pTsbPosProtect->GetState() == TRISTATE_TRUE ));
_pSet->Put(SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ),
m_pTsbSizeProtect->GetState() == TRISTATE_TRUE ));
FillItemSet(_pSet);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment