summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/tphatch.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/tabpages/tphatch.cxx')
-rw-r--r--cui/source/tabpages/tphatch.cxx76
1 files changed, 12 insertions, 64 deletions
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index a536aafb27d3..32abc8ed0ad9 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -255,9 +255,6 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
DeactivateRC SvxHatchTabPage::DeactivatePage( SfxItemSet* _pSet )
{
- if ( CheckChanges_Impl() == -1L )
- return DeactivateRC::KeepPage;
-
if( _pSet )
FillItemSet( _pSet );
@@ -265,53 +262,6 @@ DeactivateRC SvxHatchTabPage::DeactivatePage( SfxItemSet* _pSet )
}
-long SvxHatchTabPage::CheckChanges_Impl()
-{
- if( m_pMtrDistance->IsValueChangedFromSaved() ||
- m_pMtrAngle->IsValueChangedFromSaved() ||
- m_pLbLineType->IsValueChangedFromSaved() ||
- m_pLbLineColor->IsValueChangedFromSaved() ||
- m_pHatchLB->IsValueChangedFromSaved() )
- {
- ResMgr& rMgr = CUI_MGR();
- Image aWarningBoxImage = WarningBox::GetStandardImage();
- ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
- SVX_RESSTR( RID_SVXSTR_HATCH ),
- CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_HATCH ),
- &aWarningBoxImage );
- assert(aMessDlg && "Dialog creation failed!");
- aMessDlg->SetButtonText( SvxMessDialogButton::N1,
- OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
- aMessDlg->SetButtonText( SvxMessDialogButton::N2,
- OUString( ResId( RID_SVXSTR_ADD, rMgr ) ) );
-
- short nRet = aMessDlg->Execute();
-
- switch( nRet )
- {
- case RET_BTN_1:
- {
- ClickModifyHdl_Impl( nullptr );
- }
- break;
-
- case RET_BTN_2:
- {
- ClickAddHdl_Impl( nullptr );
- }
- break;
-
- case RET_CANCEL:
- break;
- }
- }
-
- size_t nPos = m_pHatchLB->GetSelectItemPos();
- if( nPos != VALUESET_ITEM_NOTFOUND )
- *m_pPos = static_cast<sal_Int32>(nPos);
- return 0L;
-}
-
sal_Int32 SvxHatchTabPage::SearchHatchList(const OUString& rHatchName)
{
long nCount = m_pHatchingList->Count();
@@ -335,24 +285,22 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet )
{
if( *m_pPageType == PageType::Hatch )
{
- // CheckChanges(); <-- duplicate inquiry ?
-
std::unique_ptr<XHatch> pXHatch;
+ pXHatch.reset(new XHatch( m_pLbLineColor->GetSelectEntryColor(),
+ (css::drawing::HatchStyle) m_pLbLineType->GetSelectEntryPos(),
+ GetCoreValue( *m_pMtrDistance, m_ePoolUnit ),
+ static_cast<long>(m_pMtrAngle->GetValue() * 10) ));
+
OUString aString;
- size_t nPos = m_pHatchLB->GetSelectItemPos();
- if( nPos != VALUESET_ITEM_NOTFOUND )
- {
- pXHatch.reset(new XHatch(m_pHatchingList->GetHatch(nPos)->GetHatch()));
- aString = m_pHatchLB->GetItemText( m_pHatchLB->GetSelectItemId() );
- }
- // gradient has been (unidentifiedly) passed
- else
+ if( !( m_pMtrDistance->IsValueChangedFromSaved() ||
+ m_pMtrAngle->IsValueChangedFromSaved() ||
+ m_pLbLineType->IsValueChangedFromSaved() ||
+ m_pLbLineColor->IsValueChangedFromSaved() ||
+ m_pHatchLB->IsValueChangedFromSaved() ) )
{
- pXHatch.reset(new XHatch( m_pLbLineColor->GetSelectEntryColor(),
- (css::drawing::HatchStyle) m_pLbLineType->GetSelectEntryPos(),
- GetCoreValue( *m_pMtrDistance, m_ePoolUnit ),
- static_cast<long>(m_pMtrAngle->GetValue() * 10) ));
+ aString = m_pHatchLB->GetItemText( m_pHatchLB->GetSelectItemId() );;
}
+
assert( pXHatch && "XHatch couldn't be created" );
rSet->Put( XFillStyleItem( drawing::FillStyle_HATCH ) );
rSet->Put( XFillHatchItem( aString, *pXHatch ) );