diff options
Diffstat (limited to 'sw/source/ui/frmdlg')
-rw-r--r-- | sw/source/ui/frmdlg/frmdlg.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 44 |
2 files changed, 39 insertions, 9 deletions
diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx index 413845f1eb..52280136a8 100644 --- a/sw/source/ui/frmdlg/frmdlg.cxx +++ b/sw/source/ui/frmdlg/frmdlg.cxx @@ -93,7 +93,8 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame, aTmp += *pStr; aTmp += ')'; } - AddTabPage(TP_FRM_STD, SwFrmPage::Create, 0); + + AddTabPage(TP_FRM_STD, SwFrmPage::Create, 0); AddTabPage(TP_FRM_ADD, SwFrmAddPage::Create, 0); AddTabPage(TP_FRM_WRAP, SwWrapTabPage::Create, 0); AddTabPage(TP_FRM_URL, SwFrmURLPage::Create, 0); @@ -217,3 +218,4 @@ void SwFrmDlg::PageCreated( USHORT nId, SfxTabPage &rPage ) break; } } + diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 8d371558d4..50e9754450 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -677,7 +677,10 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) : nOldV(text::VertOrientation::TOP), nOldVRel(text::RelOrientation::PRINT_AREA), pVMap( 0 ), - pHMap( 0 ) + pHMap( 0 ), + m_bAllowVertPositioning( true ), + m_bIsMathOLE( false ), + m_bIsMathBaselineAlignment( true ) { FreeResource(); SetExchangeSupport(); @@ -782,9 +785,17 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) SetMetric( aAtHorzPosED, aMetric ); SetMetric( aAtVertPosED, aMetric ); + const SfxPoolItem* pItem = NULL; const SwFmtAnchor& rAnchor = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR); + if (SFX_ITEM_SET == rSet.GetItemState(FN_OLE_IS_MATH, FALSE, &pItem)) + m_bIsMathOLE = ((const SfxBoolItem*)pItem)->GetValue(); + if (SFX_ITEM_SET == rSet.GetItemState(FN_MATH_BASELINE_ALIGNMENT, FALSE, &pItem)) + m_bIsMathBaselineAlignment = ((const SfxBoolItem*)pItem)->GetValue(); + EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment + && FLY_AS_CHAR == rAnchor.GetAnchorId()) ); + if (bFormat) { // Bei Formaten keine Ankerbearbeitung @@ -812,7 +823,6 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) if ( nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE ) { ASSERT(pSh , "shell not found"); - const SfxPoolItem* pItem; //OS: nur fuer die Variante Einfuegen/Grafik/Eigenschaften if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_GRF_REALSIZE, FALSE, &pItem)) aGrfSize = ((const SvxSizeItem*)pItem)->GetSize(); @@ -1280,8 +1290,8 @@ void SwFrmPage::InitPos(RndStdIds eId, if ( nY != LONG_MAX ) aAtVertPosED.SetValue( aAtVertPosED.Normalize(nY), FUNIT_TWIP ); } - aAtVertPosFT.Enable( bEnable ); - aAtVertPosED.Enable( bEnable ); + aAtVertPosFT.Enable( bEnable && m_bAllowVertPositioning ); + aAtVertPosED.Enable( bEnable && m_bAllowVertPositioning ); UpdateExample(); } @@ -1488,8 +1498,10 @@ ULONG SwFrmPage::FillRelLB( const FrmMap* _pMap, } } - _rLB.Enable(_rLB.GetEntryCount() != 0); - _rFT.Enable(_rLB.GetEntryCount() != 0); + const bool bEnable = _rLB.GetEntryCount() != 0 + && (&_rLB != &aVertRelationLB || m_bAllowVertPositioning); + _rLB.Enable( bEnable ); + _rFT.Enable( bEnable ); RelHdl(&_rLB); @@ -1850,6 +1862,10 @@ IMPL_LINK( SwFrmPage, AnchorTypeHdl, RadioButton *, EMPTYARG ) PosHdl(&aHorizontalDLB); PosHdl(&aVerticalDLB); } + + EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment + && FLY_AS_CHAR == eId) ); + return 0; } @@ -1875,7 +1891,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) } else { - BOOL bEnable = text::VertOrientation::NONE == nAlign; + BOOL bEnable = text::VertOrientation::NONE == nAlign && m_bAllowVertPositioning; aAtVertPosED.Enable( bEnable ); aAtVertPosFT.Enable( bEnable ); } @@ -2304,6 +2320,19 @@ void SwFrmPage::SetFormatUsed(BOOL bFmt) } } + +void SwFrmPage::EnableVerticalPositioning( bool bEnable ) +{ + m_bAllowVertPositioning = bEnable; + aVerticalFT.Enable( bEnable ); + aVerticalDLB.Enable( bEnable ); + aAtVertPosFT.Enable( bEnable ); + aAtVertPosED.Enable( bEnable ); + aVertRelationFT.Enable( bEnable ); + aVertRelationLB.Enable( bEnable ); +} + + /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ @@ -3246,4 +3275,3 @@ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) } return 0; } - |