summaryrefslogtreecommitdiff
path: root/svx/source/dialog/fontwork.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/dialog/fontwork.cxx')
-rw-r--r--svx/source/dialog/fontwork.cxx331
1 files changed, 6 insertions, 325 deletions
diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx
index 029902e50201..5e9264fc3c85 100644
--- a/svx/source/dialog/fontwork.cxx
+++ b/svx/source/dialog/fontwork.cxx
@@ -118,14 +118,6 @@ void SvxFontWorkControllerItem::StateChanged( sal_uInt16 /*nSID*/, SfxItemState
rFontWorkDlg.SetMirror_Impl(pStateItem);
break;
}
- case SID_FORMTEXT_STDFORM:
- {
- const XFormTextStdFormItem* pStateItem =
- PTR_CAST(XFormTextStdFormItem, pItem);
- DBG_ASSERT(pStateItem || pItem == 0, "XFormTextStdFormItem erwartet");
- rFontWorkDlg.SetStdForm_Impl(pStateItem);
- break;
- }
case SID_FORMTEXT_HIDEFORM:
{
const XFormTextHideFormItem* pStateItem =
@@ -215,8 +207,6 @@ SvxFontWorkDialog::SvxFontWorkDialog( SfxBindings *pBindinx,
const ResId& rResId ) :
SfxDockingWindow( pBindinx, pCW, _pParent, rResId ),
- aFormSet (this, ResId(VS_FORMS,*rResId.GetResMgr())),
-
aTbxStyle (this, ResId(TBX_STYLE,*rResId.GetResMgr())),
aTbxAdjust (this, ResId(TBX_ADJUST,*rResId.GetResMgr())),
@@ -257,16 +247,12 @@ SvxFontWorkDialog::SvxFontWorkDialog( SfxBindings *pBindinx,
pCtrlItems[2] = new SvxFontWorkControllerItem(SID_FORMTEXT_DISTANCE, *this, rBindings);
pCtrlItems[3] = new SvxFontWorkControllerItem(SID_FORMTEXT_START, *this, rBindings);
pCtrlItems[4] = new SvxFontWorkControllerItem(SID_FORMTEXT_MIRROR, *this, rBindings);
- pCtrlItems[5] = new SvxFontWorkControllerItem(SID_FORMTEXT_STDFORM, *this, rBindings);
- pCtrlItems[6] = new SvxFontWorkControllerItem(SID_FORMTEXT_HIDEFORM, *this, rBindings);
- pCtrlItems[7] = new SvxFontWorkControllerItem(SID_FORMTEXT_OUTLINE, *this, rBindings);
- pCtrlItems[8] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHADOW, *this, rBindings);
- pCtrlItems[9] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWCOLOR, *this, rBindings);
- pCtrlItems[10] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWXVAL, *this, rBindings);
- pCtrlItems[11] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWYVAL, *this, rBindings);
-
- WinBits aNewStyle = ( aFormSet.GetStyle() | WB_VSCROLL | WB_ITEMBORDER | WB_DOUBLEBORDER );
- aFormSet.SetStyle( aNewStyle );
+ pCtrlItems[5] = new SvxFontWorkControllerItem(SID_FORMTEXT_HIDEFORM, *this, rBindings);
+ pCtrlItems[6] = new SvxFontWorkControllerItem(SID_FORMTEXT_OUTLINE, *this, rBindings);
+ pCtrlItems[7] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHADOW, *this, rBindings);
+ pCtrlItems[8] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWCOLOR, *this, rBindings);
+ pCtrlItems[9] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWXVAL, *this, rBindings);
+ pCtrlItems[10] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWYVAL, *this, rBindings);
Size aSize = aTbxStyle.CalcWindowSizePixel();
aTbxStyle.SetSizePixel(aSize);
@@ -278,9 +264,6 @@ SvxFontWorkDialog::SvxFontWorkDialog( SfxBindings *pBindinx,
aTbxShadow.SetSizePixel(aSize);
aTbxShadow.SetSelectHdl( LINK(this, SvxFontWorkDialog, SelectShadowHdl_Impl) );
-// aFbShadowX.SetBitmap(Bitmap(FW_RESID(RID_SVXBMP_SHADOW_XDIST)));
-// aFbShadowY.SetBitmap(Bitmap(FW_RESID(RID_SVXBMP_SHADOW_YDIST)));
-
Link aLink = LINK(this, SvxFontWorkDialog, ModifyInputHdl_Impl);
aMtrFldDistance.SetModifyHdl( aLink );
aMtrFldTextStart.SetModifyHdl( aLink );
@@ -312,14 +295,6 @@ SvxFontWorkDialog::SvxFontWorkDialog( SfxBindings *pBindinx,
aInputTimer.SetTimeout(500);
aInputTimer.SetTimeoutHdl(LINK(this, SvxFontWorkDialog, InputTimoutHdl_Impl));
-
- aFormSet.SetSelectHdl( LINK(this, SvxFontWorkDialog, FormSelectHdl_Impl) );
- aFormSet.SetColCount(4);
- aFormSet.SetLineCount(2);
-
- Bitmap aBmp(SVX_RES(RID_SVXBMP_FONTWORK_FORM1));
- aSize.Height() = aFormSet.CalcWindowSizePixel(aBmp.GetSizePixel()).Height() + 2;
- aFormSet.SetSizePixel(aSize);
}
/*************************************************************************
@@ -520,27 +495,6 @@ void SvxFontWorkDialog::SetMirror_Impl(const XFormTextMirrorItem* pItem)
/*************************************************************************
|*
-|* Standardform im ValueSet anzeigen
-|*
-\************************************************************************/
-
-void SvxFontWorkDialog::SetStdForm_Impl(const XFormTextStdFormItem* pItem)
-{
- if ( pItem )
- {
- aFormSet.Enable();
- aFormSet.SetNoSelection();
-
- if ( pItem->GetValue() != XFTFORM_NONE )
- aFormSet.SelectItem(
- sal::static_int_cast< sal_uInt16 >(pItem->GetValue()));
- }
- else
- aFormSet.Disable();
-}
-
-/*************************************************************************
-|*
|* Button fuer Konturanzeige setzen
|*
\************************************************************************/
@@ -934,23 +888,6 @@ IMPL_LINK( SvxFontWorkDialog, InputTimoutHdl_Impl, void *, EMPTYARG )
|*
\************************************************************************/
-IMPL_LINK( SvxFontWorkDialog, FormSelectHdl_Impl, void *, EMPTYARG )
-{
- XFormTextStdFormItem aItem;
-
- if ( aFormSet.IsNoSelection() )
- aItem.SetValue(XFTFORM_NONE);
- else
- aItem.SetValue(aFormSet.GetSelectItemId());
- GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_STDFORM, SFX_CALLMODE_RECORD, &aItem, 0L );
- aFormSet.SetNoSelection();
- return 0;
-}
-
-/*************************************************************************
-|*
-\************************************************************************/
-
IMPL_LINK( SvxFontWorkDialog, ColorSelectHdl_Impl, void *, EMPTYARG )
{
// Changed by obo. Linux-Compiler can't parse commented lines
@@ -984,231 +921,6 @@ void SvxFontWorkDialog::SetActive(sal_Bool /*bActivate*/)
{
}
-/*************************************************************************
-|*
-|* Standard-FontWork-Objekt erzeugen
-|*
-\************************************************************************/
-
-void SvxFontWorkDialog::CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
- const SfxItemSet& rAttr,
- SdrObject& rOldObj,
- XFormTextStdForm eForm)
-{
- SfxItemSet aAttr(*rAttr.GetPool(), XATTR_FORMTXTSTYLE,
- XATTR_FORMTXTHIDEFORM);
- SdrObject* pNewObj = NULL;
- Rectangle aRect;
- XFormTextAdjust eAdjust = XFT_AUTOSIZE;
-
-//-/ rOldObj.TakeAttributes(aAttr, sal_True, sal_False);
- aAttr.Put(rOldObj.GetMergedItemSet());
-
- const XFormTextStdFormItem& rOldForm = (const XFormTextStdFormItem&)
- aAttr.Get(XATTR_FORMTXTSTDFORM);
-
- aRect = rOldObj.GetSnapRect();
-
- if ( !rOldObj.ISA(SdrPathObj) )
- {
- Point aPos = aRect.TopLeft();
- aRect = rOldObj.GetLogicRect();
- aRect.SetPos(aPos);
- }
-
- aAttr.Put(rAttr);
-
- if ( rOldForm.GetValue() == XFTFORM_NONE )
- {
- long nW = aRect.GetWidth();
- aRect.SetSize(Size(nW, nW));
- aAttr.Put(XFormTextStyleItem(XFT_ROTATE));
- }
-
- Point aCenter = aRect.Center();
-
- switch ( eForm )
- {
- case XFTFORM_TOPCIRC:
- case XFTFORM_BOTCIRC:
- case XFTFORM_LFTCIRC:
- case XFTFORM_RGTCIRC:
- case XFTFORM_TOPARC:
- case XFTFORM_BOTARC:
- case XFTFORM_LFTARC:
- case XFTFORM_RGTARC:
- {
- long nBeg, nEnd;
-
- switch ( eForm )
- {
- default: ; //prevent warning
- case XFTFORM_TOPCIRC:
- nBeg = 0;
- nEnd = 18000;
- break;
- case XFTFORM_BOTCIRC:
- nBeg = 18000;
- nEnd = 36000;
- break;
- case XFTFORM_LFTCIRC:
- nBeg = 9000;
- nEnd = 27000;
- break;
- case XFTFORM_RGTCIRC:
- nBeg = 27000;
- nEnd = 9000;
- break;
- case XFTFORM_TOPARC:
- nBeg = 4500;
- nEnd = 13500;
- break;
- case XFTFORM_BOTARC:
- nBeg = 22500;
- nEnd = 31500;
- break;
- case XFTFORM_LFTARC:
- nBeg = 13500;
- nEnd = 22500;
- break;
- case XFTFORM_RGTARC:
- nBeg = 31500;
- nEnd = 4500;
- break;
- }
- pNewObj = new SdrCircObj(OBJ_CARC, aRect, nBeg, nEnd);
- break;
- }
- case XFTFORM_BUTTON1:
- {
- basegfx::B2DPolyPolygon aPolyPolygon;
- basegfx::B2DPolygon aLine;
- long nR = aRect.GetWidth() / 2;
- basegfx::B2DPolygon aTopArc(XPolygon(aCenter, -nR, nR, 50, 1750, sal_False).getB2DPolygon());
- basegfx::B2DPolygon aBottomArc(XPolygon(aCenter, -nR, nR, 1850, 3550, sal_False).getB2DPolygon());
-
- // Polygone schliessen
- aTopArc.setClosed(true);
- aBottomArc.setClosed(true);
- aPolyPolygon.append(aTopArc);
-
- aLine.append(aBottomArc.getB2DPoint(aBottomArc.count() - 1L));
- aLine.append(aBottomArc.getB2DPoint(0L));
- aLine.setClosed(true);
-
- aPolyPolygon.append(aLine);
- aPolyPolygon.append(aBottomArc);
-
- pNewObj = new SdrPathObj(OBJ_PATHFILL, aPolyPolygon);
- eAdjust = XFT_CENTER;
- break;
- }
- case XFTFORM_BUTTON2:
- case XFTFORM_BUTTON3:
- case XFTFORM_BUTTON4:
- {
- basegfx::B2DPolyPolygon aPolyPolygon;
- basegfx::B2DPolygon aLine;
- long nR = aRect.GetWidth() / 2;
- long nWDiff = nR / 5;
- long nHDiff;
-
- if ( eForm == XFTFORM_BUTTON4 )
- {
- basegfx::B2DPolygon aNewArc(XPolygon(aCenter, -nR, nR, 950, 2650, sal_False).getB2DPolygon());
- aNewArc.setClosed(true);
- aPolyPolygon.append(aNewArc);
- eAdjust = XFT_CENTER;
- }
- else
- {
- basegfx::B2DPolygon aNewArc(XPolygon(aCenter, -nR, nR, 2700, 2700).getB2DPolygon());
- aPolyPolygon.append(aNewArc);
- }
-
- if ( eForm == XFTFORM_BUTTON3 )
- nHDiff = -aRect.GetHeight() / 10;
- else
- nHDiff = aRect.GetHeight() / 20;
-
- aLine.append(basegfx::B2DPoint(aRect.Left() + nWDiff, aRect.Center().Y() + nHDiff));
- aLine.append(basegfx::B2DPoint(aRect.Right() - nWDiff, aRect.Center().Y() + nHDiff));
- aLine.setClosed(true);
- aPolyPolygon.append(aLine);
-
- if ( eForm == XFTFORM_BUTTON4 )
- {
- basegfx::B2DPolygon aNewArc(XPolygon(aCenter, -nR, nR, 2750, 850, sal_False).getB2DPolygon());
- aNewArc.setClosed(true);
- aPolyPolygon.append(aNewArc);
- }
-
- if ( eForm == XFTFORM_BUTTON3 )
- {
- nHDiff += nHDiff;
- aLine.setB2DPoint(0L, basegfx::B2DPoint(aLine.getB2DPoint(0L).getX(), aLine.getB2DPoint(0L).getY() - nHDiff));
- aLine.setB2DPoint(1L, basegfx::B2DPoint(aLine.getB2DPoint(1L).getX(), aLine.getB2DPoint(1L).getY() - nHDiff));
- aPolyPolygon.append(aLine);
- }
-
- pNewObj = new SdrPathObj(OBJ_PATHFILL, aPolyPolygon);
- break;
- }
- default: ; //prevent warning
- }
- if ( pNewObj )
- {
- // #78478# due to DLs changes in Outliner the object needs
- // a model to get an outliner for later calls to
- // pNewObj->SetOutlinerParaObject(pPara) (see below).
- pNewObj->SetModel(rOldObj.GetModel());
-
- Size aSize;
- Rectangle aSnap = pNewObj->GetSnapRect();
-
- aSize.Width() = aRect.Left() - aSnap.Left();
- aSize.Height() = aRect.Top() - aSnap.Top();
- pNewObj->NbcMove(aSize);
-
- rView.BegUndo( SVX_RESSTR( RID_SVXSTR_FONTWORK_UNDOCREATE ) );
- OutlinerParaObject* pPara = rOldObj.GetOutlinerParaObject();
- sal_Bool bHide = sal_True;
-
- if ( pPara != NULL )
- {
- pPara = new OutlinerParaObject(*pPara);
- pNewObj->SetOutlinerParaObject(pPara);
- }
- else
- bHide = sal_False;
-
- rView.ReplaceObjectAtView(&rOldObj, rPV, pNewObj, sal_True);
- pNewObj->SetLayer(rOldObj.GetLayer());
- aAttr.Put(XFormTextHideFormItem(bHide));
- aAttr.Put(XFormTextAdjustItem(eAdjust));
-
- XFormTextShadow eShadow = XFTSHADOW_NONE;
-
- if ( nLastShadowTbxId == TBI_SHADOW_NORMAL )
- {
- eShadow = XFTSHADOW_NORMAL;
- aAttr.Put(XFormTextShadowXValItem(nSaveShadowX));
- aAttr.Put(XFormTextShadowYValItem(nSaveShadowY));
- }
- else if ( nLastShadowTbxId == TBI_SHADOW_SLANT )
- {
- eShadow = XFTSHADOW_SLANT;
- aAttr.Put(XFormTextShadowXValItem(nSaveShadowAngle));
- aAttr.Put(XFormTextShadowYValItem(nSaveShadowSize));
- }
-
- aAttr.Put(XFormTextShadowItem(eShadow));
-
- rView.SetAttributes(aAttr);
- rView.EndUndo();
- }
-}
-
void SvxFontWorkDialog::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
@@ -1223,37 +935,6 @@ void SvxFontWorkDialog::ApplyImageList()
{
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- ResMgr* _pMgr = &DIALOG_MGR();
-
- sal_uInt16 nBitmapResId = bHighContrast ? RID_SVXBMP_FONTWORK_FORM1_H : RID_SVXBMP_FONTWORK_FORM1;
- sal_uInt16 nTextResId = RID_SVXSTR_FONTWORK_FORM1;
-
- bool bInit = aFormSet.GetItemCount() == 0;
-
- if( bInit )
- {
-/*
- Size aSize( aTbxStyle.CalcWindowSizePixel() );
- Bitmap aBmp(ResId(RID_SVXBMP_FONTWORK_FORM1,_pMgr));
- aSize.Height() = aFormSet.CalcWindowSizePixel(aBmp.GetSizePixel()).Height() + 2;
- aFormSet.SetSizePixel(aSize);
-*/
- }
-
- sal_uInt16 i;
- for( i = 1; i < 13; i++, nTextResId++, nBitmapResId++ )
- {
- if( bInit )
- {
- aFormSet.InsertItem( i, Bitmap(ResId(nBitmapResId,*_pMgr)),
- String(ResId(nTextResId,*_pMgr)));
- }
- else
- {
- aFormSet.SetItemImage( i, Bitmap(ResId(nBitmapResId,*_pMgr)) );
- }
- }
-
ImageList& rImgLst = bHighContrast ? maImageListH : maImageList;
aTbxStyle.SetImageList( rImgLst );